Skip to content

Instantly share code, notes, and snippets.

View emerleite's full-sized avatar

Emerson Macedo emerleite

View GitHub Profile
@emerleite
emerleite / method_missing.js
Last active August 26, 2015 13:52 — forked from hagino3000/method_missing.js
__noSuchMethod__ for Chrome
/**
* Enable route to __noSuchMethod__ when unknown method calling.
*
* @param {Object} obj Target object.
* @return {Object}
*/
function enableMethodMissing(obj) {
var functionHandler = createBaseHandler({});
functionHandler.get = function(receiver, name) {

Keybase proof

I hereby claim:

  • I am emerleite on github.
  • I am emerleite (https://keybase.io/emerleite) on keybase.
  • I have a public key whose fingerprint is 6071 5C71 0115 E35C FBB9 550E 4AFD 7501 E691 0E3E

To claim this, I am signing this object:

@emerleite
emerleite / 0_reuse_code.js
Created July 15, 2014 14:42
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
#!/bin/sh
echo $TSURU_TOKEN
echo $TSURU_TARGET
curl -H "Authorization: bearer $TSURU_TOKEN" $TSURU_TARGET/apps
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