Skip to content

Instantly share code, notes, and snippets.

View eduardodeoh's full-sized avatar
🏠
Working from home

Eduardo de Oliveira Hernandes eduardodeoh

🏠
Working from home
  • São José do Rio Preto / SP / Brasil
View GitHub Profile
@eduardodeoh
eduardodeoh / ip-up
Last active August 29, 2015 13:59
Add custom route to mac os x after vpn connection
#!/usr/bin/env bash
MY_SERVER="192.168.0.150"
#Solution 1
#VPN_GW=$(ifconfig | grep -A2 ppp | grep inet | awk '{print $4}')
##Add route to host only
#sudo route add -host $MY_SERVER $VPN_GW
#!/usr/bin/env ruby
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
:database => ':memory:'
)
ActiveRecord::Schema.define do
# include from an initializer
module HstoreAccessor
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def hstore_accessor(hstore_attribute, *keys)
Array(keys).flatten.each do |key|
@eduardodeoh
eduardodeoh / 0_reuse_code.js
Created October 1, 2013 01:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@eduardodeoh
eduardodeoh / gist:6361118
Last active December 21, 2015 20:29
Sublime Text 2 - Plugins
http://railsbr.org/t/configuracao-do-sublime-text-2-para-rails/185/2
http://net.tutsplus.com/articles/news/perfect-workflow-in-sublime-text-free-course/
http://technovangelist.com/blog/2013/4/3/i-sublime-a-look-at-my-favorite-sublime-text-plugins
#Base
https://github.com/SublimeLinter/SublimeLinter
https://github.com/SublimeCodeIntel/SublimeCodeIntel
https://github.com/jisaacks/GitGutter
https://github.com/SublimeText/TrailingSpaces
#!/bin/sh
# Locale
echo "Changing locale"
sudo apt-get -y install language-pack-pt
clear
# System update
echo "Updating repositories"
sudo apt-get -y update

Setup

git clone <repo>

clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS

Add colors to your ~/.gitconfig file:

Contrato Arrasador 3

Revisão: 02/05/2013

Entre nós [nome nossa empresa] e você [nome cliente]

Sumário:

Nós sempre faremos o melhor para cumprir suas necessidades e atender suas expectativas, mas é importante registrar tudo por escrito para que todos saibam quem deve fazer o quê e quando, e o que acontece quando algo der errado. Neste contrato você não encontrará nenhum termo jurídico complicado ou longas passagens de textos incompreensíveis. Não temos interesse em fazê-lo assinar algo que poderá se arrepender depois. O que queremos é o melhor para ambas as partes, agora e no futuro!

@eduardodeoh
eduardodeoh / gitlab
Created November 2, 2012 21:08
Gitlab configuration for Nginx + Unicorn
server {
listen 80;
server_name gitlab.eduardodeoh.com.br;
root /home/gitlab/gitlab/public;
# individual nginx logs for this gitlab vhost
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;
location / {
@eduardodeoh
eduardodeoh / graphite
Created November 2, 2012 21:07
Graphite configuration for Nginx + Gunicorn
server {
listen 80;
server_name graphite.eduardodeoh.com.br;
## path for static files
root /opt/graphite/webapp/content;
location /media/ {
# this changes depending on your python version
root /usr/local/lib/python2.7/dist-packages/django/contrib/admin;