Skip to content

Instantly share code, notes, and snippets.

View couto's full-sized avatar
👽
Did you raid area 51?

Luís Couto couto

👽
Did you raid area 51?
View GitHub Profile
var EventEmitter = require('events').EventEmitter,
callback = (function () {
var called = 0,
spy = function () { called += 1; };
spy.callCount = function () {
return called;
};
return spy;
define([
//<validation>
'mout/lang/isString',
'mout/lang/isFunction',
'mout/lang/isBoolean',
//</validation>
'mout/lang/toArray'
], function (
//<validation>
isString,
function castElement(el, target) {
// Convert nodelists and weird dom stuff into arrays
var attrs = [].slice.call(el.attributes, 0),
children = [].slice.call(el.childNodes, 0);
// create final element
element = document.createElement(target);
// copy attributes to new element
attrs.forEach(function (attr) {
element.setAttribute(attr.name, attr.value);
@couto
couto / docgens.md
Created August 5, 2013 12:33
A collection of documentation generators for Javascript
// Place your settings in the file "User/Preferences.sublime-settings", which
// overrides the settings in here.
//
// Settings may also be placed in file type specific options files, for
// example, in Packages/Python/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
// Note that the font_face and font_size are overriden in the platform

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

/*jshint node:true*/
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
files: {
http : '/',
html: '../application/views',
css : 'stylesheets',
Vagrant.configure("2") do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.hostname = "musicbrainzvm"
config.vm.provider :vmware_fusion do |v, override|
override.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box"
override.vm.box = "precise64_vmware.box"
end

First, install dnsmasq using brew:

$ brew update
$ brew install dnsmasq

Then create your configuration

#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s http://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'