Skip to content

Instantly share code, notes, and snippets.

View jefflunt's full-sized avatar
🐋
Appreciating life

Jeff Lunt jefflunt

🐋
Appreciating life
View GitHub Profile
@jefflunt
jefflunt / gist:c382083c7b8853974437
Last active August 29, 2015 14:01
Handling hashes
> text = 'some text'
=> "some text"
> hash_options = {rant_id:1,date:11/04/2014,top:text,number:12}
=> {:rant_id=>1, :date=>0, :top=>"some text", :number=>12}
NOTE that 'date' gets set to zero, because it's being interpreted as, "11 divided by 04 divided by 2014"
Also this:
> hash_options = rant_id:1,date:11/04/2014,top:text,number:12
@jefflunt
jefflunt / foobar
Last active August 29, 2015 14:06
"""
The FooBar Card Game!
The game is simple:
1. Start a deck of cards
2. Shuffle the deck
3. Every player has a "hand" - a list of cards they are holding
4. Deal all cards from the deck as evenly as possible to all players
5. Score the cards - the player with the highest score WINS!"
@jefflunt
jefflunt / animals
Last active August 29, 2015 14:06
animal-module
def cow():
"""See: http://en.wikipedia.org/wiki/Cattle"""
return {
'sound': 'moo',
'legs': 4,
'covering': 'hair'
}
def horse():
"""See: http://en.wikipedia.org/wiki/Horse"""
@jefflunt
jefflunt / mac-brew-rbenv-install
Last active January 23, 2019 05:59
mac-ruby-2.5.1-install
#!/usr/bin/env bash
set -e
# X-Code
xcode-select --install
# Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# rbenv
@jefflunt
jefflunt / ruby-2.5.1-rbenv
Last active March 24, 2019 13:47
ubuntu ruby 2.5.1 install w/rbenv
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install -y libssl-dev libreadline-dev zlib1g-dev libpq-dev build-essential
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
mkdir -p "$(rbenv root)"/plugins
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
wget https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz
tar -xvf gotty_linux_amd64.tar.gz
rm gotty_linux_amd64.tar.gz