Skip to content

Instantly share code, notes, and snippets.

View rmetzler's full-sized avatar
💭
Recruiters should mention the role and salary range if you spam me.

Richard Metzler rmetzler

💭
Recruiters should mention the role and salary range if you spam me.
View GitHub Profile
@rmetzler
rmetzler / gist:2050664
Created March 16, 2012 15:55 — forked from shripadk/gist:652819
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
@rmetzler
rmetzler / app.rb
Created January 22, 2012 12:51 — forked from jamiehodge/app.rb
Sinatra API for resumable.js
require 'sinatra'
require 'slim'
require 'coffee-script'
require 'sass'
require 'sequel'
DB = Sequel.sqlite
DB.create_table :uploads do
String :id, text: true, primary_key: true
@rmetzler
rmetzler / editor.css
Created January 22, 2012 10:58 — forked from nakhli/editor.css
Backbone.js tutorial - Part 1 - www.javageneration.com
.shape{
height: 100%;
width: 100%;
}
.circle {
border-radius: 50%/50%;
-moz-border-radius: 50%/50%;
-webkit-border-radius: 50%/50%;
}
.hide {
@rmetzler
rmetzler / cocoa-hello-world2.js
Created September 16, 2011 10:23 — forked from indexzero/cocoa-hello-world2.js
Creating a Cocoa GUI window with NodObjC, with a proper Menu, dock icon, and NSApplicationDelegate.
// This example adapted from Matt Gallagher's "Minimalist Cocoa Programming"
// blog article:
// http://cocoawithlove.com/2010/09/minimalist-cocoa-programming.html
var $ = require('NodObjC')
$.import('Cocoa')
var pool = $.NSAutoreleasePool('alloc')('init')
, app = $.NSApplication('sharedApplication')
@rmetzler
rmetzler / .gitignore
Created September 6, 2011 06:22 — forked from pcardune/.gitignore
Facebook command-line client helper
.fb_access_token
.fbconsole.py
@rmetzler
rmetzler / tabledisplaytest.html
Created August 20, 2011 23:03 — forked from adactio/tabledisplaytest.html
Content-first table-display test
<!DOCTYPE html>
<html>
<head>
<title>Table Display test</title>
<style>
@media screen and (min-width: 30em) {
body {
display: table;
caption-side: top;
}
@rmetzler
rmetzler / heroku_env_logger.rb
Created August 2, 2011 09:24 — forked from tjsingleton/heroku_env_logger.rb
Middleware that logs heroku requests into redis.
require "csv"
class HerokuEnvLogger
PREFIX = "HerokuRequest"
TIME_STEP = 1.minute * 1000 # ms
EXPIRE_IN = 6.hours
KEYS = %w[HTTP_X_REQUEST_START
HTTP_X_HEROKU_QUEUE_WAIT_TIME
HTTP_X_HEROKU_QUEUE_DEPTH
HTTP_X_HEROKU_DYNOS_IN_USE]
@rmetzler
rmetzler / build-scribe-2.2.tar.gz.txt
Created July 7, 2011 20:23 — forked from dehora/build-scribe-2.2.tar.gz.rst
build-scribe-2.2.tar.gz facebook scribe
Did this to build scribe-2.2.tar.gz
Get thrift 0.5.0 instead of 0.6.1/0
sudo apt-get install php5-dev
sudo apt-get install php-config # *-php=no didn't quite work out for me
sudo ./configure --with-haskell=no # with-haskell=for-great-good did NOT work
and then configure/make/install thrift and fb303
open the scribe-2.2.tar.gz with nautilus because its top level folder was '.' # <-- http://www.youtube.com/watch?v=IaUfuXBOb3U
@rmetzler
rmetzler / twitter-entities.js
Created June 24, 2011 14:22 — forked from wadey/twitter-entities.js
JavaScript parser for Tweet Entities
/*
* twitter-entities.js
* This function converts a tweet with "entity" metadata
* from plain text to linkified HTML.
*
* See the documentation here: http://dev.twitter.com/pages/tweet_entities
* Basically, add ?include_entities=true to your timeline call
*
* Copyright 2010, Wade Simmons
* Licensed under the MIT license
@rmetzler
rmetzler / twitter_timeline.coffee
Created June 1, 2011 08:22 — forked from kneath/twitter_timeline.coffee
Example file for my History API experiment
# JSONP callback for tweets fetched later than current (max_id)
window.twitterTimelineLaterCallback = (data) ->
window.app.twitterTimeline.receivedData(data, false)
# JSONP callback for tweets fetched earlier than current (since_id)
window.twitterTimelineEarlierCallback = (data) ->
window.app.twitterTimeline.receivedData(data, true)
class window.TwitterTimeline
# Distance from the bottom that we ask for more tweets, distance from the