Skip to content

Instantly share code, notes, and snippets.

@subtleGradient
subtleGradient / position-fixed.css
Created July 29, 2009 16:17
Make position:fixed work in IE6
/*Make position:fixed work in IE6!*/
.fixed-top /* position fixed Top */{position:fixed;bottom:auto;top:0;}
.fixed-bottom /* position fixed Bottom */{position:fixed;bottom:0;top:auto;}
.fixed-left /* position fixed Left */{position:fixed;right:auto;left:0;}
.fixed-right /* position fixed right */{position:fixed;right:0;left:auto;}
* html,* html body /* IE6 Fixed Position Jitter Fix */{background-image:url(about:blank);background-attachment:fixed;}
* html .fixed-top /* IE6 position fixed Top */{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop));}
* html .fixed-right /* IE6 position fixed right */{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));}
@defunkt
defunkt / installing-mustache-mode.el.md
Created March 6, 2010 10:11
Installing mustache-mode.el

https://github.com/mustache/emacs

In your shell:

cd ~/.emacs.d/vendor
curl -O https://github.com/mustache/emacs/raw/master/mustache-mode.el

In your Emacs config:

(add-to-list 'load-path "~/.emacs.d/vendor/mustache-mode.el")

@mowen
mowen / org-style.css
Created March 9, 2010 12:19
A stylesheet for the Emacs Org Mode HTML export
/**
* This stylesheet will work pretty well with a regular Org Mode HTML export.
* However, you do have to turn off all of the defaults:
*
* (setq org-export-html-style-include-scripts nil
* org-export-html-style-include-default nil)
*
* and insert a call to the stylesheet:
*
* (setq org-export-html-style
@isaacs
isaacs / comma-first-var.js
Created April 6, 2010 19:24
A better coding convention for lists and object literals in JavaScript
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@cowboy
cowboy / very-small-ie-detect.js
Created August 21, 2010 13:26 — forked from padolsey/gist:527683
Very small IE detect (aka type coersion ftw)
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 6) then:
// ie === 0
// If you're in IE (>=6) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@desandro
desandro / jquery.imagesloaded.js
Created January 26, 2011 18:01 — forked from paulirish/README.md
$.fn.imagesLoaded jQuery plugin
// $('img.photo',this).imagesLoaded(myFunction)
// execute a callback when all images have loaded.
// needed because .load() doesn't work on cached images
// Modified with a two-pass approach to changing image
// src. First, the proxy imagedata is set, which leads
// to the first callback being triggered, which resets
// imagedata to the original src, which fires the final,
// user defined callback.
@140bytes
140bytes / LICENSE.txt
Created May 9, 2011 16:13
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@founddrama
founddrama / gist:1013614
Created June 8, 2011 01:42
a jshint pre-commit hook for git
#!/bin/sh
# A pre-commit hook for git to lint JavaScript files with jshint
# @see https://github.com/jshint/jshint/
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
@alexgibson
alexgibson / Touch-Event-Delegation.js
Created July 6, 2011 19:38
Event delegation for JavaScript 'tap' events
var tapArea, moved, startX, startY;
tapArea = document.querySelector('#list'); //the element to delegate
moved = false; //flags if the finger has moved
startX = 0; //starting x coordinate
startY = 0; //starting y coordinate
//touchstart
tapArea.ontouchstart = function(e) {