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 / 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)/'
}
@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 / 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 / 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 / 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
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 / .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)/'
}
@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 / gist:6092568
Last active December 20, 2015 07:19
Building Software vs Programming
1/2 - Who are you ???
We all know that developers are smart people. We just think quickly and try to reproduce it at the same time.
But it is important to keep in mind that we need to work on a few skills to be even more smart. Sometimes we forgot a few things when we are in our quick coding travel.
This talk is about skills that makes software artists different from lines of code makers.
3 - Building Software
Developers must be good at designing discussing and thinking about a problem, so they can try to find a better solution for that.
Programmers don't need tests for example, this is just a waste of time, they could just write more code if they are not writing tests.
@mvoto
mvoto / gist:6159939
Last active December 20, 2015 16:09
Notas para Apresentações
1 - Criação - desenvolver raciocínios argumentos
2 - Estilo - Como vai apresentar/mostrar essa ideia - argumentos
3 - Organização - Como montar o que vc vai expor(linha de tempo)
4 - Memória - vc saber o q vai falar sem precisar olhar
5 - Ação - como vc vai apresentar, tom de voz, maneira de se portar, etc