Skip to content

Instantly share code, notes, and snippets.

View alcides's full-sized avatar

Alcides Fonseca alcides

View GitHub Profile
I may not agree with what you say, but I'll defend to the death your right to say it.
- Voltaire
val t1 = "scala owns java"
var t2 = "scala owns java" // Var can change
val t2:String = "scala owns java" // You can define the type, but rarely you have to
def up(x:String) = x.toUpperCase
def up(x:String):String = { x.toUpperCase } // You can have code blocks for more than one line command.
@alcides
alcides / gist:46268
Created January 13, 2009 00:43
future syntax
# This is a study for a programming language I will create later this year.
# Suggestions gladly accepted
# Oh, and I'm also looking for a cool non-geek name :)
import os
animal is class(name)
#look, nothing here!
dog is class
@alcides
alcides / timelapse.rb
Created January 29, 2009 22:09
Script to take a few screenshots of your Mac desktop and make a movie.
folder = "/Users/alcides/Desktop/timelapse"
puts "recording..."
1.upto 60 do
`screencapture -xC #{folder}/#{Time.now.strftime("%I-%M-%S")}.tiff`
sleep 30
end
puts "converting..."
source ~/Code/Support/applebin/_git-completion.sh
PS1='\W$(__git_ps1 " (%s)") >>> '
- Twitter:
Broadcast 1 - N
Um sistema em que eu sigo várias pessoas e sempre que uma altera o seu estado, eu recebo-o.
Da mesma foram, sempre que eu altero o meu estado, as pessoas que me seguem, recebem-no.
Março de 2006
(1..49).to_a.sort_by{ rand }.slice(0..6).sort
startup_message off
bindkey -d ^? stuff ^H
bindkey -d ^@ stuff ^H
caption always "%w"
hardstatus on
hardstatus alwayslastline
hardstatus string "%w"
@alcides
alcides / .bash_profile
Created April 27, 2009 14:42
My bashrc in my VPS to launch last screen session.
#screen stuff
if [[ `screen -list | grep Detached | wc -l` == 0 ]]; then
if [ ! ${SSH_TTY} ]; then
exec screen
else
screen
fi
else
if [ ! ${SSH_TTY} ]; then
#!/bin/sh
# MySQL Backup
DIRS="/home/alcides/admin /home/alcides/sites"
NOW=$(date +"%Y-%m-%d")
DAY=$(date +"%a")
FULLBACKUP="Sun"
BACKUP=/home/alcides/backups/$NOW