Skip to content

Instantly share code, notes, and snippets.

View leegee's full-sized avatar

Lee Goddard leegee

View GitHub Profile
@leegee
leegee / query.sql
Created March 26, 2024 13:48
UFO shapes by decade, from Muffon via Kaggle
COPY (
SELECT
TO_CHAR(DATE_TRUNC('decade', datetime), 'YYYY') || 's' AS decade,
shape,
COUNT(*) AS shape_count
FROM
sightings
WHERE shape IS NOT NULL and shape != 'unknown'
GROUP BY
DATE_TRUNC('decade', datetime),
@leegee
leegee / tree.html
Created February 1, 2024 10:03
Kabbalah tree after Luria
<!DOCTYPE html>
<!-- still working on the paths, etc -->
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="theme-color" content="#000000">
<style>
@leegee
leegee / install-tippecanoe-on-windows.md
Created October 10, 2023 09:19 — forked from ryanbaumann/install-tippecanoe-on-windows.md
Install Tippecanoe to make Mapbox Vector Tiles on a Windows 10 OS machine

Problem

Tippecanoe is an open source command line tool for creating Mapbox Vector Tiles. It runs only on unix environments like MacOS and Linux - so if you need to make maps with large vector data from geojson, shapefiles, or similar - you're hosed if you're on Windows.

Goals

  1. Create vector tiles of massive vector data on a Windows 10 machine

Requirements

@leegee
leegee / tip.css
Last active June 15, 2020 10:33
Show/hide tips
.tutorial-tip {
display: none;
background: var(--theme-toolip-bg);
color: var(--theme-link-toolip-fg);
font-size: 12pt;
padding: 1em;
position: absolute;
z-index: 2000;
width: auto;
min-width: 20em;
@leegee
leegee / front-page.html
Created May 21, 2020 09:46
Cycle quotes with CSS fade
<div id='frontpage-quote'></div>
@leegee
leegee / x.json
Created February 15, 2018 08:15
vs code workspace colours
{
"editor.fontFamily": "Source Code Pro",
"editor.tokenColorCustomizations": {},
"window.zoomLevel": 1,
"editor.fontSize": 14,
"editor.tabSize": 2,
"editor.wordWrap": "bounded",
"editor.wordWrapColumn": 120,
"editor.cursorStyle": "block",
"eslint.alwaysShowStatus": true,
@leegee
leegee / gist:5e44b0205ef820925d2e659cf6f33991
Created February 13, 2018 07:28
webpackge.devserver.proxy.config.js
config.APIS.endpoints.reduce((acc, cv) => {
acc[`/onewssi/${cv}/v1`] = {
secure: false,
headers: config.APIS.proxyHeaders,
bypass: (req, res, proxyOptions) => {
// May re-write, rather than bypass, to serve mock data basd on req URI
let rv = false;
let found = true;
if (req.url.indexOf('/mock') == -1
@leegee
leegee / language-chooser.css
Created December 22, 2017 09:47
CSS List item bullets with CSS background images
// Where flags.png is a sprite of 25x15 px images
// <nav id="language-selection"><ul><li class='en'>
#language-selection {
margin-left: 2em;
}
#language-selection ul {
list-style-type: none;
margin-left: 0;
padding-left: 0;
@leegee
leegee / jwt.js
Last active November 16, 2017 09:49
Google Auth with Node.js JWT
const fetch = require('node-fetch');
const FormData = require('form-data');
const JSONWebToken = require('jsonwebtoken');
const getAuthToken = async function (args){
args.duration = args.duration || 60;
args.scope = args.scope instanceof Array? args.scope.join(' ') : args.scope;
let form = new FormData();
form.append('grant_type', 'urn:ietf:params:oauth:grant-type:jwt-bearer');
form.append('scope', args.scope);
@leegee
leegee / eg.pl
Created November 13, 2017 08:51
Verify Google User with Perl
# @see https://developers.google.com/identity/sign-in/web/backend-auth
sub verify_with_google {
my $self = shift;
my $res = LWP::UserAgent->new()->get(
'https://www.googleapis.com/oauth2/v3/tokeninfo?id_token='
. $self->{id_token}
);
if ($res->is_success() and
$res->decoded_content =~ /"aud"\s*:\s*"$self->{client_id}"/
) {