git fetch origin && git checkout -b name-of-new-feature-branch origin/release
or
git fetch origin && git checkout -b release origin/release
Check out someone elses branch:
git fetch origin && git checkout name-of-branch
git fetch origin && git checkout -b name-of-new-feature-branch origin/release
or
git fetch origin && git checkout -b release origin/release
Check out someone elses branch:
git fetch origin && git checkout name-of-branch
#Example pulled from my dotfiles | |
# git | |
alias g="git" | |
alias gs="git status" | |
alias gl="git l" | |
alias gcm="git commit -m" | |
alias ga="git add" | |
alias gd="git diff" | |
alias ga.="git add -A" | |
alias gco="git checkout" |
//Using let | |
//the let keyword scopes to the nearest block, not function | |
// it prevents variable declarations from being moved to the top of the scope. This is called hoisting. | |
// loadingMessage and flashMessage are trapped in their braces, and can't be accessed outside of them. | |
<script src="./load-profiles.js"> | |
<script> | |
loadProfiles(["Prince", "MJ", "James Brown"]); | |
</script> |
get to next tab: gt or GT |
def test | |
test_numbers = [] | |
(5).downto(1).each do |number| | |
(number ..5).each do |range_of_numbers| | |
product = number * range_of_numbers | |
test_numbers << product | |
end | |
end | |
test_numbers |
def palindrome | |
palindromes = [] | |
(999).downto(100).each do |number| | |
(number ..999).each do |range_of_numbers| | |
product = number * range_of_numbers | |
if product.to_s == product.to_s.reverse | |
palindromes << product | |
end | |
end |
#First Pass: | |
module AR | |
class Guest < ActiveRecord::Base | |
has_and_belongs_to_many :drinks | |
end | |
end | |
module AR | |
class Drink < ActiveRecord::Base |
module AR | |
class Guest < ActiveRecord::Base | |
has_many :orders, class_name: "Orders" | |
has_many :drinks, through: :orders, class_name: "Orders" | |
def drinks | |
drinks_array = [] | |
AR::Orders.all.each do |relationship| | |
if relationship.guest_id == self.id | |
drinks_array << relationship.drink | |
end |