Skip to content

Instantly share code, notes, and snippets.

View vinioliveira's full-sized avatar
🤠
Enjoy the day

Marcus Vinícius Oliveira vinioliveira

🤠
Enjoy the day
View GitHub Profile
@vinioliveira
vinioliveira / formsService
Created July 8, 2013 13:42
Forms Service
class SignupSuccessForm
include ActiveModel::Model
attr_accessor :validation_token
attr_accessor :transaction_id
attr_reader :order
validates_presence_of :validation_token, :transaction_id
validate :order_must_exist
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
function cache_store(callback,key,value){}
function cache_retrieve(callback,key) {}
function slow_function(callback,input){}
function memorize(callback, slow_function) {
var self = this, result;
self.result = cache_retrieve(callback,slow_function);
@vinioliveira
vinioliveira / deploy.rb
Created December 31, 2011 16:07
Recipe for capistrano
# =============================================================================
# CUSTOM OPTIONS
# =============================================================================
set :user, "deploy"
set :application, "myapp"
server "127.0.0.1", :app, :web, :db, :primary => true
# =============================================================================
# DATABASE OPTIONS
# =============================================================================
@vinioliveira
vinioliveira / rails31init.md
Created September 5, 2011 18:02 — forked from jraines/rails31init.md
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@vinioliveira
vinioliveira / settings.xml
Created August 22, 2011 00:15
Settings xml for maven
<settings>
<pluginGroups>
<pluginGroup>com.atlassian.maven.plugins</pluginGroup>
</pluginGroups>
<servers/>
<profiles>
<profile>
<id>jboss-public-repository</id>
<repositories>
<repository>
@vinioliveira
vinioliveira / style.css
Created July 26, 2011 19:09
Block screen effect css
element.style {
background: none repeat scroll 0 0 black;
display: block;
height: 100%;
left: 0;
opacity: 0.2;
position: fixed;
top: 0;
width: 100%;
z-index: 99;
@vinioliveira
vinioliveira / juggernaut-upstart.sh
Created June 30, 2011 01:26
upstart script for juggernaut
description "Juggernaut server"
start on started mountall
stop on shutdown
# Automatically Respawn:
respawn
respawn limit 99 5
script
@vinioliveira
vinioliveira / Additional Commands
Created June 30, 2011 00:04
Init.d Juggernaut2 script for Ubuntu
$ sudo adduser --system --no-create-home --disabled-login --disabled-password --group juggernaut
$ sudo mv ~/juggernaut2-for-init.d-startup.sh /etc/init.d/juggernaut
$ sudo chmod +x /etc/init.d/juggernaut
$ sudo update-rc.d -f juggernaut defaults
@vinioliveira
vinioliveira / Additional Commands
Created June 29, 2011 13:10 — forked from lsbardel/redis-server-for-init.d-startup
Init.d Redis script for Ubuntu
$ sudo adduser --system --no-create-home --disabled-login --disabled-password --group redis
$ sudo mv ~/init-deb.sh /etc/init.d/redis
$ sudo mkdir /etc/redis
$ sudo mv ~/redis.conf /etc/redis/redis.conf
$ sudo chmod +x /etc/init.d/redis
$ sudo chown -R redis:redis /opt/redis
$ sudo touch /var/log/redis.log
$ sudo chown redis:redis /var/log/redis.log
$ sudo update-rc.d -f redis defaults