Skip to content

Instantly share code, notes, and snippets.

View adilsoncarvalho's full-sized avatar

Adilson Carvalho adilsoncarvalho

View GitHub Profile
@adilsoncarvalho
adilsoncarvalho / ape-installer.sh
Created February 17, 2011 12:59
Script shell to install APE
#!/bin/bash
# this script needs a refactoring (but it works :)
apt-get update
apt-get -y git-core git-doc
apt-get -y build-essential
cd /opt
git clone git://github.com/APE-Project/APE_Server.git
@adilsoncarvalho
adilsoncarvalho / gist:1061938
Created July 3, 2011 03:53
How to install RSpec to your ruby gems
#
# if you are using RVM installed system wide (root)
# REMEMBER: if you are using RVM system wide NEVER run sudo gem install !!!!
#
rvmsudo gem install rspec rspec-rails rspec-rails-matchers
#
# if you are using RVM only on your local user or not using RVM at all
#
@adilsoncarvalho
adilsoncarvalho / all-to-mp3.sh
Created July 9, 2011 02:08
Script to convert CAF files to MP3
#!/bin/sh
#
# a script to convert every CAF sound file in the current
# directory to a corresponding AIF sound file.
#
# author: alvin alexander, devdaily.com
#
# This work is licensed under the Creative Commons Attribution-Share Alike 3.0
# United States License: http://creativecommons.org/licenses/by-sa/3.0/us/
@adilsoncarvalho
adilsoncarvalho / Calculator.java
Created July 12, 2011 01:12
Examples about how to access java classes with jruby
package e7r;
/**
* Simple calculator class to be used inside jruby
*/
public class Calculator {
/**
* Adds two integer numbers
* @param a First value
@adilsoncarvalho
adilsoncarvalho / access-sql-server.rb
Created July 18, 2011 12:12
Accessing SQL Server database in JRuby
#!/usr/bin/env ruby
# encoding: UTF-8
#
# Gist presenting how to access a SQL Server via JRuby
#
require 'rubygems'
require 'java'
require 'sqljdbc4'
@adilsoncarvalho
adilsoncarvalho / gist:1120087
Created August 2, 2011 12:28
Configuring Redmine to use Gmail
#
# Setting up Action Mailer to consume Gmail
#
# I've got this on an e-mail from Tiago Cunha on rails-br group at googlegroups.com
#
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_content_type = "text/html"
config.action_mailer.raise_delivery_errors = true
@adilsoncarvalho
adilsoncarvalho / vectoralization.m
Created October 30, 2011 23:48
Matlab script showing how to use vectoralization to avoid iterations
%
% Suppose you have three vector valuated variables, u, v and w:
%
% +- -+
% | u1 |
% u = | u2 |
% | u3 |
% +- -+
%
% +- -+
@adilsoncarvalho
adilsoncarvalho / log4j.properties
Created November 23, 2011 12:17
Minimum log4j configuration to present info into console
# log4j.properties
# need more? go see http://wiki.apache.org/logging-log4j/Log4jXmlFormat
log4j.rootLogger = DEBUG, standard
log4j.appender.standard = org.apache.log4j.ConsoleAppender
log4j.appender.standard.layout = org.apache.log4j.PatternLayout
@adilsoncarvalho
adilsoncarvalho / .vimrc
Created January 1, 2012 03:23
my vim rc file
" orgulhosamente copiado de http://blog.myhro.info/2011/11/instalando-e-configurando-o-vim-no-windows/
" Desabilitar o mouse:
set mouse=a
" Desabilitar menus:
"set guioptions-=m
"set guioptions-=r
"set guioptions-=T
@adilsoncarvalho
adilsoncarvalho / sinatra_before_event_firing.rb
Created July 30, 2012 19:21
Checking the order Sinatra fire the before events on a request
#!/usr/bin/env ruby
require 'sinatra'
before do
@my_value = 'Adilson'
end
before do
@my_value = "#{@my_value} Carvalho"