First, install dnsmasq using brew:
$ brew update
$ brew install dnsmasqThen create your configuration
| extern mod extra; | |
| use extra::json::*; | |
| /* | |
| * This function manages to do absolutely no copying, which is pretty cool. | |
| * | |
| * "What are all those `'r`s?" you ask. Well, they're liftime parameters. They | |
| * indicate how long something lasts (before it's freed). They can't change how | |
| * long something lives for, they only allow you to tell the compiler stuff it |
| gifify() { | |
| if [[ -n "$1" ]]; then | |
| if [[ $2 == '--good' ]]; then | |
| ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
| time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
| rm out-static*.png | |
| else | |
| ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
| fi | |
| else |
| license: gpl-3.0 |
| // right navigation button | |
| var btn = Ti.UI.createButton({ | |
| title:'button' | |
| }); | |
| // window | |
| var win = Ti.UI.createWindow({ | |
| rightNavButton:btn, | |
| backgroundColor:'blue' | |
| }); |
How to list the content type of all files in a Cloudfiles container.
dw-is-my-hero.js to that folderdw-is-my-hero.js and change USERNAME and API_KEY to your username and API keynode dw-is-my-hero.js CONTAINER_NAME| npm config set registry http://registry.npmjs.org/ | |
| npm config set proxy http://http-proxy.com:80 | |
| npm install -d |
| How to add cmd-left-arrow and cmd-right-arrow (without shift) key bindings to the mac os x Terminal | |
| app if the Lion install removed this bindings from your system. | |
| 1) Open "System Preferences". | |
| 2) Go to "Keyboard". | |
| 3) Select the "Keyboard Shortcuts" tab. | |
| 4) Select "Application Shortcuts" from the list of items in the left. | |
| 5) Press "+" to add a new shurtcut. | |
| 6) As "Application" select "Terminal", as "Menu Title" use: "Select Next Tab". For the "Keyboard Shortcut" field just select the field and press cmd-right-arrow. | |
| 7) Repeat again from step 5, using "Select Previous Tab" as Menu Title and pressing cmd-left-arrow as keyboard shortcut. |
| <html> | |
| <head> | |
| <script src="/socket.io/socket.io.js"></script> | |
| </head> | |
| <body> | |
| <div id="output"></div> | |
| <script> | |
| function write (msg) { | |
| var p = document.createElement('p'); | |
| p.innerHTML = 'LOG: ' + msg; |