Skip to content

Instantly share code, notes, and snippets.

@leandrosilva
leandrosilva / gist:264171
Created December 27, 2009 05:59
Thorfile for my Ebuild
require 'thor'
class Ebuild < Thor
desc 'all', 'clean, compile and generate edoc for all modules'
def all
clean
compile
doc
end
@leandrosilva
leandrosilva / restfulierl.erl
Created March 1, 2010 16:40
Sample code from Restfulierl client-side
%%
%% Restfulierl, a member of Restfulie initiative.
%%
%% @author Leandro Silva <leandrodoze@gmail.com>
%% @copyright 2009 Leandro Silva.
%%
%% See more about Restfulie initiative on http://restfulie.caelum.com.br.
%%
%% @doc start point to use Restfuilerl.
@leandrosilva
leandrosilva / sample_erlang_bdd.erl
Created March 9, 2010 03:49
Sample of very simple BDD with Eunit
-module(sample_erlang_bdd).
-include_lib("eunit/include/eunit.hrl").
%%--- Spec 1 ---------------------------
describe_truth_test_() ->
[fun should_be_true/0,
fun should_be_false/0].
@leandrosilva
leandrosilva / NSArray+Functional.h
Created April 10, 2010 07:31
Functional Objective-C NSArray
//
// NSArray+Functional.h
// DynamicFeatures
//
// Created by Leandro Silva on 4/10/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@leandrosilva
leandrosilva / gist:385618
Created April 30, 2010 19:01
My terminal settings
#
# TERMINAL SETTINGS ###########################################################
#
# Define how Bash prompt looks like
export PS1='\n\[\e[0;32m\]\u@\h \[\e[0;33m\]\w \[\e[0;35m\]$(__git_ps1 "(%s)")\n\[\e[0;32m\]\$ \[\e[0;37m\]'
# Cli Colors
export CLICOLOR=1
@leandrosilva
leandrosilva / mono-uninstaller.sh
Created June 10, 2010 23:43
This script removes Mono from an OS X System
#!/bin/sh -x
#This script removes Mono from an OS X System. It must be run as root.
rm -r /Library/Frameworks/Mono.framework
rm -r /Library/Receipts/MonoFramework-*
for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do
(cd ${dir};
@leandrosilva
leandrosilva / gist:438354
Created June 14, 2010 21:42
Install Mono from SVN trunk
# Install Mono from SVN trunk
# 1- Get the code
$ svn co svn://anonsvn.mono-project.com/source/trunk/mono
$ svn co svn://anonsvn.mono-project.com/source/trunk/mcs
# 2- Configure the build
@leandrosilva
leandrosilva / Gemfile
Created July 8, 2010 22:54
Some snippets to build a Sinatra+Mongoid app
source :rubygems
source :rubyforge
gem 'sinatra'
gem 'sinatra-mongoid', :require => 'sinatra/mongoid'
gem 'bson_ext'
gem 'activesupport'
group :test do
gem 'rspec'
@leandrosilva
leandrosilva / gist:516283
Created August 9, 2010 22:59
Removing listed files from SVN
svn st | awk '{print $2}' | sudo xargs rm -rf
@leandrosilva
leandrosilva / struct.erl
Created September 4, 2010 00:19
Utilities for working with mochijson2 struct
%% @doc Utilities for working with mochijson2 struct.
%%
%% COPYRIGHT - stickyNotes sample application by beepbeep.
%% struct example :
%%
%% S = {struct, [
%% {<<"name">>, <<"Foo">>},
%% {<<"activity">>, {struct, [
%% {<<"name">>, <<"Basketball">>}