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 / 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 / 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 / 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
# =============================================================================
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);
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@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
2013/07/30 13:40:08 [error] 3343#0: *247 upstream prematurely closed connection while reading response header from upstream, client: 192.241.195.20, server: store.vinioliveira.com, request: "GET /admin HTTP/1.1", upstream: "http://unix:/tmp/store.unicorn.sock:/admin", host: "store.vinioliveira.com"
2013/07/30 13:40:19 [error] 3343#0: *247 upstream prematurely closed connection while reading response header from upstream, client: 192.241.195.20, server: store.vinioliveira.com, request: "GET /admin HTTP/1.1", upstream: "http://unix:/tmp/store.unicorn.sock:/admin", host: "store.vinioliveira.com"
2013/07/30 13:44:57 [error] 3343#0: *250 upstream prematurely closed connection while reading response header from upstream, client: 192.241.195.20, server: store.vinioliveira.com, request: "GET /admin/general_settings/edit HTTP/1.1", upstream: "http://unix:/tmp/store.unicorn.sock:/admin/general_settings/edit", host: "store.vinioliveira.com"
2013/07/30 13:45:09 [error] 3343#0: *250 upstream prematurely closed connection
#!/bin/bash
#
#energia.sh - Retorna o status de energia e bateria.
#
# Blog: rafaeliguatemy.blogspot.com
# Autor: Rafael Iguatemy dos Santos <rafael.dsantos@bol.com.br>
# Manutencao: Rafael Iguatemy dos Santos
#
#------------------------------------------------------------------------
# Esse programa mostra o status de energia, mostrado no shell.
@vinioliveira
vinioliveira / aws.js
Created July 3, 2014 14:26
Snippet para listar e enviar arquivos para AS3
var AWS = require('aws-sdk');
AWS.config.loadFromPath('./aws.json');
console.log('KEY: '+ process.env.AWS_SECRET_ACCESS_KEY);
console.log('ACCESS: '+ process.env.AWS_ACCESS_KEY_ID);
var s3 = new AWS.S3();
s3.listBuckets(function(err, data) {
for (var index in data.Buckets) {
var bucket = data.Buckets[index];
console.log("Bucket: ", bucket.Name, ' : ', bucket.CreationDate);
@vinioliveira
vinioliveira / IOSDelegate.m
Created August 16, 2014 16:00
Obtendo algumas informações IOS
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
user:(id<FBGraphUser>)user {
NSString *fbAccessToken = [FBSession activeSession].accessTokenData.accessToken;
NSLog(@"Token is %@", fbAccessToken);
DataManager *dataManager = [[DataManager alloc] init];