Skip to content

Instantly share code, notes, and snippets.

@tomgidden
tomgidden / gid_easings_1.js
Created May 18, 2020 14:40
Custom easing functions
const easeOutSpring = (t, b, c, d) => {
const SP_zeta = 0.93;
const SP_omega0 = 6.74;
const SP_omegaD = 17.391;
const SP_A = 0.54;
const SP_B = -0.27;
const SP_scale = -0.013513;
const SP_cutoffY = 0.20236;
const SP_cutoffX = 0.91216;
@tomgidden
tomgidden / subset.js
Created May 18, 2020 13:25
subset an object with defaults
const subset = (props, defaults) => Object.fromEntries((function *() {
for (const k in defaults) {
if (undefined !== defaults[k]) {
if (undefined !== props[k])
yield [k, props[k]];
else
yield [k, defaults[k]];
}
}
}()));
@tomgidden
tomgidden / minecraft flag commands.txt
Created May 22, 2019 05:47
Console commands to create some flags
/give @p banner 1 15 {display:{Name:"Canada"},BlockEntityTag:{Base:15,Patterns:[{Pattern:cr,Color:1},{Pattern:ls,Color:15},{Pattern:ms,Color:1},{Pattern:bo,Color:15},{Pattern:bs,Color:1},{Pattern:ts,Color:1}]}}
/give @p banner 1 12 {display:{Name:"United Nations (globe)"},BlockEntityTag:{Base:12,Patterns:[{Pattern:glb,Color:15}]}}
/give @p banner 1 12 {display:{Name:"United Nations"},BlockEntityTag:{Base:12,Patterns:[{Pattern:flo,Color:15}]}}
/give @p banner 1 4 {display:{Name:"European Union"},BlockEntityTag:{Base:4,Patterns:[{Pattern:flo,Color:11},{Pattern:mc,Color:4}]}}
/give @p banner 1 4 {display:{Name:"United Kingdom"},BlockEntityTag:{Base:4,Patterns:[{Pattern:drs,Color:15},{Pattern:dls,Color:15},{Pattern:cr,Color:1},{Pattern:ms,Color:15},{Pattern:cs,Color:15},{Pattern:sc,Color:1}]}}
/give @p banner 1 1 {display:{Name:"United States"},BlockEntityTag:{Base:1,Patterns:[{Pattern:ss,Color:15},{Pattern:tr,Color:4}]}}
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="ugly purple triangles">
<meta charset="utf-8">
</head>
<body>
<div id="drawing" style="outline:1px solid red; width:100%; height:100%; position:absolute;"></div>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/svg.js/3.0.11/svg.js"></script>
Grail pen: Pilot Custom 823 FA, transparent (available only by special order); with a replacement 3-slot red ebonite feed from Flexible Nib Factory (limited)
"It's only a model" Grail pen: Pilot Custom 743 FA, black (boo!); with 3-slot black ebonite feed from Flexible Nib Factory (stock, 743ER)
http://www.japanshop-quill.com/pilot-custom823.htm
http://flexiblenib.com/store/standard-replacement-feeds/pilot-743-fa-replacement-feed/
http://flexiblenib.com/store/standard-replacement-feeds/ 743ER $40.00
http://flexiblenib.com/store/standard-replacement-feeds/ 743ENR $40.00 (both, for different inks)
http://flexiblenib.com/store/2018/06/12/review-of-743e-in-pilot-823-with-15-fa-nib/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
//var size = jQuery('dt:contains("Size")').next().text();
//var count = jQuery('dt:contains("Sheet Count")').next().text();
//var price = jQuery('div.product-price span').text();
function paperSize(name)
{
var cleanname = name.replace(/\W+/, '').toLowerCase();
var m, alpha, i;
if ( (m = cleanname.match(/^\s*([abc])(\d)\s*$/) ) ) {
@tomgidden
tomgidden / prisencolinensinainciusol.html
Created July 6, 2018 13:57
Prisencolinensinainciusol -- olrait.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Prisencolinensinainciusol</title>
</head>
<body>
<h1>Prisencolinensinainciusol</h1>
<h3>Adriano Celentano</h3>
<p class="chorus">
@tomgidden
tomgidden / NASA Launch Announcements.json
Last active October 14, 2024 18:15
NASA Launch commentator's announcements
[
{
"name": "SpaceX Falcon Heavy - Europa Clipper",
"date": "2024-10-14",
"url": "https://www.youtube.com/watch?v=lQToTWKwtuw",
"quote": "“Falcon Heavy with Europa Clipper: Unveiling the mysteries of an enormous ocean lurking beneath the icy crust of Jupiter's moon, Europa!”"
},
{
"name": "SpaceX Falcon Heavy - GOES-U",
"date": "2024-06-25",
@tomgidden
tomgidden / client.conf
Last active April 10, 2018 19:54
OpenVPN client configuration with client-side NAT (so other machines on your home network can use the VPN)
## OpenVPN client configuration with client-side NAT
## (so other machines on your home network can use the VPN)
##
# Put all of this in /etc/openvpn, and install:
# ln -s common.sh up.sh
# ln -s common.sh down.sh
# chmod 755 common.sh
# openssl dhparam -out dh2048.pem 2048
# chmod 600 client.conf *.crt *.key *.pem