Skip to content

Instantly share code, notes, and snippets.

@garth
garth / Jakefile.js
Created December 1, 2011 12:06
Example Jakefile from ViennaJS meetup
// Jake is like Rake for nodejs https://github.com/mde/jake
//
// Assumes that Jake will be run in the root of the web app with coffee files in /js/ and
// a single app.less file in /css/ that can include references to other .less files
//
//requires
var sys = require('util');
var execute = require('child_process').exec;
var fs = require('fs');
@jrburke
jrburke / gist:1262861
Created October 4, 2011 21:26
Universal (AMD/Node/plain browser) module
/**
* First, better, "set exports/return" option
*/
(function (define) {
//The 'id' is optional, but recommended if this is
//a popular web library that is used mostly in
//non-AMD/Node environments. However, if want
//to make an anonymous module, remove the 'id'
//below, and remove the id use in the define shim.
define('id', function (require) {
@ryanflorence
ryanflorence / universal-module.js
Created September 6, 2011 18:10
Universal JavaScript Module, supports AMD (RequireJS), Node.js, and the browser.
(function (name, definition){
if (typeof define === 'function'){ // AMD
define(definition);
} else if (typeof module !== 'undefined' && module.exports) { // Node.js
module.exports = definition();
} else { // Browser
var theModule = definition(), global = this, old = global[name];
theModule.noConflict = function () {
global[name] = old;
return theModule;
@uasi
uasi / vim.rb
Created November 30, 2010 16:46
Vim formula for Homebrew (EDIT: recent versions of official Homebrew distribution includes one)
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d'
version '7.3.682'
def features; %w(tiny small normal big huge) end