Skip to content

Instantly share code, notes, and snippets.

View rafmagana's full-sized avatar

Rafael Magaña rafmagana

  • Colima, Mexico
View GitHub Profile
script_name: Gist.vim
script_id: '2423'
script_type: utility
script_package: gist-vim.zip
script_version: '7.1'
required_vim_version: '7.0'
summary: vimscript for gist
@rafmagana
rafmagana / rafael_magana.pub
Created March 5, 2013 16:40
Personal public key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAy7wnOkILt2ORT71prn9Fz++DJ2zdkuWLs8+SlkCge87Ya1kjZHZUlPXAjU+a/mWJBugwCNmYI3cb+mcJ50tJ7NJVQH+DAOq4+/ZI8ws5wsAjyJuhiNmeCS7wTfvXKc8FonD2UeunHqtwpVZNW6LUgkQVTFckucxSRpU626Ej73L2ZZYgsSo6ZbqdvbTDzcPnRExb6ix0K5rqy0/9mJ+FuCLA+2PaNcYOEyXGnfhRGsQE8oAUKWCCRltXTlKrIsqp+NxCpSFgNq4LcFq5nySlItDZ2HO4XWFRVxG3PFbKzSevO+5Flt+ENltNTzXWEShqhVEKPxZQKiy2LujoHkyUsw== raf@MackieTheKnife.local
@rafmagana
rafmagana / README.md
Last active September 18, 2017 15:58
This is a way to call the Heroku command-line utility adding the name of the Heroku App automatically.

Heroku command-line wrapper with app name

This is a kind of second version of https://gist.github.com/4208338, but in this version you don't need to call projectName_production or projecName_staging only production or staging.

How to make it work

If you have git remotes called production, staging and development already, then then the only thing you have to do is to source heroku_command_line_wrapper_with_app_name.sh in your .bash_profile or .bashrc:

source /path/to/heroku_command_line_wrapper_with_app_name.sh
@rafmagana
rafmagana / git-edit.sh
Last active December 10, 2015 00:19
Script to open modified, cached/staged or untracked files in a git repo with macvim.
#!/usr/bin/env bash
function git_edit_files
{
# Init
local type=$1
# Commands
local ls_files='git ls-files'
local diff='git diff --cached --name-only'
# Messages
@rafmagana
rafmagana / heroku_wrapper.sh
Created December 4, 2012 20:28
heroku commands with app wrapper
## Usage
# $ project_staging logs
# $ project_staging logs -t
# $ project_staging config:get MONGOHQ_URL
# $ project_staging run console
# $ project_production ps
# $ project_production logs -n 3 -p worker.4 -s app -t
function project_staging
@rafmagana
rafmagana / aliaz
Created November 28, 2012 17:33
Aliaz command to create aliases and get notified when an alias with the same name already exists
## Usage:
# $ aliaz (without arguments it behaves just like the "alias" command)
#
# $ aliaz ls='something' (shows "The command or alias 'ls' already exists!")
#
# $ aliaz non_existent_alias='some' (creates the alias)
function aliaz
{
if [ -n "$1" ]
@rafmagana
rafmagana / bash_functions.sh
Created November 8, 2012 18:20
cdb (Change directory back)
## USAGE
#
### Without arguments (default 1 dir back)
#
# $ pwd
# /your/path/to/some/dir/a
# $ cdb
# $ pwd
# /your/path/to/some/dir
; A REPL-based, annotated Seesaw tutorial
; Please visit https://github.com/daveray/seesaw for more info
;
; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers
; Seesaw's basic features and philosophy, but only scratches the surface
; of what's available. It only assumes knowledge of Clojure. No Swing or
; Java experience is needed.
;
; This material was first presented in a talk at @CraftsmanGuild in
; Ann Arbor, MI.
@rafmagana
rafmagana / beginner.rb
Created June 26, 2012 19:01
Cheating on Ruby Warrior
module RubyWarrior::Units
class Warrior < Base
def max_health
1000
end
end
end
class Player
def play_turn(warrior)
@rafmagana
rafmagana / .rvmrc
Created June 4, 2012 22:50
Conditioning .rvmrc code execution to use different ruby version inside Vagrant and in the host
if [[ `pwd` =~ 'vagrant' ]]; then
rvm use jruby@gemset
else
rvm use default
fi