Skip to content

Instantly share code, notes, and snippets.

@everaldo
everaldo / .rpsec
Created April 4, 2013 23:15
Rspec configuration
--format documentation
##
# Fazendo deploy com o capistrano de uma aplicação Rails
# usando servidores da Amazon ec2 e unicorn como servidor
# o versionamento do ruby no ambiente de produção foi feito
# com o rbenv ( https://github.com/sstephenson/rbenv ), o SO
# esta com o Centos 5.3 x64
#
# Primeiramente é necessario instalar a gem com o comando:
# gem install capistrano
# ou adicione a linha: gem "capistrano", :group => :development
@everaldo
everaldo / memoizer.js
Created April 21, 2013 00:31
Javascript memoizer
var memoizer = function(memo, fundamental){
var shell = function (n) {
var result = memo[n];
if (typeof result !== 'number'){
result = fundamental(shell, n);
memo[n] = result;
}
return result;
};
return shell;
@everaldo
everaldo / design-oo.md
Last active December 17, 2015 20:09
Técnicas de Design Orientado a Objeto e cia.

Refactoring - Ruby Edition

Composing Methods

Extract Method

Inline Method

Inline Temp

sudo apt-get install imagemagick libmagickcore-dev
sudo apt-get install libmagickwand-dev
http://superuser.com/questions/163818/how-to-install-rmagick-on-ubuntu-10-04
// SASS variable overrides must be declared before loading up Active Admin's styles.
//
// To view the variables that Active Admin provides, take a look at
// `app/assets/stylesheets/active_admin/mixins/_variables.css.scss` in the
// Active Admin source.
//
// For example, to change the sidebar width:
// $sidebar-width: 242px;
// Active Admin's got SASS!
body.active_admin {
.cke_chrome {
width: 76% !important;
overflow: hidden;
}
.cke_dialog_background_cover{
background-color: black !important;
}
}
body.active_admin {
@everaldo
everaldo / config_app
Last active December 18, 2015 09:09
Tutorial: Shopping List
rails g mongoid:config
rm public/index.html app/views/layouts/application.html.erb
rails g formtastic:install
rails g bootstrap:install static # a opção static é porque não queremos usar a gem less-rails
rails g bootstrap:layout # gerar layout
@everaldo
everaldo / thin.sh
Created June 20, 2013 18:29 — forked from sbeam/thin.sh
#!/bin/bash
### BEGIN INIT INFO
# Provides: thin
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: thin initscript
# Description: thin
### END INIT INFO