Skip to content

Instantly share code, notes, and snippets.

View humus's full-sized avatar

Robertob humus

  • Mexico City
View GitHub Profile
@humus
humus / java.snippets
Created August 16, 2018 12:35
Ultisnips snippets
global !p
def package_calc(path):
no_src = re.sub('^.*?src/', '', path)
no_src = re.sub('/', '.', no_src)
no_src = re.sub('^(main|test)\.', '', no_src)
no_src = re.sub('^java\.', '', no_src)
return re.sub('\.java$', '', no_src)
def expand(text, jump_pos=1):
if snip.tabstop != jump_pos:
return
@humus
humus / .tmux.conf
Created September 2, 2017 23:23
Configuración inicial de tmux
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
set-window-option -g automatic-rename on
@humus
humus / prepare_tmux.md
Last active September 2, 2017 21:35
Vim + Tmux env

Prerequisitos

- tmux > 1.6
- wemux master/3.2
- Linux shell

Entorno de avanzado de pair programming usando tmux (y wemux)

Preparar First Run de wemux

$ bindir=/home/vagrant/bin
$ mkdir -p $bindir
@humus
humus / interact_w_java.vim
Created September 15, 2016 18:37
Script for working with java functions
fun! Fqcn() "{{{
let s:lnum = search('\v^package[^;]+;\s*$', 'n')
let s:strline = getline(s:lnum)
let s:packagename=matchstr(s:strline, '\v^package\s+\zs[^;]+\ze;')
return s:packagename . '.' . expand('%:t:r')
endfunction "}}}
fun! Compile() "{{{
execute 'silent! !tmux send-keys "cpjar_javac ' . expand('%:t:r') . '" c-m'
redraw!
@humus
humus / vim
Last active July 23, 2016 19:54
nnoremap ygl :<C-u><C-r>=getline('.')<cr><cr>
nnoremap <silent> <C-p> :call CtrlPWhatTodoWhenCtrlpIsCalled()<cr>
nnoremap <silent> <C-n> :CtrlPMRU<cr>
fun! CtrlPWhatTodoWhenCtrlpIsCalled() "{{{
let actual_dir = getcwd()
let dir = projectroot#get()
if dir != ''
CtrlPMixed
elseif expand('%:t') == ''
<form>
<fieldset class="fieldset">
<legend>form-example</legend>
<div class="row">
<div class="small-3 columns">
</div>
</div>
<div class="row">
<div class="small-12 columns middle medium-offset-3">
<input id="checkbox" type="checkbox"/>
@humus
humus / new prompt
Last active November 9, 2015 04:45
my bash prompt
PREV_PS1=$PS1
directories="\$(pwd | sed 's#\(/[^/.]\)[^/]\+#\1#g')"
cyan="\e[38;5;116m"
reset="\e[0m"
color_dirs="\e[38;5;160m"
yellow="\033[38;5;130m"
bold="\033[1m"
PS1="\n\[${orange}\]\[${bold}\]$directories\[${reset}\] \[${cyan}\]\`last_two_dirs\`\[${reset}\]\n\[${yellow}\]\`__git_ps1|sed 's/^[[:space:]]*//'\`\[${reset}\]\[${bold}\] \$ \[${reset}\]"
alias ls='ls --color=auto'
alias grep='grep --colour=auto'
@humus
humus / mavenfxs
Created October 30, 2015 13:21
Maven bash function to ease the daily work
mnew() {
params=()
while [ "$#" -gt 2 ]; do
params+=("$1")
shift
done
artifact=$1
group=$2
mvn archetype:generate -B ${params[@]} -Dmaven.archetypeArtifactId=maven-archetype-quickstart -DartifactId=$artifact -DgroupId=$group
echo "command was\\n mvn archetype:generate -B ${params[@]} -Dmaven.archetypeArtifactId=maven-archetype-quickstart -DartifactId=$artifact -DgroupId=$group"
@humus
humus / .gitconfig
Created September 15, 2015 03:43
Git useful aliases
[alias]
l = "!. ~/.pretty_log"
s = status -uno --short
qamend = commit --amend --no-edit
#!/bin/bash
RESET="\033[0m"
TERMINAL_DEFAULT="\033[39m"
BLACK="\033[30m"
BLACK_DIM="\033[2;30m"
RED="\033[31m"
GREEN="\033[32m"
YELLOW="\033[33m"
BLUE="\033[34m"
MAGENTA="\033[35m"