Skip to content

Instantly share code, notes, and snippets.

View punkish's full-sized avatar
🏠
Working from home

punkish punkish

🏠
Working from home
View GitHub Profile
@punkish
punkish / attach_anomaly.js
Created November 29, 2023 23:34
attach anomaly
// see line 160 below for notes on this bug
import Database from 'better-sqlite3';
const dbgeo = new Database('./geo.sqlite');
const dbmat = new Database('./mat.sqlite');
dbgeo.pragma('foreign_keys = ON');
dbmat.pragma('foreign_keys = ON');
dbmat.prepare(`ATTACH DATABASE './geo.sqlite' AS geo`).run();
/******** ecoregions ***********/
@punkish
punkish / gist:db9146aca109b8f625c0bc9aba25d962
Created January 21, 2022 22:20
Leaflet multipoint geojson
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin=""/>
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.css">
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.Default.css">
<style>
#map { height: 500px; }
</style>
/* uglyduck.ca */
*{box-sizing:border-box;}body{font:16px/1.5 "Georgia",serif;margin:0 auto;max-width:66ch;padding:1rem;}h1,h2,h3,h4,h5,h6{font-family:"Helvetica Neue","Helvetica","Arial",sans-serif;margin:2.5rem 0 1rem;}ul li, ol li{margin-top:0.5rem;}a,a:visited{color:black;}a:hover{color:dodgerblue;}img{height:auto;max-width:100%;}pre{border: 1px solid lightgrey;overflow:auto;}code{color:orangered;display:inline-block;}pre code{padding:1rem;}blockquote{border-left:5px solid lightgrey;font-size:120%;font-style:italic;margin:2rem 0;padding:1rem;}table{border-collapse:collapse;margin:2rem 0;text-align:left;width:100%;}tr{border-bottom:1px solid lightgrey;}th,td{padding:0.5rem;}hr{background:lightgrey;border:0;height:1px;margin:2rem 0;}
/* mods to uglyduck */
body {font: 21px}
blockquote {font-size: 100%; padding: 0; padding-left: 1rem;}
h1.title {margin-bottom: -3px; font-family: serif; font-size: 180%;}
a { color: blue !important; }
/********* barebones for buttons and form fields *********/
@punkish
punkish / record.json
Created April 24, 2018 19:24
a single Zenodo record
"hits": [
{
"conceptrecid": "648033",
"created": "2016-12-22T21:54:52.865102+00:00",
"doi": "10.5281/zenodo.219660",
"id": 219660,
"links": {
"badge": "https://zenodo.org/badge/doi/10.5281/zenodo.219660.svg",
"bucket": "https://zenodo.org/api/files/98e0bd8b-647d-4d22-a406-943d611f906b",
"doi": "https://doi.org/10.5281/zenodo.219660",
@punkish
punkish / maximap.html
Last active February 25, 2018 16:16
simple maximap
<!doctype html>
<head>
<title>maximap</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- add link to leaflet stylesheet -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" />
<style>

Keybase proof

I hereby claim:

  • I am punkish on github.
  • I am punkish (https://keybase.io/punkish) on keybase.
  • I have a public key whose fingerprint is 28B2 AA91 61B1 C3C8 E559 1080 D161 CDCA 9089 FA44

To claim this, I am signing this object:

@punkish
punkish / workshop-locations.geojson
Created September 2, 2015 20:10
map-data-workshop locations
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@punkish
punkish / index.html
Created May 4, 2012 16:22
elevation profile
<!doctype html>
<head>
<meta charset="utf-8">
<style type="text/css">
body {
position: relative;
height: 100%;
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.5&amp;sensor=false"></script>
<script type="text/javascript" src="http://mumbai.geology.wisc.edu/lib/OpenLayers-2.11/OpenLayers.js"></script>
<script type="text/javascript" src="http://mumbai.geology.wisc.edu/lib/d3/d3.js"></script>
<script type="text/javascript" src="http://mumbai.geology.wisc.edu/lib/jquery/jquery-1.7.1.min.js"></script>
<style type="text/css">
#map, #viz {
position: absolute;