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 timeAgo(time){ | |
var units = [ | |
{ name: "second", limit: 60, in_seconds: 1 }, | |
{ name: "minute", limit: 3600, in_seconds: 60 }, | |
{ name: "hour", limit: 86400, in_seconds: 3600 }, | |
{ name: "day", limit: 604800, in_seconds: 86400 }, | |
{ name: "week", limit: 2629743, in_seconds: 604800 }, | |
{ name: "month", limit: 31556926, in_seconds: 2629743 }, | |
{ name: "year", limit: null, in_seconds: 31556926 } | |
]; |
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
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function | |
alias ping='ping -c 5' | |
alias ..='cd ..' | |
export CLICOLOR=1 | |
function mkcd() { | |
[ -n "$1" ] && mkdir -p "$@" && cd "$1"; | |
} |
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 startAnimation() { | |
var i = 0; | |
var frameId = 0; | |
frames = $('.animation').find('li'); | |
setInterval(function(){ | |
if (frames.length) { | |
$(frames[frameId]).css('opacity', '0'); | |
frameId = i++ % frames.length; | |
$(frames[frameId]).css('opacity', '1'); |
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
require 'twitter' | |
require 'redis' | |
Twitter.configure do |config| | |
config.consumer_key = CONSUMER_KEY | |
config.consumer_secret = CONSUMER_SECRET | |
config.oauth_token = TOKEN | |
config.oauth_token_secret = SECRET | |
end |
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
require 'OpenSSL';require 'Base64';c = 'A9owhIxrZX3kHFGKqn0dOoybYZWBQxGygOviG1ane9/aDwezVW/AzDDoD6ZZTdLkjd3RAxbkHD9rHSa+Z7js6QzylYBnMsPjZYVzEE//g4/2anuBI9aWwKjqj45T1UkO4cxKtziUzwPB5rXt5Rx1AnwzUeI0brlqcqNctzLp4aVZbfbW4p0gHUTAej3wk4uD3+ioqMe4hDGUQWiUp9p7IDHancMhhQg60O9990TFev54YUBokJxj09Wo8SsMbw7M/Xy/xJ3gbc9tx9fBGGASJcTkCdHqYYU4kOieogC9AtHM54xsfhKu5s5okyFPHaN9ylboEmB0IlZnwf7GhG6IOuOAC9o7jI31mrRbjTiyYglcNPf5yrVepPpZOlJ+sjNKIf6meDdrmIdv2iyMAvIVfoVEOmnzyFAE6r7sCQ3nyAHHtdDKErSWkhWsPgLg5Gl5b3pEazHVrafB2aeqYKeTzNGejxjVXMId2K2v1I0MqUgTLlJ2gyAWHtUcV63yX6DplqCph4vylwap0JH+dp8kltUimeC/qKYSFZL45lhFlNoMDF4O89ekizZmljCMtVgll1Amzt5/xDAcHMXoEz7iZ3xTArDbt0FbX6HjABPvcCJTAhl8kDV0BqILXfJycJ8rKvlXJ5pqoryYZJoNqTOvaiRiRHokX5xM07ej8japZeYZq2F20ejJL1oB13Q11LuGS2YnjlcDtxbdDcHJikUj28GmI19/lZenj1IiktoO1zPlPyFXO8GZXTM5y8RbVM/WyUBNPh3Peae7PcAfD6SPZLJAbOd6Xe46H4yNv2kuxV3HJVQc37+Sp5ALWxEIdDA+GLNbLvTdLo9T1mUJbO/vHn0iHHIrwccfaY6IyFVQQW/9TSVUka7ulL7QuSu8gsD1/5BYhZJAX4Un6ZOl35UR4onoTGnP1DTrOa7yp9RLAfvrd0iaSXNF3aZkLO8n7X6LmqUr2krCtEb2uVANeUfr3+wU |
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
// I didn't do this. This guy did: http://stackoverflow.com/a/7123542/288660 | |
if(!String.linkify) { | |
String.prototype.linkify = function() { | |
// http://, https://, ftp:// | |
var urlPattern = /\b(?:https?|ftp):\/\/[a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|]/gim; | |
// www. sans http:// or https:// | |
var pseudoUrlPattern = /(^|[^\/])(www\.[\S]+(\b|$))/gim; |
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
Handlebars.registerHelper('numberWithCommas', function(x) { | |
return x.toString().replace(/\B(?=(?:\d{3})+(?!\d))/g, ","); | |
}); |
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 ruby | |
# Heavily based on https://github.com/ip2k/twitter-avatar-update | |
# ==== Gems ==== | |
require 'twitter_oauth' | |
require 'oauth' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'yaml' |
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
#import <Foundation/Foundation.h> | |
@interface SKUserData : NSMutableDictionary | |
+ (id)sharedInstance; | |
@end | |
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
console.log("triggered: "+eventName+" for "+(this.get('name')||this.get('description')||'collection')) |