Skip to content

Instantly share code, notes, and snippets.

@gee-forr
gee-forr / links.md
Last active August 29, 2015 14:01
Some links for more reading from my talk on Job Stories
@gee-forr
gee-forr / keybase.md
Last active August 29, 2015 14:12
keybase.md

Keybase proof

I hereby claim:

  • I am gee-forr on github.
  • I am gee_forr (https://keybase.io/gee_forr) on keybase.
  • I have a public key whose fingerprint is 3588 10DF E7EA 2AB0 2504 4721 3F48 190E ADFF 54C5

To claim this, I am signing this object:

@gee-forr
gee-forr / haiku.rb
Created January 21, 2015 11:11
A (kinda*) haiku in ruby... *end keywords don't count ;)
class OneHandClapping
def is; 'The sound of silence'; end
def isnt; !is; end
end
@gee-forr
gee-forr / gist:de3051ec64883fd9ee14
Created March 1, 2015 09:41
Dynamically load a module from string
#!/usr/bin/env ruby
lib_name = 'matrix' # This could be your param
require lib_name # require can accept a string
klass = Kernel.const_get(lib_name.capitalize) # Kernel.const_get turns a string into a constant
klass.zero(1) # And here we're using the newly constantized string to run methods on the Matrix class
@gee-forr
gee-forr / var_or_do_then_var
Created March 5, 2015 06:42
Return a value, or do something, then return a value
#!/usr/bin/env ruby
def var_or_do_then_var
nil || (puts 'I ran'; 'I returned')
end
out = var_or_do_then_var
puts "--#{out}--" # heh... puts out
@gee-forr
gee-forr / challenge_years_months.rb
Created June 27, 2011 10:36
challenge_years_months.rb
#!/usr/bin/env ruby
# encoding: UTF-8
TIME_ZERO = Time.gm(0)
ages_to_test = [979000000, 2158493738, 246144023, 1270166272, 1025600095]
def seconds_to_dt (seconds = 0) # Give it a sane default
age = TIME_ZERO + seconds.to_i
end
@gee-forr
gee-forr / hack.sh
Created March 31, 2012 13:23 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@gee-forr
gee-forr / rtab.zsh
Created May 3, 2012 16:13
Smart truncating of directory names
#!/bin/zsh
### vss:ft=zsh
## reverse tabbing, useful in the prompt
## Copyright (C) 2008 by Daniel Friesel <derf@xxxxxxxxxxxxxxxxxx>
## License: WTFPL <http://sam.zoy.org/wtfpl>
## CAVEAT: directory-names containing two or more consecutive spaces
## are not yet supported
setopt localoptions
@gee-forr
gee-forr / hack.sh
Created December 30, 2012 12:52 — forked from DAddYE/hack.sh
#!/bin/sh
##
# This is a script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Run in interactive mode with:
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)"
#
# or run it without prompt questions:

Capybara

save_and_open_page

Matchers

have_button(locator)