Skip to content

Instantly share code, notes, and snippets.

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

Jairinho tangzero

🏠
Working from home
View GitHub Profile
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<script type="text/javascript" src="http://assets.vitrine.abril.com.br/js?c=abrilcomtry_blogs"></script>
</head>
<body>
<style>
#vitbox {
float: left;
@tangzero
tangzero / resource_helper.rb
Created June 2, 2010 15:39
Resources Spec Helper
def should_behave_like_resource(opts = {})
before :each do
@opts = opts
end
def class_for(str)
str.capitalize.constantize
end
def clazz
@tangzero
tangzero / .bashrc
Created May 11, 2010 18:13
Show some usefull info
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
export PS1='\[\033[1;38m\]\u\[\033[1;32m\] `~/bin/rvm-prompt i v g`\[\033[1;31m\] \W\[\033[1;33m\]`\
git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/[\\\\\1$(parse_git_dirty)]\/` \[\033[37m\]$\[\033[00m\] '
#!/usr/bin/env coffee
sys: require 'sys'
http: require 'http'
server: http.createServer (req, res) ->
res.writeHeader 200, {'Content-Type': 'text/plain'}
res.write 'Hello, World!'
res.end()
@tangzero
tangzero / act.py
Created October 11, 2009 01:47
PIL compatibles's .act color palette.
from struct import unpack
class Palette:
color_length = 3
def __init__(self, fp):
self.palette = []
for i in range(256):
color = fp.read(self.color_length)