Skip to content

Instantly share code, notes, and snippets.

View j3lte's full-sized avatar

Jelte Lagendijk j3lte

View GitHub Profile
// everyone's new favorite closure pattern:
(function(window,document,undefined){ ... })(this,this.document);
// when minified:
(function(w,d,u){ ... })(this,this.document);
// which means all uses of window/document/undefined inside the closure
// will be single-lettered, so big gains in minification.
// it also will speed up scope chain traversal a tiny tiny little bit.

Step 1: Clone the bundles into your Sublime Text packages directory

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScript
git clone https://github.com/miksago/jade-tmbundle.git Jade
git clone https://github.com/LearnBoost/stylus.git Stylus

Step 2: Restart Sublime Text 2

* [AdvancedNewFile](https://github.com/skuroda/Sublime-AdvancedNewFile)
* [AngularJS](https://github.com/angular-ui/AngularJS-sublime-package)
* [AngularJS (CoffeeScript)](https://github.com/Iristyle/Sublime-AngularJS-Coffee-Completions)
* [AngularJS Snippets](https://github.com/maxhoffmann/angular-snippets)
* [ApplySyntax](https://github.com/facelessuser/ApplySyntax)
* [Automatic Backups](https://github.com/joelpt/sublimetext-automatic-backups)
* [BracketHighlighter](https://github.com/facelessuser/BracketHighlighter)
* [ChangeQuotes](https://github.com/colinta/SublimeChangeQuotes)
* [Clipboard History](https://github.com/kemayo/sublime-text-2-clipboard-history)
* [Coffee Formatter](https://github.com/derekchiang/Sublime-CoffeeScript-Formatter)
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
(function( jQuery, window, undefined ) {
"use strict";
var matched, browser;
jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
function img2table( img ){
var canvas = document.createElement('canvas')
, ctx = canvas.getContext('2d')
, table = document.createElement('table')
, width = canvas.width = img.width
, height = canvas.height = img.height
, pixels
, i, j, l1, l2
, tr, td, r, g, b

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

npm version patch -m "Version %s"
git push
git push --tags
npm publish
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.