Skip to content

Instantly share code, notes, and snippets.

View apux's full-sized avatar

Azarel Doroteo Pacheco apux

View GitHub Profile
@apux
apux / 1_vim_short.md
Last active October 24, 2018 11:50
Plugins for vim
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
@apux
apux / switch-keyboard-layout.sh
Last active December 24, 2015 23:19
change kde keyboard layout
#!/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
@apux
apux / environment.rb
Created October 19, 2013 22:31
field with errors
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">&nbsp;#{[*instance.error_message].join(', ')}</small></div>).html_safe
end
end
@apux
apux / upstream.sh
Created January 30, 2019 16:34
Fetch git from upstream
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