Skip to content

Instantly share code, notes, and snippets.

View branquito's full-sized avatar
🌴
On vacation

Branchito de Munze branquito

🌴
On vacation
View GitHub Profile
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
@branquito
branquito / .bashrc
Created March 20, 2013 19:32
BASH-settings-for-WIN
### PROMPT ####################
# function parse_git_dirty {
# [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
# }
#
# function parse_git_branch {
# git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
# }
#
@branquito
branquito / Vim_copy_matches_to_reg.vim
Last active December 14, 2015 22:49
VIM copy matches into register
function! CopyMatches(reg)
let hits = []
 %s//\=len(add(hits, submatch(0))) ? submatch(0) : ''/ge
let reg = empty(a:reg) ? '+' : a:reg
execute 'let @'.reg.' = join(hits, "\n") . "\n"'
endfunction
command! -register CopyMatches call CopyMatches(<q-reg>)
VIM regex
Strip class attributes from HTML tags, including those spanning over multiple lines
Change `class` word for anything else you want to strip..
:%s/<\s*\(\w*\)\s*class[^>]*>\([^<]\_.\{-}\)<\/.*>/<\1>\2<\/\1>/gc
@branquito
branquito / .bashrc
Created March 8, 2013 18:34 — forked from troolee/.bashrc
### PROMPT ####################
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
@branquito
branquito / suckerfish.css
Created March 5, 2013 19:19
suckerfish-basic-joomla
.moduletable_menu, .moduletable_menu ul {
padding: 0;
margin: 0;
list-style: none;
}
.moduletable_menu a {
display: block;
width: 10em;
}
@branquito
branquito / #J-component-renaming
Created March 1, 2013 18:46
#JOOMLA comp-rename-script
## Substitution facility script for VIM, useful in JOOMLA developing:
_by branquito de munze
# go into folder where you will be processing substitutions on files
cd vim-processing\com_somecomponent\
# load files in which you want changes to occure, filtered by extension
@branquito
branquito / file-folder-rename-bash-recursive.txt
Created March 1, 2013 00:19
batch rename files or folders recursively in bash
command to find recursively files {can be modified for folders too, change -type f}, and renamed them by specfying regex pattern
find . -type f -maxdepth [depth] -name "[filepattern]" | while read FNAME; do mv "$FNAME" "${FNAME//search/replace}"; done
example:
find . -type f -maxdepth 1 -name "domain*.php" | while read FNAME; do mv "$FNAME" "${FNAME//domain/lead}"; done
before: after:
@branquito
branquito / submodules-win-vim.txt
Created February 25, 2013 17:19
submodules for Vim on windows
git://github.com/garbas/vim-snipmate.git
https://github.com/tomtom/tlib_vim.git
https://github.com/MarcWeber/vim-addon-mw-utils.git
https://github.com/honza/snipmate-snippets.git
git://github.com/tpope/vim-surround.git
git://github.com/ervandew/supertab.git
git://github.com/Lokaltog/vim-powerline.git
git://github.com/kien/ctrlp.vim.git
git://github.com/wgibbs/vim-irblack.git
git://github.com/tomtom/tcomment_vim.git
@branquito
branquito / keytweak
Created February 12, 2013 19:28
KeyTweak Installation
http://ge.tt/5IIibHY/v/0?c