Skip to content

Instantly share code, notes, and snippets.

@mattpodwysocki
mattpodwysocki / jsconf-eu-2011.md
Created October 1, 2011 13:40
JSConf.EU Slides
@sofish
sofish / textStorage.js
Created September 16, 2011 03:13
Cross-browser TextStorage Solution
/**
* @ NAME: Cross-browser TextStorage
* @ DESC: text storage solution for your pages
* @ COPY: sofish, http://sofish.de
*/
typeof window.localStorage == 'undefined' && ~function () {
var localStorage = window.localStorage = {},
prefix = 'data-userdata',
doc = document,
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@nzakas
nzakas / es6proxy.htm
Created September 8, 2011 01:02
Example of ES6 Proxy
<!DOCTYPE html>
<!--
This is a simple experiment relying on ECMAScript 6 Proxies. To try this out,
use Aurora (http://www.mozilla.org/en-US/firefox/channel/).
The goal was to create a HTML writer where the method names were really just
the HTML tags names, but without manually creating each method. This uses
a Proxy to create a shell to an underlying writer object that checks each
method name to see if it's in a list of known tags.
@fundon
fundon / handle.js
Created August 27, 2011 04:32
JavaScript: Chain Of Responsibility(cor)
var NO_TOPIC = -1;
var Topic;
function Handler(s, t) {
this.successor = s || null;
this.topic = t || 0;
}
Handler.prototype = {
handle: function () {
@jrburke
jrburke / nulleval.js
Created August 17, 2011 20:58
(null,eval)('')
//Came across this in the es-discuss list, on the "clean scope" thread:
https://mail.mozilla.org/pipermail/es-discuss/2011-August/thread.html#16294
//I do not understand what the "null," part buys.
//Has to do something with scope(?), but at least in Firebug,
//I can see foo inside the string being evaled.
var foo = 'foo';
(null,eval)('(function(){console.log(foo);}())');
@tmpvar
tmpvar / opengl-learning.md
Created August 13, 2011 23:00
Opengl factoids
@haikusw
haikusw / gist:1050447
Created June 28, 2011 03:48
Objective C singleton pattern templates discussion
// Accessorizer's default generated singleton code for class Foo
static Foo *sharedInstance = nil;
+ (void) initialize
{
if (sharedInstance == nil)
sharedInstance = [[self alloc] init];
}
@3rd-Eden
3rd-Eden / factory.js
Created June 20, 2011 18:38
XHR request factory, only does the feature detection once and generates a dedicated function
util.request = (function(){
var fn = {
body: 'return null'
};
if ('XDomainRequest' in window){
fn.body = 'return new XDomainRequest();';
fn.xdomain = true;
} else if ('XMLHttpRequest' in window) {
fn.body = 'return new XMLHttpRequest();';
@scottmessinger
scottmessinger / gist:1033617
Created June 19, 2011 00:09
Backbone.js todos vs knockout.js todos
We couldn’t find that file to show.