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
$.support.placeholder = 'placeholder' in document.createElement('input'); |
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
var dispatcher = { | |
location: window.location, | |
stash : [], | |
connect: function(paths, action) { | |
if (paths || paths === 0) { | |
paths = paths.valueOf(); | |
if (!(typeof paths == 'object' && !(paths instanceof RegExp))) // webkit: typeof RegExp == 'function' | |
paths = { pathname: paths }; | |
dispatcher.stash.push([paths, action]); |
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 sh | |
appcfg.py update ~/Sites/static.carbonfairy.org | |
echo | |
node tumblr-update-theme.js username password account theme_file |
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
#!ruby -Ku | |
require 'csv' | |
tr = [] | |
CSV.open(ARGV[0], 'r') do |row| | |
td = [] | |
row.each do |i| | |
if i | |
td.push("<td id=\"#{i}\" class=\"border\">#{i.sub(/\D+/, '')}</td>\n") |
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
hashState = function(queries) { | |
var k, q; | |
if (queries === null) { | |
// fx 3.0.x reloads page when hash is empty | |
location.hash = '#'; | |
return null; | |
} | |
else if (!queries) { | |
q = location.hash.slice(1); | |
// fx decodes automatically |
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
(function($) { | |
$.fn.replaceClass = function(proc) { | |
return this.each(function() { | |
var classes = this.className.split(/\s+/), new_classes = []; | |
for (var i = 0, klass, ret; klass = classes[i]; ++i) { | |
ret = proc.call(this, i, klass); | |
if (ret) { | |
new_classes.push(typeof ret == 'string' ? ret : classes[i]); | |
} | |
} |
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
foo && foo( { | |
"name": "Tumblr, Inc.", | |
"Status": { | |
"code": 200, | |
"request": "geocode" | |
}, | |
"Placemark": [ { | |
"id": "p1", | |
"address": "Nyc Dance and Tumble, 209 Branchview Dr NE, Concord, NC 28025, USA", | |
"AddressDetails": { |
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
(function(ns) { | |
ns.rarely = rarely(); | |
function rarely() { | |
var timer = null; | |
return rarely; |
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
function element(tag_name, properties) { | |
var element = document.createElement(tag_name); | |
for (var k in properties) { | |
element[k] = properties[k]; | |
} | |
return element; | |
} |
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
(function($) { | |
$.support.placeholder = 'placeholder' in document.createElement('input'); | |
$.fn.placeholder = function() { | |
var supported = $.support.placeholder; | |
if (!supported) { | |
this.each(function() { | |
var input = $('input[placeholder]', this); | |
if (input.length) { | |
var placeholder = $('<div class="placeholder">' + input.attr('placeholder') + '</div>') |