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
# Enable Safari's debug menu | |
defaults write com.apple.Safari IncludeInternalDebugMenu -bool 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
/** | |
* adds param support to older engines | |
* | |
* var timeoutID = window.setTimeout(func, delay, [param1, param2, ...]); | |
* var intervalID = window.setInterval(func, delay, [param1, param2, ...]); | |
*/ | |
if (!Function.prototype.bind) (function () { | |
window.setTimeout = helper(window.setTimeout); | |
window.setInterval = helper(window.setInterval); |
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 generate_keyframe_animation (name, frames, height) { | |
var steps = []; | |
for (var frame = 0; frame < frames; frame++) { | |
var percent = ((frame / (frames - 1)) * 100).toFixed(2); | |
steps.push('\t' + percent + '% { background-position: 0px ' + (-height * frame) + 'px; }'); | |
} | |
return '@-webkit-keyframes ' + name + ' {\n' + steps.join('\n') + '\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
function RollingAverage ($config) { | |
$config = $config || {}; | |
this._average = $config.average || 0; | |
this._numbers = $config.numbers || 0; | |
} | |
RollingAverage.prototype.push = function (number) { | |
this._numbers++; | |
var weight = 1 / this._numbers; | |
this._average += (number - this._average) * weight; | |
return this._average; |
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
body { | |
background-color: #eeeeee; | |
} | |
#posts { | |
margin: 0px; | |
padding: 0px; | |
list-style: none; | |
} | |
#posts .post { |
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
* { | |
font-family: helvetica; | |
color: #eeeeee; | |
} | |
.count { | |
margin-right: 10px; | |
height: 50px; | |
padding: 4px; | |
text-align: center; |
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 | |
# License: Public Domain. | |
# Author: Joseph Wecker, 2012 | |
# | |
# Now a repo with faster code- please refer to https://github.com/josephwecker/bashrc_dispatch - thanks gioele | |
# | |
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile? | |
# Are you tired of trying to remember how darwin/mac-osx treat them differently from linux? | |
# Are you tired of not having your ~/.bash* stuff work the way you expect? | |
# |
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 express = require('express'); | |
var app = express(), | |
everyauth = require('everyauth'); | |
everyauth.tumblr | |
.consumerKey('') | |
.consumerSecret('') | |
.findOrCreateUser( function (sess, accessToken, accessSecret, user) { | |
console.log(arguments); | |
}) |
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
/*jshint node:true*/ | |
var fs = require('fs'), | |
http = require('http'), | |
path = require('path'), | |
port = 1338, | |
dir = '.'; | |
http.createServer(function (request, response) { | |
var filePath = path.join(dir, path.basename(request.url)); | |
if (path.extname(request.url) !== '.mp4' || !fs.existsSync(filePath)) return throw404(); |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |