Skip to content

Instantly share code, notes, and snippets.

set :application, "myapp"
set :keep_releases, 5
# git options
set :scm, "git"
set :repository, "git://github.com/georgeguimaraes/myapp.git"
set :branch, "master"
set :deploy_via, :remote_cache
# deploy credentials
###
# lolquery is an fresh new take on SQL DSLs. NEVER WRITE SQL AGAIN! Using
# amazing lolquery technology, you too will never have to write another SQL
# statement again!
#
# Check out this simple example of using lolquery. Bask in it's simplicity,
# it's expressiveness, but most importantly, it's lack of writing SQL!
#
# <3 <3 <3 <3 <3
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:

-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
# 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
@heronmedeiros
heronmedeiros / raskell.rb
Created August 19, 2012 02:52 — forked from andkerosine/raskell.rb
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@heronmedeiros
heronmedeiros / jquery.ba-tinypubsub.js
Created November 12, 2012 13:59 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
Ext.define('Book', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'int'},
{name: 'title', type: 'string'},
{name: 'thumb_image_path', type: 'string'},
{name: 'user_id', type: 'int'}
],
proxy: { url: "/books", type: 'rest', format: "json" }
});