This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CLI: | |
# code --list-extensions > ~/tmp/vscode-extensions.txt | |
# code --install-extension <name> | |
adpyke.codesnap | |
angryobject.react-pure-to-class-vscode | |
artdiniz.quitcontrol-vscode | |
aslamanver.vsc-export | |
bierner.markdown-preview-github-styles | |
BriteSnow.vscode-toggle-quotes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export ZSH=/home/voliveira/.oh-my-zsh | |
ZSH_THEME="powerlevel9k/powerlevel9k" | |
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir rbenv vcs) | |
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status node_version time) | |
POWERLEVEL9K_PROMPT_ON_NEWLINE=true | |
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=" \n " | |
POWERLEVEL9K_MULTILINE_SECOND_PROMPT_PREFIX=" $ " | |
POWERLEVEL9K_NODE_VERSION_FOREGROUND='008' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:swap_lines(n1, n2) | |
let line1 = getline(a:n1) | |
let line2 = getline(a:n2) | |
call setline(a:n1, line2) | |
call setline(a:n2, line1) | |
endfunction | |
function! s:swap_up() | |
let n = line('.') | |
if n == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:swap_lines(n1, n2) | |
let line1 = getline(a:n1) | |
let line2 = getline(a:n2) | |
call setline(a:n1, line2) | |
call setline(a:n2, line1) | |
endfunction | |
function! s:swap_up() | |
let n = line('.') | |
if n == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env | |
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced | |
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start | |
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running. | |
# Add the following to your shell init to set up gpg-agent automatically for every shell | |
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then | |
source ~/.gnupg/.gpg-agent-info | |
export GPG_AGENT_INFO | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pad (text, padded_length, pad_string, pad_direction) { | |
pad_string = pad_string || " "; | |
text = text + ""; | |
if (text.length >= padded_length) { | |
return text; | |
} | |
var pad_content = new Array(padded_length - text.length + 1).join(pad_string); | |
if (!pad_direction || pad_direction === "left") { | |
return pad_content + text; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "Content-Encoding":"UTF-8", | |
"Content-Length":77289, | |
"Content-Type":"application/xhtml+xml", | |
"HandheldFriendly":"True", | |
"MobileOptimized":320, | |
"X-UA-Compatible":"IE\u003dEdge", | |
"apple-mobile-web-app-title":"TechCrunch", | |
"application-name":"TechCrunch", | |
"article:publisher":"https://www.facebook.com/techcrunch", | |
"cleartype":"on", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description "Myapp web application" | |
start on starting myapp | |
stop on stopping myapp | |
respawn | |
exec su - myapp -c 'cd /var/www/myapp/current/ && bundle exec unicorn -c ./config/unicorn.rb --env production >> /var/log/myapp/web.log 2>&1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream myappname { | |
server unix:/var/run/myappname/web.sock fail_timeout=0; | |
} | |
server { | |
server_name .oldappname.com; | |
rewrite ^ http://myappname.com$request_uri? permanent; | |
} | |
server { |