This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Step 1. global definition | |
function Map(config) { | |
this._init(config); | |
} | |
Map.prototype = { | |
_container: null, | |
_init: function (config) { | |
this._container = document.getElementById(config.container); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------------------------------------------------- | |
// 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 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name UTM param stripper | |
// @author Paul Irish | |
// @namespace http://github.com/paulirish | |
// @version 1.2 | |
// @description Drop the UTM params from a URL when the page loads. | |
// @extra Cuz you know they're all ugly n shit. | |
// @include http*://* | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# url : https://gist.github.com/672684 | |
# version : 2.0.2 | |
# name : appify | |
# description : Create the simplest possible mac app from a shell script. | |
# usage : cat my-script.sh | appify MyApp | |
# platform : Mac OS X | |
# author : Thomas Aylott <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Based on https://gist.github.com/583836 from http://stackoverflow.com/questions/3709391/node-js-base64-encode-a-downloaded-image-for-use-in-data-uri. | |
* Neither that gist nor this one work for me in 0.2.x or 0.3.x. | |
*/ | |
var request = require('request'), | |
BufferList = require('bufferlist').BufferList, | |
sys = require('sys'), | |
bl = new BufferList(), | |
url = 'http://nodejs.org/logo.png' | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* jQuery special events for delayedEnter, delayedLeave, and delayedHover | |
* Author: Scott Jehl, [email protected] | |
* Copyright (c) 2011 Filament Group | |
* licensed under MIT | |
* note: Each event can be used with bind or live event handling as you would use mouseenter,mouseleave, and hover | |
* events fire after 200ms timeout | |
*/ | |
(function($){ | |
//delayedEnter event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Cross browser way of comparing different color types | |
* | |
* Inspired by: | |
* http://dean.edwards.name/weblog/2009/10/convert-any-colour-value-to-hex-in-msie/ | |
* | |
* @author Christopher Blum | |
* @example | |
* compareColors("fuchsia", "rgb(255, 0, 255)"); | |
* // => true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sleep 0.5 && open /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If you're a glutton for punishment, and/or claim | |
// that JavaScript libraries have too much "bloat", | |
// use this to force yourself to write JS longhand. | |
(function(window) { | |
function screwed() { | |
window._ = null; | |
window.$ = null; | |
window.$A = null; | |
window.$F = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* emToPx: convert a global em-based value to pixels | |
* Copyright 2011, Scott Jehl, scottjehl.com | |
* MIT License | |
* Usage: emToPx function accepts a single number/float argument, returns a number | |
*/ | |
var emToPx = (function( win ){ | |
var doc = win.document, | |
body = doc.body, | |
prop = "fontSize", |
OlderNewer