Skip to content

Instantly share code, notes, and snippets.

View undees's full-sized avatar
🌈

Erin Paget, née Dees undees

🌈
View GitHub Profile
; SICP change-counting exercise in section 1.2.2
(def coins [1 5 10 25 50])
(defn change-coins [a n]
(cond (zero? a) 1
(neg? a) 0
(zero? n) 0
true (let [d (nth coins (dec n))]
(+ (change-coins a (dec n))
# HG changeset patch
# User Ian Dees <[email protected]>
# Date 1241546103 25200
# Node ID 8ebccd5ebc948ea846a858755a96742661e84431
# Parent dce9bf3609fe5eea3085fbd0ee1a12717794dc9a
Tolerate some committer e-mail weirdness in original repo
diff --git a/git_handler.py b/git_handler.py
--- a/git_handler.py
+++ b/git_handler.py
# This version of update_references just updates the local branch names.
# We need to map these sensibly to remote names, but since this method
# is also used by gexport (which doesn't take a remote repo), that
# mapping probably needs to go elsewhere--which brings us to gpush....
#
# gpush takes an as-yet-unused branch name parameter. A decent first
# approach would probably be to create a remote ref for the pushed-to
# repo with the same as the local branch name, bailing if the local
# branch doesn't exist.
#
# When regular gclone fails, use this (thanks, zig)
HGENCODINGMODE=ignore gclone git://github.com/user/repo
#!/usr/bin/env/ruby
# Proof of concept twitter keyword stream
require 'rubygems'
require 'cgi'
require 'grackle'
# Date range of tweets to query
since = '2009-06-17'
diff --git a/ApplicationConstants.h b/ApplicationConstants.h
--- a/ApplicationConstants.h
+++ b/ApplicationConstants.h
@@ -32,6 +32,7 @@
#define kTagTask @"task"
#define kTagPosition @"position"
#define kTagComplete @"complete"
+#define kTagMembership @"membership"
#define kDefaultsApiToken @"apiToken"
alias jr='jruby --ng'
alias jrb='jruby --ng -S jirb --noreadline'
alias j='jruby --ng -S'
jruby --ng-server 127.0.0.1:55555
#!/bin/sh
curl --url http://localhost:50000 -d \
"<plist version=\"1.0\"> \
<dict> \
<key>command</key> \
<string>simulateTouch</string> \
<key>viewXPath</key> \
<string>//UIToolbarButton[1]</string> \
</dict> \
</plist>"
@undees
undees / salesforce_oauth_first.rb
Created February 10, 2010 09:23
Connect Ruby to Salesforce via OAuth
require 'oauth'
consumer_key = '...' # from SalesForce
consumer_secret = '...' # from SalesForce
oauth_options = {
:site => 'https://login.salesforce.com',
:scheme => :body,
:request_token_path => '/_nc_external/system/security/oauth/RequestTokenHandler',
:authorize_path => '/setup/secur/RemoteAccessAuthorizationPage.apexp',