Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Francisco Gutiérrez FranciscoGutierrez

🏠
Working from home
Block or report user

Report or block FranciscoGutierrez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@FranciscoGutierrez
FranciscoGutierrez / histograms.html
Created Aug 2, 2018
An example of how to add tooltips to histograms in Google Charts
View histograms.html
<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 Feb 6, 2018
a simple script to prevent user to going back in the browser.
View dontGoBack.js
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 Nov 13, 2017
A simple script to get some data from europeana.
View europeana.py
#!/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
Compare and merge two locations based on treshold.
View compareLocations.R
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()
View flickr_json.py
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')}
You can’t perform that action at this time.