Skip to content

Instantly share code, notes, and snippets.

$(function() {
$("a#portfolio_link_1").click(function() {
$("div#portfolio_float_1").fadeIn();
return false;
})
$("a#portfolio_link_2").click(function() {
$("div#portfolio_float_2").fadeIn();
return false;
})
$("a#portfolio_link_3").click(function() {
def setup_sightings_for_rollup
timespans = [ # [start_time, end_time, quantity, values]
[1.minute.ago, Time.now, 250, [1]],
[1.hour.ago, 1.minute.ago, 5000, [1]],
[1.day.ago, 1.hour.ago, 1500, [1, 2]],
[1.week.ago, 1.day.ago, 1000, [1, 2]],
[3.weeks.ago, 1.week.ago, 500, [1, 2]]
]
cities = { # city => divisor (for quantity)
'Atlanta' => 1,
package com.twitter.node_registry
import scala.collection._
import com.twitter.json.Json
import com.twitter.zookeeper.ZooKeeperClient
import net.lag.logging.Logger
import org.apache.zookeeper.Watcher.Event.KeeperState
import org.apache.zookeeper.{CreateMode, KeeperException, WatchedEvent}
trait Serializer {
package com.twitter.scrooge
import org.apache.thrift.protocol._
/**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
def apply(iprot: TProtocol) = {
var field: TField = null
var message: String = null
var another: Int = 0
while(true) {
field = iprot.readFieldBegin
if(field.`type` == TType.STOP) {
break
}
field.id match {
@imownbey
imownbey / gist:1408068
Created November 30, 2011 04:50
Fuck yeah
ruby -e "require 'rubygems'; require 'open-uri'; require 'rss'; require 'cgi'; puts CGI.unescapeHTML(RSS::Parser.parse(open('http://www.rapquote.com/rss')).items.last.description).gsub('<br/>', \"\\n\").gsub(/<(\\/?)\\w+>/i, '').gsub('“', '\"').gsub('”', '\"').gsub('’', '\'').gsub(' ', ' ')" | cowsay -g | lolcat
_________________________________________
/ "Used to have a crush on Dawn from En \
| Vogue. |
| |
| It's not like honey dip would wanna get |
| with me, |
| |
| But just in case I own more condoms |
| than TLC." |
var a = null;
var promise = somethingLongTahtReturnsAPromise();
function chainToAndSet(promise) {
promise.then(function(values) { a = values })
return promise;
}
function sort() {
new Promise(function(values) { _.sort(values) }
puts "whatsup"
buttonObject = this
buttonObjectClass = $(this).attr("class")
@implementation UIViewController (Helpers)
- (UIViewController *)unwrapIfNav
{
if (![self isKindOfClass:[UINavigationController class]]) {
return self;
}
for (UIViewController *ctrl in self.childViewControllers) {
if (![ctrl isKindOfClass:[UINavigationController class]]) {