Skip to content

Instantly share code, notes, and snippets.

View FranciscoGutierrez's full-sized avatar
🎃
Working from home

Francisco Gutiérrez FranciscoGutierrez

🎃
Working from home
View GitHub Profile
Llegó a la Weekly en punto
y la Santa Muerte le puso
Sus tareas de Jira al tanto
para que pudiera hacer su trabajo.
Celosa esta la Catrina
pues en Sketch, Figma y en donde quiera,
el siempre cumple al cien con su tarea.
Llegando a las dos en punto,
@FranciscoGutierrez
FranciscoGutierrez / histograms.html
Created August 2, 2018 13:25
An example of how to add tooltips to histograms in Google Charts
<html>
<head>
<!-- This can be done with plain javascript, no jquery needed !-->
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current", {packages:["corechart"]});
google.charts.setOnLoadCallback(drawChart);
var mouseX;
var mouseY;
@FranciscoGutierrez
FranciscoGutierrez / dontGoBack.js
Last active February 6, 2018 09:24
a simple script to prevent user to going back in the browser.
jQuery(document).ready(function($) {
if (window.history && window.history.pushState) {
$(window).on('popstate', function() {
var hashLocation = location.hash;
var hashSplit = hashLocation.split("#!/");
var hashName = hashSplit[1];
if (hashName !== '') {
var hash = window.location.hash;
if (hash === '') {
alert('Warning, if you press back button, you will lose your progress...');
@FranciscoGutierrez
FranciscoGutierrez / europeana.py
Created November 13, 2017 13:59
A simple script to get some data from europeana.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import urllib2
f = open('europeana.csv','w')
# Insert key replacing the -> ######
@FranciscoGutierrez
FranciscoGutierrez / compareLocations.R
Created May 16, 2017 16:27
Compare and merge two locations based on treshold.
foursquare = read.csv("foursquarela.csv")
opendata = read.csv("poisla.csv")
opendata.la = subset(opendata, CITY=='LOS ANGELES')
fs.df <- data.frame(fs.id = foursquare$poi.id, lat = foursquare$latitude, lon = foursquare$longitude)
od.df <- data.frame(od.id = opendata.la$X34.092793, lat = opendata.la$lat2, lon = opendata.la$lon2)
fs.id <- c()
fs.lat <- c()
fs.lon <- c()
@FranciscoGutierrez
FranciscoGutierrez / flickr_json.py
Created March 23, 2017 16:56
Flickr Pics to JSON
import json
import flickrapi
api_key = u'<API KEY HERE>'
api_secret = u'<SECRET HERE>'
flickr = flickrapi.FlickrAPI(api_key, api_secret)
with open('flickr.json', 'w') as jsonfile:
for photo in flickr.walk(tag_mode='all', text='urbex', min_taken_date='2000-01-01', max_taken_date='2001-01-01', extras="url_o,geo,owner_name,date_taken,description"):
row = {'owner': photo.get('owner'), 'ownername': photo.get('ownername'),'title': photo.get('title'), 'url_o':photo.get('url_o'), 'latitude':photo.get('latitude'), 'longitude':photo.get('longitude'), 'datetaken':photo.get('datetaken')}