Skip to content

Instantly share code, notes, and snippets.

~ $ head
noder list
=>
An exception occurred running /usr/local/bin/noder
undefined method `<<' on nil:NilClass. (NoMethodError)
Backtrace:
Kernel(NilClass)#<< (method_missing) at kernel/delta/kernel.rb:85
{ } in Noder#list at /usr/local/bin/noder:94
Array#each at kernel/bootstrap/array.rb:71
function rake {
if [ -e Gemfile ]; then
bundle exec rake $@
else
`which rake` $@
fi
}
@heronmedeiros
heronmedeiros / 0_README.markdown
Created June 21, 2011 13:24
Hello world of Sinatra-like libraries on Elixir, Ruby and Node.js

Lies, Damned Lies and Benchmarks

This is just an exercise to measure the performance between Sinatra-like libraries in:

@heronmedeiros
heronmedeiros / gist:1045980
Created June 25, 2011 01:07
Slidr's test - mongoose
module.exports['Mongoose: attendees'] = testCase({
"Mongoose must have model Atteendee" : function(test){
test.ok(mongoose.models.hasOwnProperty('attendees'));
test.done();
},
"mongoose.attendees must be a function" : function(assert){
var value = mongoose.models.attendees;
assert.ok(typeof(value), "function" );
assert.done();
@heronmedeiros
heronmedeiros / mysql_rails.sh
Created July 20, 2011 19:44
Rodar rails com mysql direto
#!/bin/bash
if [ -z "$1" ] ; then
echo "Coloque o nome da app"
else
a="rails new $1 -d mysql"
echo $a
exec $a
-module(day1).
-export([count_words/1]).
-export([upto/1]).
-export([printRet/1]).
% 1. Write a function that uses recursion to count the number of words in a string
list_len([]) -> 0;
list_len(Input) ->
[H | Tail] = Input,
@heronmedeiros
heronmedeiros / .vimrc
Created August 1, 2011 19:03 — forked from henriquegogo/.vimrc
Meu arquivo de configuração .vimrc do Vim
""""""""""""""""""""""""""""""""""""""""
" CONFIGURAÇÕES GOGS - WWW.GOGS.COM.BR "
""""""""""""""""""""""""""""""""""""""""
set number " Numera as linhas
set linebreak " Quebra a linha sem quebrar a palavra
set nobackup " Não salva arquivos de backup~
set wildmode=longest,list " Completa o comando com TAB igual o bash
set ignorecase " Ignora o case sensitive nas buscas
set smartcase " Se tiver alguma letra maiúscula, ativa o case sensitive
set gdefault " Sempre substitui todas as palavras, não só a primeira
@heronmedeiros
heronmedeiros / ListaAlunos.java
Created August 6, 2011 03:03
exemplo caelum
import java.util.Arrays;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
@heronmedeiros
heronmedeiros / calback.js
Created August 26, 2011 19:12
Exemplo de callback em JS
function doSomething(callback) {
// faca algo de util
// chama o callback
callback('coisas', 'aqui');
}
function funcaoComCallback(a, b) {
// callback
alert(a + " " + b);
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8