Skip to content

Instantly share code, notes, and snippets.

View emerleite's full-sized avatar

Emerson Macedo emerleite

View GitHub Profile
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
REGIOES_BRASILEIRAS = {
'Norte' => [
['Acre', 'AC'],
['Amapá','AP'],
['Amazonas', 'AM'],
['Pará', 'PA'],
['Rondônia', 'RO'],
['Roraima', 'RR'],
['Tocantins', 'TO']
],
#! /bin/sh
### BEGIN INIT INFO
# Provides: mongodb
# Author: Emerson Macedo - http://github.com/emerleite - http://codificando.com
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the mongodb data-store
namespace :cache do
desc 'Clear memcache'
task :clear => :environment do
ActionController::Base.cache_store.clear
end
end
class BlackHoleStore
def clear; end
def logger
Rails.logger
end
def fetch( *args )
yield
end
update wp_options set option_value = 'http://codificando.com' where option_name in ('siteurl', 'home', 'blogname');
#!/bin/bash
### BEGIN INIT INFO
# Provides: Start Selenium server
# Author: Emerson Macedo - http://github.com/emerleite - http://codificando.com
# Description: Manage selenium server start and stop
### END INIT INFO
NAME="selenium"
PIDFILE="./selenium.pid"
LOGFILE="./selenium.log"
#!/bin/bash
### BEGIN INFO
# Provides: OSX Apache configuration Clone
# Author: Emerson Macedo - http://github.com/emerleite - http://codificando.com
# Description: Clones apache configuration into new one. Works only on OSX
### END INFO
echo ""
if [ $# -lt 3 ]
then
#!/bin/bash
### BEGIN INFO
# Provides: Flex-SDK and FlexUnit
# Author: Emerson Macedo - http://github.com/emerleite - http://codificando.com
# Description: Install Flex-SDK and FlexUnit. Ajust environment configuration
### END INFO
ensure_installed() {
if [ ! `type -P $1` ]
then
var sys = require('sys');
sys.puts("Top level");
sys.puts(" this === GLOBAL: " + (this === GLOBAL)); // false
sys.puts(" this === exports: " + (this === exports)); // true
var x = "1"; // local variable
sys.puts(" x === GLOBAL.x: " + (x === GLOBAL.x)); // false