gitflow | git |
---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Committing changes to a repo via the Github API is not entirely trivial. | |
# The five-step process is outlined here: | |
# http://developer.github.com/v3/git/ | |
# | |
# Matt Swanson wrote a blog post translating the above steps into actual API calls: | |
# http://swanson.github.com/blog/2011/07/23/digging-around-the-github-api-take-2.html | |
# | |
# I was not able to find sample code for actually doing this in Ruby, | |
# either via the HTTP API or any of the gems that wrap the API. | |
# So in the hopes it will help others, here is a simple function to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Campaign < ActiveRecord::Base | |
has_many :timelines, :through => :assignment | |
end | |
class Timeline < ActiveRecord::Base | |
self.abstract_class = true | |
end | |
class Assignment < ActiveRecord::Base | |
belongs_to :campaign |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bash/zsh git prompt support | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org> | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# This script allows you to see repository status in your prompt. | |
# | |
# To enable: | |
# | |
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile | |
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin # Load Postgres.app | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* | |
export NVM_DIR="/Users/josias/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
eval "$(hub alias -s)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def canceled_subscriptions | |
canceled_subscriptions = [] | |
offset = 0 | |
subscriptions = Moip::Subscription.new.load offset | |
while subscriptions.any? | |
subscriptions.each do |subscription| | |
if subscription["status"] == "CANCELED" | |
canceled_subscriptions << subscription["code"] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heroku addons:add pgbackups | |
heroku addons:add heroku-postgresql:hobby-basic | |
# The new database color will be created. Ex.: HEROKU_POSTGRESQL_IVORY | |
heroku maintenance:on | |
heroku ps:scale worker=0 | |
heroku pgbackups:transfer HEROKU_POSTGRESQL_IVORY | |
heroku pg:promote HEROKU_POSTGRESQL_IVORY | |
heroku ps:scale worker=1 | |
heroku maintenance:off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyApp::Application.routes.draw do | |
resources :agents do | |
resources :brands, module: 'agents' | |
end | |
get '/', to: 'agents/brands#show', constraints: lambda { |r| r.subdomain.present? && r.subdomain != 'www' } | |
get '/', to: 'agents#show', constraints: lambda { |r| r.subdomain.present? && r.subdomain != 'www' } | |
root 'home#index' | |
end |