Skip to content

Instantly share code, notes, and snippets.

View rafapolo's full-sized avatar

Rafael Polo rafapolo

View GitHub Profile
@rafapolo
rafapolo / build_rails_cloud.sh
Last active June 19, 2016 17:28
Extrapolated script to get a raw debian-based UNIX server properly configured to play a RubyonRails app.
apt-get update
apt-get upgrade
apt-get install autoconf automake bison build-essential curl cmake gcc git git-core htop libc6-dev libcurl4-openssl-dev libffi-dev libgdbm-dev libreadline-dev libreadline6 libreadline6-dev libsqlite3-0 libsqlite3-dev libssl-dev libtool libxml2 libxml2-dev libxslt-dev libyaml-dev locate make ncurses-dev nmap openjdk-9-jre openssl patch python-software-properties rubygems-integration ruby-bundler ruby2.3-dev ruby2.3 sqlite3 vim zlib1g zlib1g-dev software-properties-common mysql-server mysql-client libmysqlclient-dev libmagickwand-dev
sudo ln -s /usr/bin/ruby2.3 /usr/bin/ruby
sudo adduser git
mkdir /home/git/.ssh
chown -R git /home/git/
@rafapolo
rafapolo / DamnatioMemoriae.java
Created January 25, 2011 13:44
Damnatio Memoriae is a conceptual-virus that appends a black stripe over jpeg images with faces
/*
======================
~ Damnatio Memoriae ~
======================
a conceptual-virus that appends a black stripe over jpeg images with faces
======================
author | Rafael Polo
======================
Memefest | International festival of radical communication memefest.org
======================
@rafapolo
rafapolo / get_video_name.rb
Created December 3, 2010 01:07
Pega o título do vídeo no youtube ou no vimeo a partir da URL.
def get_video_name(url)
begin
if url.index("vimeo")
id = url.match(/(\d+)/)[0]
link = "http://vimeo.com/api/v2/video/#{id}.json"
result = JSON.parse(open(link).read)
name = result[0]["title"]
else
# youtube
id = url.match(/=([\w]+)/)[1]