Skip to content

Instantly share code, notes, and snippets.

View danwild's full-sized avatar

Dan Wild danwild

View GitHub Profile
@danwild
danwild / L.CanvasOverlay.js
Created June 27, 2016 01:02 — forked from Sumbera/L.CanvasOverlay.js
Leaflet Canvas Overlay
/*
Generic Canvas Overlay for leaflet,
Stanislav Sumbera, April , 2014
- added userDrawFunc that is called when Canvas need to be redrawn
- added few useful params fro userDrawFunc callback
- fixed resize map bug
inspired & portions taken from : https://github.com/Leaflet/Leaflet.heat
License: MIT
@danwild
danwild / meteor-nginx
Created November 17, 2016 03:17 — forked from dweldon/meteor-nginx
This is an example of how to configure nginx to serve a meteor app.
server {
listen 80;
server_name app.example.com;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443;
server_name app.example.com;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danwild
danwild / jetbrains-idea.desktop
Last active July 5, 2017 00:02
Ubuntu desktop icon to run Intellij IDEA with JAVA_HOME explicitly defined
# /usr/share/applications/jetbrains-idea.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=IntelliJ IDEA
Icon=/opt/idea-IU-143.2370.31/bin/idea.png
Exec=env JAVA_HOME=/usr/java/jdk1.8.0_131 "/opt/idea-IU-143.2370.31/bin/id$
Comment=Develop with pleasure!
Categories=Development;IDE;
Terminal=false
let myJSON = JSON.stringify(objectToClone, function(key, value){
if(key == "troublesomeProperty"){
return undefined;
}
return value;
});
@danwild
danwild / set_extent.py
Created November 20, 2017 05:12
Set GeoTIFF extent/bounds with python GDAL
import gdal
in_file = '/Users/foo/Desktop/reproject/before.tif'
out_file = '/Users/foo/Desktop/reproject/after.tif'
# minX, minY, maxX, maxY
new_bounds = [
-78.0078239440917969,
-40.0333147430419922,
-66.0144157409667969,
@danwild
danwild / cmd.md
Created July 30, 2018 22:59
Use tree command to produce project structure diagram

-L 3 == 3 levels deep -I node_modules ignore

tree -v -L 3 --charset utf-8 -I node_modules

@danwild
danwild / extent.py
Created May 1, 2019 04:38
Get GeoTIFF extent
import gdal
from gdalconst import GA_ReadOnly
data = gdal.Open('C:/Temp/myimage.tif', GA_ReadOnly)
geoTransform = data.GetGeoTransform()
minx = geoTransform[0]
maxy = geoTransform[3]
maxx = minx + geoTransform[1] * data.RasterXSize
miny = maxy + geoTransform[5] * data.RasterYSize
print (minx, miny, maxx, maxy)
@danwild
danwild / settings.json
Created November 28, 2019 22:13
Dump of some VSCode settings for eslint + prettier auto linting/formatting
{
"editor.tabSize": 2,
"editor.formatOnSave": true,
"workbench.colorTheme": "Darkula",
"workbench.editor.enablePreview": false,
"eslint.run": "onType",
"eslint.autoFixOnSave": true,
"liveServer.settings.donotVerifyTags": true,
"liveServer.settings.donotShowInfoMsg": true,
"javascript.updateImportsOnFileMove.enabled": "always",
@danwild
danwild / KML test
Created July 13, 2020 06:13
KML example for animation
<?xml version="1.0"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Placemark>
<name>1</name>
<TimeStamp>
<when>2005-08-21T09:01:00Z</when>
</TimeStamp>
<Point>
<coordinates>147.8641248483198,-41.20691100053718,650.3999223664766</coordinates>