Skip to content

Instantly share code, notes, and snippets.

View rhberro's full-sized avatar

Rafael Henrique Berro rhberro

View GitHub Profile
@rhberro
rhberro / killport
Created September 21, 2018 23:58
A function to kill process for a given port.
killport ()
{
lsof -i tcp:"@$" | awk 'NR!=1 {print $2}' | xargs kill -9
}
@rhberro
rhberro / .bashrc
Last active January 23, 2017 22:07
My personal .bashrc file.
## Settings
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes
## Manually added.
# Apt
@rhberro
rhberro / user.sublime-keymap
Created August 11, 2016 19:43
My latest user sublime keymap.
[
// origami.
{ "keys": [":", "v", "s", "p"], "command": "create_pane", "args": {"direction": "right", "give_focus": true} },
{ "keys": [":", "s", "p"], "command": "create_pane", "args": {"direction": "down", "give_focus": true} },
{ "keys": [":", "b", "d"], "command": "destroy_pane", "args": {"direction": "self"} },
{ "keys": [":", "w", "="], "command": "zoom_pane", "args": {"fraction": 0.9} },
{ "keys": [":", "w", "-"], "command": "unzoom_pane" },
{ "keys": [":", "w", "n"], "command": "travel_to_pane", "args": {"direction": "right"} },
{ "keys": [":", "w", "p"], "command": "travel_to_pane", "args": {"direction": "left"} },
]
@rhberro
rhberro / user.sublime-settings
Last active March 1, 2017 19:48
My latest user sublime config.
{
"always_show_minimap_viewport": false,
"bold_folder_labels": true,
"caret_style": "solid",
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
"draw_minimap_border": false,
"draw_white_space": "all",
"enable_tab_scrolling": false,
"ensure_newline_at_eof_on_save": true,
set nocompatible "Do not try to be vi compatible.
syntax on "Enable syntax highlighting.
"--------------------------------------"
"-GUI----------------------------------"
"--------------------------------------"
set guioptions-=l
set guioptions-=L
// This should remove all the local branches that are already merged into the currently checked out branch.
git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d
@rhberro
rhberro / bootlinter.js
Created February 28, 2016 21:03
Linter code for bootstrap.
javascript:(function(){var s=document.createElement("script");s.onload=function(){bootlint.showLintReportForCurrentDocument([]);};s.src="https://maxcdn.bootstrapcdn.com/bootlint/latest/bootlint.min.js";document.body.appendChild(s)})();