Skip to content

Instantly share code, notes, and snippets.

View gsiener's full-sized avatar
🚴‍♂️
NYC

Graham Siener gsiener

🚴‍♂️
NYC
View GitHub Profile
@listrophy
listrophy / Custom.css
Created January 3, 2013 15:40
Put this in "~/Library/Application Support/Google/Chrome/Default/User StyleSheets/Custom.css" to highlight your blocked stories.
.projects_stories_page .storyLabels a[title="blocked"] {
background-color: red;
color: white !important;
padding: 0 3px;
display: inline-block;
}
@nfo
nfo / README.md
Created September 10, 2012 15:54
A microgem to query the Amazon Web Services (S3/EC2/etc) usage reports.
@myusuf3
myusuf3 / OAuth.md
Created July 24, 2012 15:53
OAuth and API Providers: Come on guys.

The more OAuth providers there are, the more inconsistency there is. Not following the specification puts an increased and unnecessary burden on the developer.

In the past couple of weeks I have coordinated and authenticated with more than my fair share of OAuth providers. That being said, you should be thinking "Hey, isn't OAuth a specification?" Once you do one you should be simply swapping out keys and urls and you should be good to go right? So wrong.

Follow the specification and be consistent.

This article is meant to let the OAuth providers know some of the pain points of dealing with them as providers and steps they could take to make interacting with their API a joy.

API Documentation

@shaunxcode
shaunxcode / underscoreR.coffee
Created May 7, 2012 00:06 — forked from jimtla/underscoreR.coffee
Add CoffeeScript friendly kv args to Underscore.js
#names of functions to create KV versions of and arg lists (in order)
to_kv = throttle: ['func', 'wait'], delay: ['func', 'wait'], defer: ['func'], bind: ['func', 'context']
mixin = {}
for name, arglist of to_kv
do (name, arglist) ->
mixin["#{name}KV"] = (kvargs) ->
args = (kvargs[arg] for arg in arglist when kvargs[arg]?)
if arglist.length isnt args.length then throw new Error "missing args"
_[name](args...)
@jimtla
jimtla / underscoreR.coffee
Created May 6, 2012 21:51
Add CoffeeScript friendly argument order to Underscore.js
# Five lines of code that will make your underscore + CoffeeScript use cleaner.
# Creates an underscore function for each function in to_reverse with R (short for Reversed) appended to the name.
# The R version moves the function argument (first argument in normal underscore) to the end,
# so you can write:
$(window).scroll _.throttleR 500, ->
console.log "This print's at most every 500ms"
# Instead of:
$(window).scroll _.throttle ->
console.log "This prints at most every 500ms too"
@fnichol
fnichol / README.md
Created February 26, 2012 01:23
A Common .ruby-version File For Ruby Projects

A Common .ruby-version File For Ruby Projects

Background

I've been using this technique in most of my Ruby projects lately where Ruby versions are required:

  • Create .rbenv-version containing the target Ruby using a definition name defined in ruby-build (example below). These strings are a proper subset of RVM Ruby string names so far...
  • Create .rvmrc (with rvm --create --rvmrc "1.9.3@myapp") and edit the environment_id= line to fetch the Ruby version from .rbenv-version (example below).

Today I learned about another Ruby manager, rbfu, where the author is using a similar technique with .rbfu-version.

@jorilallo
jorilallo / note_create
Created February 10, 2012 19:11
Samples from Pivotal Tracker's webhook
<?xml version="1.0" encoding="UTF-8"?>
<activity>
<id type="integer">160540935</id>
<version type="integer">276</version>
<event_type>note_create</event_type>
<occurred_at type="datetime">2012/02/10 18:35:54 UTC</occurred_at>
<author>Jori Lallo</author>
<project_id type="integer">76939</project_id>
<description>Jori Lallo added comment: &quot;Woot&quot;</description>
<stories type="array">
@caseypugh
caseypugh / vhx_hipchat.php
Created November 22, 2011 23:17
Send your VHX shares to HipChat
<?
///
// Sample usage:
// php vhx_hipchat.php staff myroom authtoken
//
// Screenshot: http://sht.tl/xeT
//
$vhx_user = $argv[1]; // staff
require "resque"
require "resque_mailer"
require 'resque/failure'
require 'resque/failure/redis'
require 'resque/failure/multiple'
require "resque/failure/airbrake"
require 'resque/plugins/retry'
require "resque-retry"
require "resque-loner"
require "resque_scheduler"
@will
will / authlogic_model.rb
Created October 16, 2011 07:06
authlogic_model
module AuthlogicModel
def self.included(model)
model.class_eval do
extend ClassMethods
include InstanceMethods
#include ProtectedAttributes
property :username
property :email
property :crypted_password