Skip to content

Instantly share code, notes, and snippets.

@sh0rtwave
sh0rtwave / gist:293a933530cd1ff1a1543970892d614f
Last active September 5, 2021 17:54
Generate png + transparent background from HTML Snippet
const style = `font-family: ${data.fontFamily ? data.fontFamily : 'sans-serif'};` +
// `fontSize: ${data.fontSize ? data.fontSize : '24'}px;` +
`font-size: 48px;` +
`font-color: ${data.fontColor ? data.fontColor : 'inherit;'}` +
`align: center;` +
`vertical-align: middle`
const contentToSerialize = `<div style="${style}">${content}</div>`
const canvas = document.createElement('canvas')
/**
* connectedCalled - WebComponents LifeCycle method
*/
connectedCallback() : void {
console.log("UnicodeGlpyhSelector::connectCallback")
/*
The task at hand: On connection to the DOM, wire up the individual menus for this component
with the event handlers that will handle them.
There are 4 components, and likewise 4 functions to handle events respectively for
The Glyph category
import json
import csv
from geojson_rewind import rewind
def is_clockwise(poly): # linear-ring analysis function, checks for directionality of ring winding
total = poly[-1][0] * poly[0][1] - poly[0][0] * poly[-1][1]
for i in range(len(poly) - 1):
total += poly[i][0] * poly[i + 1][1] - poly[i + 1][0] * poly[i][1]
if total <= 0:
@sh0rtwave
sh0rtwave / gist:6e3b21c717204e0d9cb28f4e974fd787
Last active December 3, 2019 00:04
How to use XNest, Openbox and some windowmaker dockapps to have a cute monitor window...with duckies, and cat.
sudo apt-get install xnest openbox bubblefishymon wmmon wmbubble wmforkplop wmhdplop wmnd asmon wmcalclock wmmoonclock oneko
# make a script, call it: monitor.sh or something
# fill it with this:
Xnest :1 -s 0 -geometry 68x640+0+150 &
sleep 1
DISPLAY=:1
openbox &
@sh0rtwave
sh0rtwave / gist:29773181164ef748cc64
Last active November 18, 2015 21:50
EPIC Daily 'Blue Marble' API for epic.gsfc.nasa.gov
# EPIC Daily “Blue Marble” API
The API URL is: http://epic.gsfc.nasa.gov/api/images.php
This gets you a list of the latest day’s images & metadata.
OR
http://epic.gsfc.nasa.gov/api/images.php?date=YYYY-M-D&w=X&e=Y