I’ve written another article for JSPro.com, this time on event delegation with jQuery. You can read it here: http://jspro.com/jquery/event-delegation-with-jquery/
You can read it here: Package Management for the Browser with Bower.
If you’re working on a pet project and aren’t quite ready to share it with the world via GitHub, here’s a handy way you can backup your work to the cloud using Dropbox as a git remote:
- Create a new, empty folder in your Dropbox to house your project’s remote:
- Initialise a bare git repository in this newly created folder:
NB A bare repository in Git is one that only contains the revision info and system files (the files you’d normally find in the hidden
.git directory), and doesn’t contain the working tree. From Git version 1.7.0 and onwards, a repository has to be a bare repository in order to accept a push, so we must create our Dropbox remote as a bare repository.
- Add our new remote to our project:
- Push our work to our
You can then interact with your Dropbox remote the same way you would with any other.
You can install node-encdec via npm:
npm install node-encdec # or to install globally npm install -g node-encdec
I’ve been having some fun with nxt-python recently, a programming library for Lego Mindstorms. One of the examples lets you play the tune Mary Had A Little Lamb via the Mindstorms brick. I thought I could do one better and made my son’s Mindstorms play Smoke on the Water:
Pretty simple when you know how:
Here’s a little script that outputs tomorrow’s weather forecast, using the Yahoo Weather API:
Sinatra Up and Running is a good read both for web developers who want to start building web applications with Sinatra, and for experiencedRuby developers who want to learn how Sinatra works under the covers.
The book is organised with the above in mind, making it easy to find the information you need. The first part covers the basics of Sinatra and focuses on giving you the knowledge you’ll need to start writing your own Sinatra powered web applications. Part two gets more technical, and looks at how Sinatra works under the covers, how you can write your own helpers and extensions, how Sinatra can be used as Rack middleware, and you can use it to create modular applications. The final part ties everything together and walks the reader through creating a Sinatra powered blog.
I enjoyed reading Sinatra: Up and Running. It’s well written, and full of code samples to help give you a better understanding of the concepts discussed. If you’re looking for a book on Sinatra then I’d recommend this one without hesitation.
Disclaimer: This book was reviewed as part of the O’Reilly Blogger Review program.
Probably the easiest way to remap the Capslock key in Windows is to use AutoHotkey. I have an AutoHotkey script set to run when my machine starts up that remaps Capslock to Escape. All it contains is this:
If you want to remap Capslock to Ctrl instead, just replace
No registry hacking required.
Since I’ve been using Git, git-svn has become my preferred way of using Subversion. To make that
git svn clone command a bit easier for svn projects hosted on Google Code, I’ve created a Greasemonkey script / user script that:
- Finds the
svn checkoutcommand on the source checkout page e.g. https://code.google.com/p/bbc-radio-scrobbler/source/checkout
- Appends the equivalent
git svn clonecommand, using the standard layout option
The source code is available on GitHub, and you can install it directly from this link: https://github.com/ianoxley/gitsvnscript/raw/master/gitsvn.user.js