Skip to content

Instantly share code, notes, and snippets.

View m3nd3s's full-sized avatar

Almir Mendes m3nd3s

View GitHub Profile
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
@m3nd3s
m3nd3s / unicorn.conf
Created August 12, 2013 12:32
Upstart Script for Unicorn
description "Unicorn configuration"
start on filesystem
stop on shutdown
respawn
@m3nd3s
m3nd3s / irc.mkd
Last active December 17, 2015 01:09
Alguns comandos IRC

Register

Make sure you're using the nickname you would like to register.

/msg nickserv register YOURPASSWORD YOUREMAIL
# (Example: /msg nickserv register chattingiscool julie@montreal.com)

Connecting:

/msg NickServ IDENTIFY password

@m3nd3s
m3nd3s / hackin.rb
Created November 27, 2012 20:46
Hackin example
# Parâmetros armazenados em um array
a = [1, 2]
# Método a ser chamado
class Hackin
def self.teste(p1, p2)
puts "Param1: #{p1}"
puts "Param2: #{p2}"
end
end
@m3nd3s
m3nd3s / NERDTree.mkd
Last active December 19, 2025 17:05
My Vim Cheat Sheet

NERDTree

o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|

O.......Recursively open the selected directory..................|NERDTree-O|

@m3nd3s
m3nd3s / refinerycms_nginx_proxy_cache
Created September 25, 2012 18:57 — forked from Matho/refinerycms_nginx_proxy_cache
Refinery CMS - Nginx proxy_cache instead of Rack:Cache
Refinery CMS:
Caching images generated by Dragonfly with Nginx cache_proxy instead of Rack:Cache
Before:
Static image served by Nginx: 4409.40 req/sec (mean)
Dragonfly generated images from Rack:Cache: 286.66 req/sec (mean)
After:
Dragonfly generated images from Nginx proxy_cache: 4099 req/sec (mean)
@m3nd3s
m3nd3s / nginx
Created August 29, 2012 02:06
Script de inicialização do Nginx (padrão debian/ubuntu)
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@m3nd3s
m3nd3s / almirmendes
Created August 26, 2012 19:24
Configuração exemplo para o domínio almirmendes
server {
listen 80;
server_name almirmendes.com www.almirmendes.com;
# Este é o path onde está hospedada sua aplicação Rails, ele pode ficar onde você quiser, entretanto
# é comum coloca-los em uma pasta na home de algum usuário ou mesmo em /var/www/. Independente disto
# o que é necessário aqui é que você adicione o path da pasta public de sua aplicação Rails.
# Importantíssimo, se você utiliza o Capistrano para fazer deploy de sua aplicação, lembre-se de adicionar
# o current antes do public
root /home/m3nd3s/almirmendes.com/public;
@m3nd3s
m3nd3s / nginx.conf
Created August 12, 2012 19:37
Arquivo de configuração do Nginx
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 512;
multi_accept on;
}
http {