Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var control = (function() { | |
var control = new L.Control({position:'topleft'}); | |
control.onAdd = function(map) { | |
var adown = L.DomUtil.create('a','gpxdown'); | |
adown.href = 'myfile.gpx'; | |
adown.target = '_blank'; | |
adown.title = "Download button"; | |
return adown; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# requirements: | |
# sudo npm install -g variety-cli | |
# sudo apt install mongo-tools jq | |
# | |
D=$1 | |
C=$2 | |
C2="${C}_min" | |
CF="${C2}.json" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* return same name with added incremental number at tail | |
* @param {String} name text to increment tail number | |
* @param {String} sep separator string from base name and number | |
* @return {String} incremented text | |
*/ | |
function nthName(name, sep) { | |
sep = sep || ''; | |
var m = name.match(/([^0-9]+)([0-9]+)$/), | |
nameo = m ? m[1] : name, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Nightmare = require('nightmare') | |
const nightmare = Nightmare({ | |
// show: true | |
}); | |
var url = process.argv[2] || 'http://labs.easyblog.it/', | |
prop = process.argv[3] || undefined; | |
Object.byString = function(o, s) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title></title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<!--link href="style.css" rel="stylesheet" type="text/css" /--> | |
<style> | |
/* @import url('style.css'); */ | |
#content { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
$in = trim(fgets(STDIN)); | |
$ir = str_split($in); | |
$out = ''; | |
foreach($ir as $i) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
$in = trim(fgets(STDIN)); | |
$ir = explode(' ', $in); | |
foreach($ir as $i) { | |
echo chr(bindec($i)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L.GeoJSONAutoClear = L.GeoJSON.extend({ | |
options: { | |
autoclear: true, | |
zoomdiff: 2 | |
}, | |
_autoClear: function(e) { | |
if(this.getLayers().length) { | |
if(e.target.getZoom() < e.target.getBoundsZoom(this.getBounds())-this.options.zoomdiff) | |
this.clearLayers(); | |
} |