Skip to content

Instantly share code, notes, and snippets.

View vitormil's full-sized avatar

Vitor Oliveira vitormil

View GitHub Profile
@vitormil
vitormil / router.js
Created April 13, 2012 03:07 — forked from codeschool-courses/router.js
Challenge 7-4
var AppRouter = Backbone.Router.extend({
routes: {
"appointments/:id": "show"
},
show: function(id){
console.log("heyo we're in show with id %d", id);
}
});
@vitormil
vitormil / gist:3426910
Last active October 9, 2015 02:48 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@vitormil
vitormil / gist:4364716
Last active December 10, 2015 02:08
SublimeText 2 - Command-Line Setup on OS X

To open files and folders from your command-line you need to add Sublime Text 2 to your path.

sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/bin/subl

And then...

subl ~/mysitedir
@vitormil
vitormil / gist:4364864
Last active May 27, 2022 18:20
partially disable the zsh's autocorrect feature

the problem:

subl somefile
zsh: correct 'subl' to 'ul' [nyae]? n

node -v
zsh: correct 'node' to 'od' [nyae]? n
v0.8.16
@vitormil
vitormil / .gemrc
Last active December 21, 2015 07:28
vagrant vm config
cat << EOF > ~/.gemrc
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
EOF
description "NGINX http daemon"
start on runlevel [2345]
stop on runlevel [016]
env DAEMON=/usr/sbin/nginx
env PID=/var/run/nginx.pid
pre-start script
mkdir -p /var/log/nginx
@vitormil
vitormil / nginx.conf
Last active December 30, 2015 15:59
/etc/nginx/nginx.conf
user www-data www-data;
worker_processes 1; # 1 per core
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
http {
@vitormil
vitormil / myappname.conf
Last active December 30, 2015 15:59
/etc/nginx/cond.d/myappname.conf
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 {
@vitormil
vitormil / myapp-web.conf
Last active December 30, 2015 17:19
/etc/init/<file>.conf
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'
@vitormil
vitormil / metadata.json
Created May 26, 2014 03:17
Parse error - fb:admins property
{ "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",