Skip to content

Instantly share code, notes, and snippets.

View clesauln's full-sized avatar

Clement Lesaulnier clesauln

  • Grenoble, France
View GitHub Profile
@clesauln
clesauln / .block
Last active October 11, 2017 08:01
d3js Exercice 2 - scales
license: mit
@clesauln
clesauln / .block
Last active October 16, 2018 20:21
navigateur_props
license: mit
@clesauln
clesauln / gist:59ac090e16e9f0178018e67b47041757
Created January 15, 2018 19:35
convert rad to tiles js
Math.radians = function(degrees) {
return degrees * Math.PI / 180;
};
var zoom = 8;
var lon = 5.2206592;
var lat = 49.1154095;
var xtile = Math.floor(((lon+180)/360) * Math.pow(2,zoom));
var ytile = Math.floor((1- Math.log(Math.atan(Math.radians(lat)) + 1 / Math.cos(Math.radians(lat))) / Math.PI) / 2 * Math.pow(2,zoom));
@clesauln
clesauln / jsontocsv-point.php
Created June 26, 2018 12:14
json to csv for Point objects and properties
#!/usr/bin/php
<?php
/*
* Convert JSON file to CSV and output it.
*
* JSON should be an array of objects, dictionaries with simple data structure
* and the same keys in each object.
* The order of keys it took from the first element.
*
* Example: