Skip to content

Instantly share code, notes, and snippets.

View josiasds's full-sized avatar

Josias Schneider josiasds

View GitHub Profile
@josiasds
josiasds / gitflow-breakdown.md
Created November 3, 2015 12:32 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

# 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:
# 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
@josiasds
josiasds / .bash_profile
Last active October 14, 2015 14:06 — forked from nicolasiensen/.bash_profile
.bash_profile config file
[[ -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)"
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