Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View joshuamiller's full-sized avatar

Joshua Miller joshuamiller

View GitHub Profile
Scenario: Non-Administrator
Given a user exists with login "normal_user" and password "normal_password"
When I log in as "normal_user" with password "normal_password"
When I go to /users
Then I should go to the home page
And I should see an error message
16:29 ~ $ irb
>> class Object
>> def echo
>> puts self
>> end
>> end
=> nil
>> require 'activesupport'
=> true
>> (1..10).each(&:echo)
22:09 ~ $ erl
Erlang (BEAM) emulator version 5.6.4 [source] [smp:2] [async-threads:0] [kernel-poll:false]
Eshell V5.6.4 (abort with ^G)
1> httpd_util:rfc1123_date(calendar:universal_time()).
"Sat, 14 Mar 2009 07:02:55 GMT"
2> httpd_util:rfc1123_date(erlang:localtime()).
"Sat, 14 Mar 2009 03:03:03 GMT"
3> calendar:universal_time().
{{2009,3,14},{3,4,37}}
user=> (defn big[n] (> n 2))
#'user/big
user=> (filter big '(1 2 3))
(3)
<div id="signup">
<h2>Sign up</h2>
<form action="/users" class="new_user" id="new_user" method="post"><div style="margin:0;padding:0;display:inline"><input name="authenticity_token" type="hidden" value="BCbQMh7OAmJVlhuAUUlxNznBX/cXOQgxI9gSwTKNxMQ=" /></div>
<div class="text_field">
<label for="user_email">Email</label>
<input id="user_email" name="user[email]" size="30" type="text" />
</div>
$ cat $(which clojure)
BREAK_CHARS="(){}[],^%$#@\"\";:''|\\"
CLOJURE_JARS="/opt/jars/*"
CP="/opt/clojure/clojure.jar:/opt/clojure/clojure-contrib.jar:$CLOJURE_JARS"
# If no file is being passed, start the REPL
if [ -z "$1" ]; then
rlwrap --remember -c -b $BREAK_CHARS -f $HOME/.clj_completions \
- Flannel sheets (queen)
- Comforter (queen)
- Steak knives
- Under-cabinet mounted iPhone stereo for kitchen
- iHome or similar with alarm for bedroom
- ...
module XAuth
module_function
def retrieve_access_token(username, password, consumer_key, consumer_secret, site = 'https://api.twitter.com')
consumer = OAuth::Consumer.new(
consumer_key,
consumer_secret,
:site => site
)
# The code below is helped by:
; joshuafarm.org [81583]
$TTL 86400
@ IN SOA ns1.linode.com. josh.joshinharrisburg.com. (
2010031666
14400
14400
1209600
86400
)
@ NS ns1.linode.com.
class Tester
attr_accessor :name, :age
def testy (&block)
instance_eval &block
end
end
name = "Josh"
t = Tester.new
t.name = "Larry"