Skip to content

Instantly share code, notes, and snippets.

View mvoto's full-sized avatar

Mauricio Voto mvoto

  • Port Coquitlam, BC
View GitHub Profile
@mvoto
mvoto / gist:5828055
Last active December 18, 2015 18:49 — forked from Belgand/gist:2856947
Sublime shortcuts

Sublime Text 2 – Useful Shortcuts (Ubuntu)

Editing

Ctrl+X cut current line (if no selection)
Ctrl+L select line (repeat select next lines)
Ctrl+D select word (repeat select others occurrences in context for multiple editing)
Ctrl+Shift+M select content into brackets
Ctrl+Backspace delete previous word
Ctrl+Delete delete next word
@mvoto
mvoto / .bash_profile
Created April 24, 2012 21:44
My bash profile config.
#RVM
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
function ruby_version {
ruby -e '/(.*)\/(.*)/.match(`echo $GEM_HOME`);print ($2.nil? ? "" : $2)'
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function parse_git_branch {
 git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
 local        BLUE="\[\033[0;34m\]"
 local         RED="\[\033[0;31m\]"
 local   LIGHT_RED="\[\033[1;31m\]"
 local       GREEN="\[\033[0;32m\]"
 local LIGHT_GREEN="\[\033[1;32m\]"
@mvoto
mvoto / gist:2161722
Created March 22, 2012 18:50 — forked from klebervirgilio/gist:2161451
Array#by
class Array
def by(n)
buff, self_ = [], self.clone
if self.size % n == 0
(self.size/n).times{ buff << self_.shift(n) }
end
buff
end
@mvoto
mvoto / will_paginate.rb
Created March 2, 2012 15:20 — forked from isaacbowen/will_paginate.rb
extends will_paginate to play well with Twitter's Bootstrap
# config/initializers/will_paginate.rb
module WillPaginate
module ActionView
def will_paginate(collection = nil, options = {})
options[:renderer] ||= BootstrapLinkRenderer
super.try :html_safe
end
class BootstrapLinkRenderer < LinkRenderer
@mvoto
mvoto / install_postgis_osx.sh
Created February 22, 2012 13:41 — forked from lucasallan/install_postgis_osx.sh
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@mvoto
mvoto / gist:1596594
Created January 11, 2012 20:27 — forked from lucasallan/gist:1596363
Books
Current:
* Clean Code
* Crafting Rails Applications
Next:
* Domain-driven Design
* Design Patterns in Ruby
@mvoto
mvoto / bash_profile
Created August 30, 2011 19:14
user + path + rvm + git branch
#RVM
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
function ruby_version {
ruby -e '/(.*)\/(.*)/.match(`echo $GEM_HOME`);print ($2.nil? ? "" : $2)'
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}