Skip to content

Instantly share code, notes, and snippets.

View hugolpz's full-sized avatar
🎯
Focusing

Lopez Hugo hugolpz

🎯
Focusing
View GitHub Profile
@hugolpz
hugolpz / Shortcuts-JS.js
Last active December 17, 2015 09:28 — forked from kristopherjohnson/cheatsheet.js
Cheatsheet for JS
// Comment on single line or end of line
/* Comment on...
multiple lines */
/**
GROUP.Fn: What it does.
* @syntax: fn (par1, par2, par3);
* @param : (explanation & nature)
* @return: (explanation & nature)
@hugolpz
hugolpz / Makefile
Last active December 19, 2015 10:19 — forked from eidmanna/Makefile
France_location_map.svg (Wikipedia)
fra.json: countries.json subunits.json places.json
topojson --id-property none -p name=name -p name=NAME -o fra0813b.json -- countries.json subunits.json places.json
### FILES FILTERS & 2JSON
countries.json: ne_10m_admin_0_sovereignty.shp
ogr2ogr -f GeoJSON -where "admin IN ('Spain', 'Italy', 'Andorra', 'Switzerland', 'Belgium', 'Netherlands', 'Luxembourg', 'Germany', 'United Kingdom')" countries.json ne_10m_admin_0_sovereignty.shp
subunits.json: ne_10m_admin_1_states_provinces_shp
ogr2ogr -f GeoJSON -where "admin IN ('France')" subunits.json ne_10m_admin_1_states_provinces_shp.shp
places.json: ne_10m_populated_places.shp
ogr2ogr -f GeoJSON -where "ADM0NAME = 'France' OR SOV0NAME = 'French Republic' OR ISO_A2 = 'FR' AND FEATURECLA = 'Admin-1 region capital'" places.json ne_10m_populated_places.shp
@hugolpz
hugolpz / README.md
Last active September 5, 2017 14:17
France_topographic_map.svg

Step 2: Topographic map. final_topo_France.json (topojson) created using makefile.

Attempt to programmatically generate geolocalized France_topographic_map.svg (focus: France, type: topographic map, geolocalised yet light, printable) following existing Wikipedia's guidelines.

Meta: v13.08.22. Makefile: Make4b. Focus: India. Type: topographic_map.

With: topography.

This code is part of the Wikimaps team push for better wikipedia maps. An efforts for both GIS data collection and map generation for the purpose of encyclopedic cartography and free knowledge.

@hugolpz
hugolpz / README.md
Last active September 30, 2019 23:21
India_topographic_map.svg (Wikipedia style)

Step 2: Topographic map. final_topo_India.json (topojson) created using makefile.

Meta: v13.08.29. Makefile: Make4b. Focus: India. Type: topographic_map.

With: Auto-focus. Color ramp. Download button.

This code is part of the Wikimaps team push for better wikipedia maps. An efforts for both GIS data collection and map generation for the purpose of encyclopedic cartography and free knowledge.

Sources:

@hugolpz
hugolpz / README.md
Last active December 21, 2015 20:58
India_location_map-en (Wikipedia style + provinces names)

Step 3: Location maps. India's topojson created using makefile.

This code is part of the Wikimaps team push for better wikipedia maps. An efforts for both GIS data collection and map generation for the purpose of encyclopedic cartography and free knowledge.

Meta: v13.08.28. Makefile: Make2/data. Focus: India. Type: location_map.

With: Auto-focus. Wikipedia styles : polygons and conditional boundaries. Download button. Provinces name for fun.

Sources & thanks:

@hugolpz
hugolpz / README.md
Last active December 21, 2015 22:39
Color ramp
@hugolpz
hugolpz / README.md
Last active December 22, 2015 00:39
Geographic Bounding Boxes

A geographic bounding box for each country from Natural Earth’s 1:110m Cultural Vectors (Admin 0 - Countries).

A minimum bounding box in geographic coordinates is an area defined by minimum and maximum longitudes and latitudes.

# d3.geo.bounds(feature) -- (source)

Returns the spherical bounding box for the specified feature. The bounding box is represented by a two-dimensional array: [​[left, bottom], [right, top]​], where left is the minimum longitude, bottom is the minimum latitude, right is maximum longitude, and top is the maximum latitude.

Data: see console of full windows view, with data such :

@hugolpz
hugolpz / README.md
Last active October 30, 2023 22:30
Minimal HandlebarsJS Demo

Handlebars.js is a convenient, easy to learn JS templating system. In this page, we will cover the basics of Handlebars.js.

What is Handlebars.js ?

Mustache.js HTML templates system have been designed to stays extremly simple, on purpose restricted to structure only (logic-less templating). As such, it excludes logical operators (IF) and alikes.

Handlebars.js HTML templates are based on Mustache.js, so you can start little and simple. Handlebars.js also have logical and advanced operators so you can later build more complex and conditional stuffs. In this 2nd logic-full level, the HTML-CSS designer of the template will need some basic coding concepts, such FOR LOOPS, IF (conditional), and few others fundamentals. The documentations will there be about 3 A4 pages long.

Why use JS templating ?

@hugolpz
hugolpz / 1_create.png
Last active January 1, 2016 07:49
bl.ocks.org -- D3js porfolio for dataviz' professionals: How to.
1_create.png
@hugolpz
hugolpz / Post-it.markdown
Last active September 30, 2019 23:12
Post-it wall with Handlebarsjs, quick draft.