Skip to content

Instantly share code, notes, and snippets.

View mhfs's full-sized avatar

Marcelo Silveira mhfs

View GitHub Profile
@mhfs
mhfs / README.md
Created March 28, 2014 18:02 — forked from jm3/ d3 drift JS
@mhfs
mhfs / caveatPatchor.js
Created October 3, 2012 19:18 — forked from protocool/caveatPatchor.js
Sample caveatPatchor.js file for use in Propane 1.1.2 and above
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@mhfs
mhfs / private.rb
Created October 5, 2011 17:53 — forked from joefiorini/private.rb
Indent methods under private?
# 1
class Blah
private
def method1
end
def method2
@mhfs
mhfs / ubuntu10.04-ruby192.erb
Created August 15, 2011 21:14 — forked from czottmann/ubuntu10.04-ruby192.erb
Ubuntu 10.04 + Ruby 1.9.2p180 chef bootstrap file
bash -c '
if [ ! -f /usr/local/bin/chef-client ]; then
apt-get update
apt-get -y upgrade
apt-get install -y build-essential wget zlib1g-dev libssl-dev libffi-dev
cd /usr/src
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p180.tar.bz2
tar xjf ruby-1.9.2-p180.tar.bz2
cd ruby-1.9.2-p180
./configure
@mhfs
mhfs / bmp_negator.py
Created June 14, 2010 17:31 — forked from mcrisc/bmp_negator.py
Jau Py
# coding: utf-8
import struct
with open('in.bmp', 'rb') as fd, open('out.bmp', 'wb') as out:
s = fd.read(1)
count = 1
while s:
if count < 37: # header bytes
out.write(s)
@mhfs
mhfs / factories.rb
Created February 2, 2010 01:58 — forked from technicalpickles/factories.rb
Factory Girl Attachment
Factory.define :application do |factory|
factory.attachment(:sample, "public/samples/sample.doc", "application/msword")
end
require File.dirname(__FILE__) + '/../spec_helper'
describe AccountController do
as_any_user :get => :show do
it { should assign_to(:user, :with => @current_user)}
it { should respond_with(:success) }
end
as_any_user :get => :edit do
it { should assign_to(:user, :with => @current_user)}