Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Kleber Correia klebervirgilio

🎯
Focusing
View GitHub Profile
View worm.rb
#!/usr/bin/env ruby
require 'gosu' # gem install gosu --no-document
include Gosu
$dimension, $splits = 200, 20
$size = $dimension.to_f / $splits.to_f
class Worm
attr_writer :dir
def initialize() reset end
View my-day.sh
autoload -U colors && colors
HOUR=`date +"%k"`
function _is_current_ () {
if [[ $1 =~ ([0-9]{1,2})h([[:space:]]-[[:space:]])?([0-9]{1,2})?h? ]]; then
start=$match[1];
end=$match[3];
if [ -z $end ]; then
if [[ $HOUR -eq $start ]]; then
View pac.rb
# [altura, largura, comprimento, peso]
products = [
[28.0, 44.0, 33.0, 4],
[29.0, 44.0, 33.0, 17],
[50.0, 100.0, 50.0, 10],
[106, 40 , 20, 4],
[70, 70, 70, 20],
[66.65, 66.65, 66.65, 6.6],
[10, 1, 1, 7.5]
]
View gist:597539
data = [
215211,
218166,
221817,
224000,
226665,
228260,
230059,
235005,
239554,
@klebervirgilio
klebervirgilio / gist:653421
Created Oct 29, 2010
the error occurs whenever I try to use the class method 'Image.read'
View gist:653421
def img(opt={})
opt[:background_path] ||= "#{Rails.root.to_s}/public/images/citywaypass/card_background.png"
opt[:background_density] ||= "300x300"
opt[:font] ||= 'arial'
opt[:font_weight] ||= 900
opt[:pointsize] ||= 24
opt[:width] ||= 2603
opt[:heigth] ||= 1620
opt[:text] ||= "Something...."
View Feromes' .bach_profile
function parse_git_branch {
 git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
 local        BLUE="\[\033[0;34m\]"
 local         RED="\[\033[0;31m\]"
 local   LIGHT_RED="\[\033[1;31m\]"
 local       GREEN="\[\033[0;32m\]"
 local LIGHT_GREEN="\[\033[1;32m\]"
View .bash_profile
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
@klebervirgilio
klebervirgilio / rename_qrcodes
Created Dec 1, 2010
Qro mudar o nome dos arquivos...
View rename_qrcodes
attr = {
"1"=>"Passeio de jeep na Floresta da Tijuca",
"4"=>"Tirolesa na Lagoa Rodrigo de Freitas",
"5"=>"City Tour pela Cidade Maravilhosa",
"8"=>"Museu Casa do Pontal",
"9"=>"Forte de Copacabana",
"13"=>"Mosteiro de São Bento",
"16"=>"Museu de Arte Moderna",
"19"=>"Museu do Índio",
"24"=>"Planetário do Rio",
@klebervirgilio
klebervirgilio / twitter_code
Created Mar 22, 2011
Esse é o nosso código do twitter.
View twitter_code
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 4,
interval: 2000,
width: 250,
height: 300,
theme: {