Skip to content

Instantly share code, notes, and snippets.

View justinrolston's full-sized avatar

Justin Rolston justinrolston

  • Andros
  • Columbus, OH
View GitHub Profile
@justinrolston
justinrolston / ruby22.sh
Created May 11, 2016 01:06
docker function in bash
ruby22 () {
eval $(docker-machine env default)
docker run -it --rm \
-v "$PWD":/data \
-w /data \
ruby:2.2-alpine ruby $*
}
{"status":"fail"}
@justinrolston
justinrolston / main.go
Created December 10, 2014 13:50
working proxy
package main
import (
"fmt"
"log"
"net/http"
"github.com/elazarl/goproxy"
)

Keybase proof

I hereby claim:

  • I am justinrolston on github.
  • I am justinrolston (https://keybase.io/justinrolston) on keybase.
  • I have a public key whose fingerprint is DE95 5077 3C99 DF79 B00C EFFD 202E 6800 E2F2 6959

To claim this, I am signing this object:

module EventuallyHelper
def eventually(options = {})
timeout = options[:timeout] || 10
interval = options[:interval] || 0.1
time_limit = Time.now + timeout
loop do
begin
yield
rescue => error
end
@justinrolston
justinrolston / output
Created September 19, 2013 01:33
choose-your-own-talk
Justins-MacBook-Air:Code justinrolston$ cd choose-your-own-talk/
Justins-MacBook-Air:choose-your-own-talk justinrolston$ bundle
Using colorize (0.5.8)
Using rack (1.5.2)
Using redcarpet (3.0.0)
Using syntax (1.0.0)
Using tty_markdown (0.0.1) from git://github.com/dapplebeforedawn/tty_markdown.git (at master)
Using bundler (1.3.1)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Justins-MacBook-Air:choose-your-own-talk justinrolston$ bundle exec ./choose.rb
def tweet(message)
if tweet <= "140"
@client.update(message)
else
puts "Cannot send tweet over 140 characators"
end
end
@justinrolston
justinrolston / bob.rb
Created September 5, 2013 02:43
bob exercise
class Bob
def hey statement
return 'Fine. Be that way!' if statement.strip == ''
return 'Woah, chill out!' if statement == statement.upcase
return 'Sure.' if statement[-1,1] == '?'
return 'Whatever.'
end
end
<HEAD>
<TITLE>Basic HTML Sample Page</TITLE>
</HEAD>
<BODY >
<a href='http://www.google.com' target='_blank' id='test'>My blank target</a>
</BODY>
- Alex Burkhart
- @Saterus
- neo.com
BASICS:
- REPL
- Ruby Classic: IRB
- ****gem install pry-plus****