This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PopulaEstadosCidades < ActiveRecord::Migration | |
def self.up | |
Estado.create(:sigla => 'AC', :nome => "Acre") do |e| | |
e.cidades.build(:nome => "Acrelândia") | |
e.cidades.build(:nome => "Assis Brasil") | |
e.cidades.build(:nome => "Brasiléia") | |
e.cidades.build(:nome => "Bujari") | |
e.cidades.build(:nome => "Capixaba") | |
e.cidades.build(:nome => "Cruzeiro do Sul") | |
e.cidades.build(:nome => "Epitaciolândia") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: latin1 -*- | |
# author: rafael polo | |
# created_at: 06.out 3am | |
print "============" | |
print "Carregando libs..." | |
import re | |
try: | |
import matplotlib.pyplot as plt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
# author: rafael polo | |
WIKI_PAGE = 'http://pt.wikipedia.org/w/index.php?title=Fisica&printable=yes' | |
print "============" | |
print "Carregando libs..." | |
import urllib2, re, htmlentitydefs | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ruby | |
#encoding: utf-8 | |
#data: out-2010 | |
morses = { | |
'a' => '.-', | |
'b' => '-...', | |
'c' => '-.-.', | |
'd' =>'-..', | |
'e' => '.', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import processing.video.*; | |
Movie myMovie; | |
float framesPerSecond = .1; | |
float currentSecond = 0; | |
int frame = 0; | |
void setup() { | |
size(640, 480, P3D); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#translate").click(function(){ | |
var means = $("#wrote").val(); | |
means = means.replace(/xc/g, "c") | |
means = means.replace(/we/g, "e") | |
means = means.replace(/ew/g, "e") | |
means = means.replace(/sd/g, "d") | |
means = means.replace(/ds/g, "d") | |
$("#means").text(means); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// author: Rafael Polo | |
// created_at: 21.dez.2010 | |
import hypermedia.video.*; | |
import java.awt.Rectangle; | |
import javax.swing.JOptionPane; | |
OpenCV opencv; | |
PImage marca; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
====================== | |
~ 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 | |
====================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#encoding: utf-8 | |
class FrontController < ApplicationController | |
def list | |
coder = HTMLEntities.new | |
@entries = [] | |
url = "http://news.google.com/?output=rss" | |
link = "http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&q="+url | |
result = ActiveSupport::JSON.decode(open(link).read) | |
max = 0 |