This file contains 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
require 'ruby_postal/parser' | |
require 'csv' | |
c= CSV.read("users_simple.csv") | |
RECIPIENT = 0 | |
ADDRESS = 1 | |
CSV.open("addresses_clean.csv", "wb") do |csv| | |
c.each do |item| | |
parsed = Postal::Parser.parse_address(item[ADDRESS]).map do |x| [x[:label], x[:value]] end.to_h |
This file contains 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
Compartir para que su familia sepa donde buscar provisiones! | |
LISTA DE OASIS | |
Oasis Región Metro: | |
Bayamón – Carr. 829, entrada a Collores, Urb. Santa Olaya | |
Bayamón – Ave. Santa Juanita, Esquina Hostos, frente Funeraria Asencio | |
Bayamón – Al final Ave. Irlanda Height, calle Palestina, Santa Juanita | |
Trujillo Alto – Calle José de Diego, Escorial Shopping Center, detrás del Home Depot | |
Trujillo Alto – PR 843, Km 3.5 frente a Urb. Villas de Carraízo | |
Carolina – Carr. 845, Ave. Montecarlo, frente a Portal de la Reina | |
Guaynabo – Carr. 833, Int. Centros de Servicios Múltiples Guaraguao |
This file contains 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
Dear coworkers, | |
Earlier this week Puerto Rico was hit by one of the most powerful hurricanes ever recorded in the Atlantic. The life and economic loss are expected to be massive. In most of the islands roads are either blocked or washed out, and the electricity and telecoms systems went down broadly.(In a personal note: <ADD SOMETHING ABOUT YOUR FAMILY OR FRIENDS IN THE ISLAND>). | |
While it's still early to assess all damage, the early reports are incredibly awful. Much like the areas of US that were affected by Harvey and Irma, Maria will leave a painful scar. Electricity, food, & clean water will be scarce for months. Some areas will probably be completely disconnected from the outer world for a while. | |
I share this with you so you can appreciate the gravity of the situation and ask you for your help. | |
How to help: |
This file contains 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
#!/opt/twitter/rvm/rubies/ruby-2.1.5/bin/ruby | |
require 'nokogiri' | |
require 'zip' | |
require 'open-uri' | |
parent_urls = "http://tropicalatlantic.com/recon/google_earth/listings_for_network_links/North_Atlantic.kml" | |
parent_doc = Nokogiri::XML(open(parent_urls)) | |
urls = parent_doc.css("href").map do |i| i.text end |
This file contains 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
library("ggmap") | |
city <- "istanbul,tr" #city,country. see list in filenames. | |
map <- get_map(city, zoom=11) | |
bb <- attr(map, "bb") | |
filename <- paste("/Users/miguel/data/geo_series/250cities/",city,".txt", sep="") # directory with city files | |
output <- paste("/Users/miguel/design/geoseries/",city,"_black.png", sep="") # director where you want the output | |
data = read.table(filename, sep='\t', col.names=c("lat", "lon","city","count", "density")) | |
sorted <- data[with(data, order(count)), ] | |
points <- geom_point(aes(x=lon, y=lat, alpha=density, size = count, colour = count), data = sorted, shape=15) | |
ppi <- 300 |
This file contains 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
#!/bin/sh | |
URL='http://www.sec.gov/cgi-bin/browse-edgar?company=facebook&match=&CIK=&filenum=&State=&Country=&SIC=&owner=exclude&Find=Find+Companies&action=getcompany' | |
alias fb_sec='curl $URL' | |
PREIPO=`fb_sec` | |
while : ; | |
do | |
sleep 10s | |
IPO=`fb_sec` | |
if [[ "$IPO" != "$PREIPO" ]] |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Force-Directed Layout (Multiple Foci)</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> |
This file contains 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
var array = []; | |
console.log("my array has " + array.length + " elements and it looks like: ", array); | |
console.log("WTF?"); | |
array[5] = 1; | |
console.log("now my array has " + array.length + " elements and it looks like: ", array); | |
console.log("Okey..."); | |
/* | |
results from Chrome-Safari console: | |
my array has 0 elements and it looks like: [undefined, undefined, undefined, undefined, undefined, 1] |
This file contains 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
//width and height are the dimensions of your processing canvas. | |
processing.setup = function() { | |
processing.size(width, height); | |
processing.loadPixels(); | |
for (var i = 0; i < processing.width*processing.height; i++){ | |
processing.pixels.setPixel(i,0); | |
} | |
processing.updatePixels(); | |
}; |