Category Archives: Hacks

QAssert: JavaScript assertions with AJAX reporting!

QAssert is a powerful, easy-to-use, JavaScript assertion suite. In contrast to console.assert() it enables you to report failures via AJAX. It gives you also powerful assertion functions and is cross-browser compatible. It can be used in both in unit, functional and manual tests, and notably also in production code. QAssert is especially useful for regression [...]

Posted in Hacks | 2 Comments

Instant PHP eval

Here is the code you get a form with, you can submit php code, it gets evaluated on the server. SECURITY WARNING: command(s) below will be all executed in PHP’s server context! Deny public acces. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>PHP evaluator</title> </head> <body> <div> <?php $function = "eval"; $arguments = "return true"; [...]

Posted in Hacks | 3 Comments

How to write down passwords onto paper safely?

Writing down usernames and passwords with a pen is insecure in so many ways I do not attempt to count. The sheer count of passwords however, forces most persons to store them somewhere, instead of keeping all of them just in your head. The digital solution is to protect the passwords with another password in [...]

Posted in Hacks | Leave a comment

Three questions for an architect

For a release sign-off Do all unit, automated and regression tests run? What is the status of outstanding bugs? Are all changes demonstrated to stakeholders? For a design sign-off Are all transformations from the input domain to the output domain possible? Identify first risky and/or complex ones. Are all our needs supported by an API? [...]

Posted in Hacks | Leave a comment

How to archive Drupal as a static site?

Here is the summary how I’ve managed to archive my Drupal weblog before migrating to WordPress. To do this, you should never put your blog/site to the root of your URL, i.e. example.com/ . Instead, put it under a directory like example.com/foo so you can it archive it under this address and put up your [...]

Posted in Hacks | Tagged , | 4 Comments

Import XLS/CSV into MS SQL

What about the simple task of importing a tabular Microsoft Excel Sheet into a Microsoft Transact SQL table? After paying thousands of dollars in license fees, this will take you a day! And you will need OpenOffice to do that :) First google “import xls into mssql” will give you a simple solution: SELECT * [...]

Posted in Hacks | Tagged , , | Leave a comment

Captcha for CakePHP 1.3 with KCAPTCHA

We are going to use KCAPTCHA to generate Captchas and verify them in form submissions in CakePHP. Look at phpinfo(), you will need First, download KCAPTCHA and put the directory “kcaptcha” from the .zip into app/vendors/. Insert this into any view you want to have a captcha on: $(function() { // jQuery, onload $(“.captcha”).attr(‘src’, forUrl(‘/ajax/captcha/’ [...]

Posted in Hacks | Tagged , , | 7 Comments

Twitter OAUTH

Twitter will phase out the widely-used HTTP basic authentication by August 2010. The amount of working examples online makes me believe that most applications that make use of the Twitter API is not migrated yet. Even the simplest action will requires to use OAUTH. This tutorial will guide you through the authentication process. In the [...]

Posted in Hacks | Tagged , , | 4 Comments

Hello world!

It’s about time. Finally I managed to migrate my blog engine to WordPress instead of Drupal. This is mainly a technical decision: Blog engines regularly receive software updates. Updating Drupal is a real royal pain in the ass. Every two weeks you need to disable your site, disable all plugins, unzip the core and all [...]

Posted in Hacks | 4 Comments