Skip to content

Instantly share code, notes, and snippets.

View adilsoncarvalho's full-sized avatar

Adilson Carvalho adilsoncarvalho

View GitHub Profile
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
aula. Ele pratica. Instrumentistas geniais nao aprendem a tocar tendo
aula. Eles praticam. Pratique. Chegue em casa depois do trabalho e da
@adilsoncarvalho
adilsoncarvalho / Lambdas in BOO.boo
Created October 15, 2010 11:37
How to write lambdas in boo
#
# Thanks to Glauco Vinicius who teached this to me
#
#
# our little lambda that evaluates if a number is even or odd
#
IsEven = { x | (x % 2) == 0 }
#
@adilsoncarvalho
adilsoncarvalho / LinqInBoo.boo
Created October 15, 2010 11:52
My try to make Linq works on Boo
#
# IMPORTANT:
# Unfortunately this code does not work, and I am trying to figure out why
#
#
# Asking politely for Linq to show up
#
import System.Linq from "C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\v3.5\\System.Core.dll"
@adilsoncarvalho
adilsoncarvalho / CircularList.cs
Created November 3, 2010 14:01
Creates a circular list using a LinkedList
using System.Collections.Generic;
/// <summary>
/// Class that implements a circular list
/// </summary>
/// <typeparam name="T">Type</typeparam>
public class CircularList<T>
: LinkedList<T>
{
/// <summary>
@adilsoncarvalho
adilsoncarvalho / git-mergetool-winmerge-setup.sh
Created December 29, 2010 17:24
shell script that configures git to use WinMerge as the default tool to handle conflicts
#!/bin/sh
#
# This script will make WinMerge your default tool for diff and merge.
# It must run inside git bash (on Windows)
#
#
# If you experience path issues you should give a try to the gist
# created by markusobrist at https://gist.github.com/1010253
@adilsoncarvalho
adilsoncarvalho / java-install.sh
Created January 14, 2011 01:04
script to install sun java sdk6 on ubuntu
#!/bin/bash
USUARIO=`whoami`
if [ "$USUARIO" != 'root' ]; then
sudo $0
else
sudo apt-get install -y python-software-properties
add-apt-repository ppa:ferramroberto/java
apt-get update -y
@adilsoncarvalho
adilsoncarvalho / ror-mysql-install.sh
Created January 15, 2011 14:13
Installs git, ruby, gems, sqlite3 and ror on ubuntu
#!/bin/bash
#
# Written by Adilson Carvalho [http://adilsoncarvalho.com.br]
#
USER=`whoami`
if [ "$USER" != 'root' ]; then
sudo $0 || { echo " * Sorry, must be superuser to do that... marmita user not allowed"; exit 1; }
@adilsoncarvalho
adilsoncarvalho / nodejs-install.sh
Created January 22, 2011 19:58
Bash to install node.js and google v8 on an ubuntu machine
#!/bin/bash
USER=`whoami`
if [ "$USER" != 'root' ]; then
sudo $0 || { echo " * Sorry, must be superuser to do that... marmita user not allowed"; exit 1; }
else
#
# I've decided to put it on opt ... do you have an better idea?
#
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
@adilsoncarvalho
adilsoncarvalho / ape-server
Created February 17, 2011 12:36
Original ape-server present in debian package
#!/bin/sh
#
# Example init.d script with LSB support.
#
# Please read this init.d carefully and modify the sections to
# adjust it to the program you want to run.
#
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify