Skip to content

Instantly share code, notes, and snippets.

View klebervirgilio's full-sized avatar
🎯
Focusing

Kleber Correia klebervirgilio

🎯
Focusing
View GitHub Profile
@klebervirgilio
klebervirgilio / helper.rb
Created February 4, 2013 05:36
RUBY: Shows the Class or Instance methods, without too much crap.
module ClearMethods
extend self
def __clear_methods
methods - Object.methods
end
end
class Object
include ClearMethods
end
# Centos 5.8 libyaml anoning warn message.
1 - rvm pkg install libyaml
2 - rvm reinstall all --force --with-opt-dir=~/.rvm/usr
# Based on robbyrussell's theme, with host and rvm indicators. Example:
# @host ➜ currentdir rvm:(rubyversion@gemset) git:(branchname)
# Get the current ruby version in use with RVM:
if [ -e ~/.rvm/bin/rvm-prompt ]; then
RUBY_PROMPT_="%{$fg_bold[blue]%}[%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt)%{$fg_bold[blue]%}]%{$reset_color%} "
fi
# Get the host name (first 4 chars)
HOST_PROMPT_="%{$fg_bold[red]%}➜ %{$fg_bold[cyan]%}%0~ "
@klebervirgilio
klebervirgilio / class.js
Created January 10, 2013 07:39
JS Class
var Class = function(parent){
var klass = function(){
this.init.apply(this, arguments);
}
if(parent){
var subclass = function(){};
subclass.prototype = parent.prototype;
klass.prototype = new subclass;
sudo ifconfig en1 ether `openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
module A
class Payment
def foo
p "Payment#foo"
end
end
end
module A
class CC < Payment
@klebervirgilio
klebervirgilio / gist:3766799
Created September 22, 2012 17:07
458 Bad Words Blacklist for Facebook Pages
---
- ahole
- anus
- ash0le
- ash0les
- asholes
- ass
- Ass Monkey
- Assface
- assh0le
@klebervirgilio
klebervirgilio / gist:3515268
Created August 29, 2012 16:30
Reverse words
import sys
test_cases = open(sys.argv[1], 'r')
for test in test_cases:
result = test.split(' ')
result.reverse()
index, buf = 0, ''
Você pode, por favor, me adicionar no Gtalk ou no Msn??
Meu e-mail é klebervirgilio@gmail.com.
Kleber,
Obrigado!
@klebervirgilio
klebervirgilio / HTC DHD Recovery.log
Created July 14, 2012 18:23
HTC DHD Recovery.log
Starting recovery on Sun Jan 6 00:00:04 1980
can't open /dev/tty0: No such file or directory
framebuffer: fd 3 (480 x 800)
ClockworkMod Recovery v5.0.2.0
recovery filesystem table
=========================
0 /tmp ramdisk (null) (null)
1 /recovery emmc /dev/block/mmcblk0p21 (null)
2 /boot emmc /dev/block/mmcblk0p22 (null)
3 /cache ext3 /dev/block/mmcblk0p27 (null)