to hex
d.toString(16) Beautifully simple way to get a hex value from a number. Note that d is a number. If you want a string as a hex XML valid code, use: '&#x' + parseInt(number).toString(16).toUpperCase() + ';'
d.toString(16) Beautifully simple way to get a hex value from a number. Note that d is a number. If you want a string as a hex XML valid code, use: '&#x' + parseInt(number).toString(16).toUpperCase() + ';'
ps ax | grep lookupd | grep -v grep | perl -ne 'split; print $_[0]' | xargs sudo kill -HUP I'm often connecting to different networks depending on what job I'm doing, and sometimes I'll need to tweak my /etc/hosts file. Since my system will cache DNS lookups, I'll need to restart lookupd, and this [...]
Cameron Moll gave a presentation at dConstruct 2007. At one point during the presentation, he demonstrated how he checked that the typography still held the weight on the National Gazette front page redesign (pg. 42). Since they're fun nuggets of code, I've written a simple bookmarklet that strips colour, images and background decoration from the page, leaving [...]
To follow on from Auto-populating Select Boxes using jQuery & AJAX, I've had more than a few requests for how to do this for multiple select boxes. In response, I've written a jQuery plugin and have included a simple example of three select boxes populating each other driven by a MySQL database.
mysql $DB -u$USERNAME -p$PASSWORD -e 'show tables like "$LIKE%"' | grep -v Tables_in | xargs mysqldump --add-drop-table $DB -u$USERNAME -p$PASSWORD Replace dollar variables with your details to drop a group of tables. Useful when you've got one database hosting a number of different web sites and you need a dump of a particular site.
I recently wrote my first Dashboard app: HTML entities (named in the top 10 widgets by engadget.com), widget using Dashcode. Since the product (Dashcode) is still in beta, there wasn't a great deal of resource available for developing widgets, so I'm sharing my experience and any tips I can offer for development.
It's my birthday today, and a card from my mother gave me a boost of inspiration. I'm not one to fall for that Hallmark crap, but seeing as my business also had it's birthday, the message felt encouraging: Shoot for the moon. Even if you miss, you'll land among the stars... (Unknown)