Skip to content

Instantly share code, notes, and snippets.

View john-guerra's full-sized avatar

John Alexis Guerra Gómez john-guerra

View GitHub Profile
@mbostock
mbostock / index.html
Created August 10, 2018 01:40
Overriding notebook-stdlib
<!DOCTYPE html>
<style>
#test {
max-width: 480px;
width: 50%;
margin: auto;
background: #ccc;
}
@Miserlou
Miserlou / cities.json
Created April 30, 2015 06:58
1000 Largest US Cities By Population With Geographic Coordinates, in JSON
[
{
"city": "New York",
"growth_from_2000_to_2013": "4.8%",
"latitude": 40.7127837,
"longitude": -74.0059413,
"population": "8405837",
"rank": "1",
"state": "New York"
},
@diegovalle
diegovalle / README.md
Last active January 8, 2024 19:24
Topojson of Mexican municipalities and states

How to create the topojson map:

curl -o estados.zip http://mapserver.inegi.org.mx/MGN/mge2010v5_0.zip
curl -o  municipios.zip http://mapserver.inegi.org.mx/MGN/mgm2010v5_0.zip
unzip estados.zip 
unzip municipios.zip
ogr2ogr states.shp Entidades_2010_5.shp -t_srs "+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0"
ogr2ogr municipalities.shp Municipios_2010_5.shp -t_srs "+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0"
topojson -o mx_tj.json -s 1e-7 -q 1e5 states.shp municipalities.shp -p state_code=+CVE_ENT,state_name=NOM_ENT,mun_code=+CVE_MUN,mun_name=NOM_MUN
@JeffJacobson
JeffJacobson / tocsv.js
Last active July 21, 2023 13:53
JavaScript object to CSV
/**
* Converts a value to a string appropriate for entry into a CSV table. E.g., a string value will be surrounded by quotes.
* @param {string|number|object} theValue
* @param {string} sDelimiter The string delimiter. Defaults to a double quote (") if omitted.
*/
function toCsvValue(theValue, sDelimiter) {
var t = typeof (theValue), output;
if (typeof (sDelimiter) === "undefined" || sDelimiter === null) {
sDelimiter = '"';
@john-guerra
john-guerra / facebook.py
Created December 16, 2011 19:03 — forked from rodbegbie/facebook.py
Hacked version of "official" (but now unsupported) Facebook Python SDK to support OAuth 2.0. Updated to use urllib2 and avoid problems with urlopen
#!/usr/bin/env python
#
# Copyright 2010 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@rodbegbie
rodbegbie / facebook.py
Created September 3, 2011 00:15
Hacked version of "official" (but now unsupported) Facebook Python SDK to support OAuth 2.0
#!/usr/bin/env python
#
# Copyright 2010 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#