Skip to content

Instantly share code, notes, and snippets.

View Keopaseutb's full-sized avatar

Bo Keopaseut Keopaseutb

View GitHub Profile

####Good Git workflow -git checkout -b feature -git commit -git rebase master feature #updates feature to master -git merge --squash master #allows for atomic commits of feature onto master

####Rebase options

git rebase [-i | --interactive] [options] [--exec ] [--onto ] [] []

@Keopaseutb
Keopaseutb / Hoisting
Created April 12, 2014 03:48
Hoisting
#####Ways scope is defined in JS
1. Language-defined: All scopes are, by default, given the names this and arguments.
2. Formal parameters: Functions can have named formal parameters, which are scoped to the body of that function.
3. Function declarations: These are of the form function foo() {}.
4. Variable declarations: These take the form var foo;.
#####Funny behavior in JS that might cause bugs.
-The built-in name arguments behaves oddly. It seems to be declared
@Keopaseutb
Keopaseutb / pig_latin.rb
Last active August 29, 2015 13:57
Adding ARGV to pig latin.rb file
def pig_latin(word)
if word.downcase =~ /^[aeiou]/
return word
else
index = word.downcase =~ /[aeiou]/
return word[index..-1] + word[0...index] + "ay"
end
end
@Keopaseutb
Keopaseutb / 0.2.1-boggle_class_from_methods.rb
Last active January 3, 2016 02:09 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1 boggle class challenge
class BoggleBoard
def initialize(board)
@board = board
end
def create_word(*coords)
coords.map { |coord| @board[coord.first][coord.last]}.join("")
end