mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
set nocompatible
execute pathogen#infect()
syntax on
filetype plugin indent on
git remote -v | |
git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git | |
git remote -v | |
git fetch upstream | |
git checkout master | |
git rebase upstream/master # git merge upstream/master |
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
if instance.instance_of? ActionView::Helpers::Tags::Label | |
html_tag | |
else | |
%(<div class="form-field error">#{html_tag}<small class="error"> #{[*instance.error_message].join(', ')}</small></div>).html_safe | |
end | |
end |
#!/bin/sh | |
# query xkb map: us,latam -> us is primary; latam,us -> latam is primary | |
dummy=`setxkbmap -query | grep us,latam` | |
# return value 0: us,latam; return value != 0, latam,us | |
if [ $? -ne 0 ]; then | |
# latam is primary, now make us primary in list | |
setxkbmap -model pc101 -layout us,latam -variant nodeadkeys | |
else |
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
set nocompatible
execute pathogen#infect()
syntax on
filetype plugin indent on
require 'spec_helper' | |
<% module_namespacing do -%> | |
describe <%= controller_class_name %>Controller do | |
let(:valid_attributes) { <%= formatted_hash(example_valid_attributes) %> } | |
let(:valid_session) { {} } | |
<% unless options[:singleton] -%> | |
describe "GET index" do |
:set textwidth=80 | |
gqG |
#.pryrc | |
# Load plugins (only those I whitelist) | |
Pry.config.should_load_plugins = false | |
Pry.plugins["doc"].activate! | |
# Launch Pry with access to the entire Rails stack. | |
# If you have Pry in your Gemfile, you can pass: ./script/console --irb=pry instead. | |
# If you don't, you can load it through the lines below :) | |
rails = File.join Dir.getwd, 'config', 'environment.rb' |
sudo pacman -Sy --noconfirm postgresql curl git patch virtualbox nodejs redis | |
sudo pacman -Sy --noconfirm kde-telepathy yakuake | |
sudo pacman -Sy --noconfirm clementine gstreamer0.10-base-plugins gstreamer0.10-good-plugins gstreamer0.10-bad-plugins gstreamer0.10-ugly-plugins gstreamer0.10-ffmpeg | |
sudo pacman -Sy libreoffice | |
ccr -S vim-qt-git | |
sudo pacman -Sy --noconfirm firefox chromium | |
#for rvm, usually all these packages are already installed, but just to be sure | |
sudo pacman -Sy --noconfirm gcc patch curl zlib readline libxml2 libxslt git autoconf automake diffutils make libtool bison libyaml subversion libnotify |
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' | |
local rvm='' | |
if which rvm-prompt &> /dev/null; then | |
rvm='‹$(rvm-prompt i v g)›' | |
else | |
if which rbenv &> /dev/null; then | |
rvm='‹$(rbenv version | sed -e "s/ (set.*$//")›' | |
fi |
find . -name "*.rb" | xargs sed -i 's/foo/bar/g' |