April 12, 2013 at 3:00pm
See the source code on Github:
This is a basic Grunt setup for
- Watch tasks
It assumes the following directory setup:
Of course you need node.js. You start by installing the necessary node packages (defined in
Make sure you add the
node_modules directory in your
.gitignore. This will install the following packages:
Start the default task:
Start the watch task for the coffeescripts:
Start the watch task for the sass files:
It produces the following files:
You can include the main.min.js in production or main.js for development purposes.
See for more information.
There are times that manufacturer don’t provide decent software support for OSX. Having only a windows version of a software package, requires you to install this in a VM. One problem you might encounter is the use of Bluetooth within a VM. Apparently, you can’t share one Bluetooth device between the host and his guest.
Workaround for VirtualBox
Install the `VirtualBox 4.2.6 Oracle VM VirtualBox Extension Pack` (or just latest) from https://www.virtualbox.org/wiki/Downloads.
In the settings of your VM guest you activate the USB port and `Enable USB 2.0 (EHCI) Controller`:
Before you boot up the host, you need to deactivate Bluetooth in OSX to make it available in you host.
Create an application of this script: https://gist.github.com/2762217
Use Applescript Editor > Save as Application.
When execute the app the following dialog will pop up.
If you want Bluetooth to be available in VirtualBox, choose VirtualBox.
If you want Bluetooth to be available in OSX, choose Mac OS.
Next, you boot up your VM and Add Bluetooth Device, you can use the Broadcom Bluetooth drivers.
This worked on my Macbook Pro:
This is the setup:
When using Require.js, you can use r.js for compilation. It has a rather extensive documentation but it is not really clear how to set things up.
This is the directory structure:
The Require.js config with the following contents:
Note the deps:  part. This is the name of the file which contains the start of your application.
We load in the router file and initialize it.
Among the regular grunt tasks (coffeescript, minify, …) we have this:
- mainConfigFile: the location of the compiled build.coffee script. This is configuration of Require.js
- baseUrl: location of all the compiled js files
- name: the name of your main application file
- include: the name of your require.js config file, this makes sure you include the require.js files as well
I used the grunt-contrib-requirejs grunt plugin. Load it in your grunt.js file:
When you are in DEVELOPMENT. You need to reference the build.js file in order to load your application. In PRODUCTION you can safely load the main.min.js.
Fix for `ValueError: unknown locale: UTF-8`.
Ran into this with Django 1.4.1 on OSX 10.7.4.
My Raspberry Pi case. Colourful! (Taken with Instagram)
MySQL was running at a constant 80% CPU load. A stop and restart didn’t make any difference. Stackoverflow pointed me in the direction of the leap second (july 1st) problem: http://stackoverflow.com/questions/1282232/mysql-high-cpu-usage/11293475#11293475
This resolved the MySQL load:
I had some `lost` Resque workers hanging in my Redis database. They couldn’t be found in the process list on my server (as they didn’t exist anymore), so I couldn’t kill them.
The following snippet helped me removing them from my Resque admin.
To be executed on your server.