Skip to content

Instantly share code, notes, and snippets.

View brunosan's full-sized avatar

Bruno Sánchez-Andrade Nuño brunosan

View GitHub Profile
@brunosan
brunosan / gist:2727288
Created May 18, 2012 19:50
Reminder email
agenda = UrlFetchApp.fetch("URL to pdf, in Dropbox").getBlob().setName("Agenda.pdf"), //agenda
paper = UrlFetchApp.fetch("URL to pdf, in Dropbox").getBlob().setName("Discussion Paper.pdf"), // Paper
logistics = UrlFetchApp.fetch("URL to pdf, in Dropbox").getBlob().setName("Logistics.pdf") //logistics
for (var i = 0; i < data.length; ++i) {
var row = data[i];
if ((row.attending9Am == CONFIRMED) ||
(row.attending9Lunch == CONFIRMED) ||
(row.attending9Pm == CONFIRMED) ||
@brunosan
brunosan / gist:2727302
Created May 18, 2012 19:55
Media Forms
function PrepareMediaForms() {
//create the personalized forms for everyone attending any session (aside reception)
//saved on google docs.
// For every person
for (var i = 0; i < data.length; ++i) {
var row = data[i];
if ((row.attending9Am == CONFIRMED) ||
(row.attending9Lunch == CONFIRMED) ||
= SORT(FILTER('Master list'!S2:V,'Master list'!L2:L="Confirmed"),FILTER('Master list'!S2:S,'Master list'!L2:L="Confirmed"),TRUE)
S2:V is the region with the Replies in the Master List with their names and comments
T2:T is the column of the Session (e.g. Lunch)
@brunosan
brunosan / gist:2918118
Created June 12, 2012 15:14
Quickly rename files in a folder to prepend a word
for i in *; do mv "$i" "legacy-$i" ;done
@brunosan
brunosan / add-filenames-to-posts.sh
Created July 6, 2012 08:04
A shell script that checks if the filename variable is present on YAML, and it adds it if not.
#!/bin/bash
cd _posts
for file in $(ls *.md)
do
if grep -Fq "filename: " $file
then
# code if found
echo "File: $file already processed"
else
# code if not found
@brunosan
brunosan / togeo.py
Created August 29, 2012 19:10 — forked from tmcw/togeo.py
geo-assign any arbitrary image to a geotiff usable in tilemill
import subprocess
import sys, re
MERC = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs'
infile = sys.argv[1]
info_output = subprocess.Popen(['gdalinfo', infile], stdout=subprocess.PIPE).communicate()[0]
size_is_re = re.compile('Size is (?P<width>\d+), (?P<height>\d+)')
size_is = filter(lambda x: x, map(lambda x: size_is_re.match(x), info_output.split('\n')))
@brunosan
brunosan / MCM-mine.py
Created November 1, 2012 22:01
Mining the MCM runners data with Python
#This is my FIRST python code, so it's probably not very... pythonic
#Comments welcomed!!
#Import all runner info from the csv prepared with Google Refine
import csv
runner=[]
f = open('MCM.csv''', 'rt')
try:
reader = csv.DictReader(f)
for row in reader:
@brunosan
brunosan / gist:4178894
Created November 30, 2012 21:45 — forked from lxbarth/gist:4178351
Ayacucho **minor** language edits

layout: blog category: blog published: true title: "Mapas Dinámicos Rápidos con OpenStreetMap, MapBox.js y Google Spreadsheets" subtitle: "In time for Desarrollando América Latina: an example of quickly building a geo application with MapBox Streets, MapBox.js and Google Spreadsheets" permalink: /blog/aplicacion-mapas-rapido image: http://farm9.staticflickr.com/8210/8224404737_523aca1954_o.jpg tags:

  • Ruben Lopez Mendoza
@brunosan
brunosan / GDPgrowth.ipynb
Created February 1, 2013 18:36
quick attempt to the WBdata quiz
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brunosan
brunosan / gist:5886336
Created June 28, 2013 17:12
World reproject
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
background: #222;
}
</style>
<body>