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
@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 / .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)]/"
}
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 / 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>)
@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)]/"
# }
#
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 / Terminal.sublime-settings
Created April 25, 2013 16:48
open git bash using `terminal` plugin for sublime
{
// The command to execute for the terminal, leave blank for the OS default
// On OS X the terminal can be set to iTerm.sh to execute iTerm
"terminal": "C:\\Windows\\System32\\cmd.exe",
// A list of default parameters to pass to the terminal, this can be
// overridden by passing the "parameters" key with a list value to the args
// dict when calling the "open_terminal" or "open_terminal_project_folder"
// commands
"parameters": ["/c sh --login -i"]
[git-ftp]
user = username
url = domain.name/[public_html/or whatever]
password = password
add these lines in git repo configuration file, at the end
DROP TABLE IF EXISTS `#__mycomp_posts`;
CREATE TABLE `#__mycomp_posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(250) NOT NULL,
`body` TEXT NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
@branquito
branquito / commander-regex-multirename.markdown
Created September 18, 2013 21:25
commander regex multi rename files example

##file multi rename, regex pattern for commander


Search For : -(\d*)([-.]\w*.\w*)

Replace With : -${1}000${2}