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
; 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)) |
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
# 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. | |
# |
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
# When regular gclone fails, use this (thanks, zig) | |
HGENCODINGMODE=ignore gclone git://github.com/user/repo |
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 | |
# Proof of concept twitter keyword stream | |
require 'rubygems' | |
require 'cgi' | |
require 'grackle' | |
# Date range of tweets to query | |
since = '2009-06-17' |
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
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" |
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
alias jr='jruby --ng' | |
alias jrb='jruby --ng -S jirb --noreadline' | |
alias j='jruby --ng -S' |
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
jruby --ng-server 127.0.0.1:55555 |
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
#!/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>" |
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 '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', |
OlderNewer