onchange in ckeditor
I needed to track changes to source in a CKeditor instance, as my recent work uses a lot of “on-the-fly” updating. Using Alfonso’s onChange plugin, it was a simple matter to capture changes when in...
View Articleseparating buttons in jquery-ui dialog
By default, the jQuery-UI dialog will place buttons on the right side of the popup: This causes a problem because if you have “OK” right next to “Delete”, and you click the wrong one, well … The...
View Articlefirst and last saturday of a month
I’m working on an expenses application. In order to do it, I need to display the entire month, with full weeks in each (from Saturday to Friday). To do this, I need to know what date the Saturday in...
View Articlemusical intervals trainer, web version
last weekend, I wrote an intervals trainer app for practicing recognising intervals. I want other people to use it, but haven’t got a Google development account yet so can’t upload an app. So, today, I...
View Articlecode golf
I came across a new (to me) game yesterday – Code Golf. The game involves coming up with an algorithm to solve a programming problem, and trying to condense the code for the algorithm into the smallest...
View Articlestraightening an image of horizontal lines
I’m working on a mobile app for photographing sheet music and then playing it. When I first approached this, I considered using a Hough transform, which is a mathematical tool for finding lines in an...
View ArticleSimple geo-ip based links
simple geoip based links, for when you need to link to different files depending on the client’s country. requires PHP, jQuery. in the head of the document, have this:...
View ArticleCSRF
CSRF (cross-site request forgery) are hacks where a user on one system is tricked into doing something on that system while browsing another system. Example Let’s say you are logged into...
View ArticleKeeping a PHP session alive
I get asked this a lot. When you log into a session-based system, and walk away for half an hour, frequently you’ll come back to find it is no longer logged in. How do you keep the session alive when...
View Articlekbarcode part 1 – JavaScript
Short story: Github repository for kbarcode – the JavaScript part of the solution. You can use it on its own, without needing Cordova at all. Demo of kbarcode finding a barcode and then the barcode...
View Article