Skip to content

Instantly share code, notes, and snippets.

@gf3
gf3 / description.txt
Created December 18, 2009 07:12 — forked from mislav/description.txt
Git Workflow
so my workflow is that each ticket gets a branch. Before merging the branch to master
it needs to be peer-reviewed. So sometimes I have a bunch of branches that are off
being reviewed while I work on something else.
Currently when I run "git branch" I see:
[branch 1]
[branch 2]
[branch 3]
*[branch 4]
[branch 5]
@remy
remy / gist:330318
Created March 12, 2010 13:59
autofocus and placeholder support
/**
* Add this script to the end of your document that use <input autofocus type="text" />
* or <input type="text" placeholder="username" /> and it'll plug support for browser
* without these attributes
* Minified version at the bottom
*/
(function () {
function each(list, fn) {
var l = list.length;
@remy
remy / gist:349069
Created March 30, 2010 12:46
Early version of XUI native animations with drop back on to Emile/timer based
(function ($, window, undefined) {
var m = document.createElement('i'),
m_style = m.style,
// TODO support other browsers easings - based on Safari's easing options and ported to Emile easing.
stanardEasing = {
'ease-in-out' : function(pos){if((pos/=0.5)<1){return 0.5*Math.pow(pos,4);}return -0.5*((pos-=2)*Math.pow(pos,3)-2);},
'ease-in' : function(pos){return Math.pow(pos,4);},
'ease-out' : function(pos){return Math.pow(pos,0.25);},
'linear': function (i) {return i;}
// jQuery.support.css3
// verifies css3 properties across browsers
// i.e. $.support.css3('transition')
$.support.css3 = function(prop) {
var
support = false,
thisBody = document.body || document.documentElement,
thisStyle = thisBody.style,
uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1),
props = [
@kara-ryli
kara-ryli / 1.url.js
Created July 27, 2010 21:53
How to convert text into HTML links in JavaScript, based on http://daringfireball.net/2010/07/improved_regex_for_matching_urls
var GRUBERS_URL_RE = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i;
@cowboy
cowboy / is-this-partial-application.js
Created September 16, 2010 20:26
Is this partial application? Currying? Something else? Vindaloo maybe?
// See my blog post:
// http://benalman.com/news/2010/09/partial-application-in-javascript/
// In the following code sample, invoking the curried function will always
// return a function until all arguments are satisfied, at which point the
// original function is invoked, returning its result. This means that all
// function arguments are required, which also allows the function to be
// called either like foo( 1, 2, 3 ) or foo( 1 )( 2 )( 3 ). This also means
// that if any argument is omitted, the original function is never invoked.
@jed
jed / userAgentJavascriptTest.js
Created October 28, 2010 12:12
send different content based on sideloaded javascript
var urls = {}
require( "http" ).createServer( function( req, res ) {
var url = req.url, timeout
if ( url == "/favicon.ico" ) return res.writeHead( 404 ), res.end()
if ( url in urls ) return urls[ url ]( req, res )
url = "/vapor.js?" + Math.floor( Math.random() * 0xcfd41b9100000 ).toString( 36 )
@airportyh
airportyh / Modernizr.tutti
Created December 22, 2010 21:10
Loading Modernizr inside Tutti
Connecting...
Welcome to Tutti - interactively run Javascript on multiple browsers!
====================================================================
You can execute any Javascript in the shell below.
Connected browsers: Firefox 3.6, IE 8.0
To connect another browser, just copy-n-paste the current URL into it.
Firefox 3.6 disconnected
@figital
figital / fstring
Created February 9, 2011 21:12
fstring
#! /bin/bash
# description: search a directory for a string, output filenames and context
# usage: fstring /tmp/whatever mysearch
# example: fstring ./ hello (search current directory for string "hello"
# better example:
# sfitchet@crunchbang:/tmp/myapp$ fstring ./ array_slice
@csnover
csnover / README.md
Created February 21, 2011 01:11
Gyazo script
  1. Change $path and $uri as necessary in gyazo.php and upload it to your server
  2. Change HOST and CGI as necessary in script and use it to replace Gyazo.app/Contents/Resources/script (right-click -> Show Package Contents to get there)
  3. Continue along as usual