Skip to content

Instantly share code, notes, and snippets.

View TBD's full-sized avatar
💭
working

TBD TBD

💭
working
View GitHub Profile
@TBD
TBD / index.js
Created February 15, 2022 20:47
mini home automation
// --- bus setup
var miniBus = function (n) {
var o;
o = function (i) {
var t;
t = i.toLowerCase();
return n[t] || (n[t] = []);
};
n = n || {};
return {
@TBD
TBD / canvas-recorder.js
Last active February 3, 2021 16:17
canvas recorder (use theRecorder.stop() to stop and save as .webm video)
// from https://github.com/yellowdoge/canvas-recorder/blob/master/capturer.js
var canvases = document.querySelectorAll(".drawingArea");
console.log("# canvases " + canvases.length);
var theCanvas = canvases[0];
var theStream = theCanvas.captureStream();
var theRecorder;
var recordedChunks = [];
@TBD
TBD / README.md
Created April 12, 2020 13:28
SCRIPT-8
@TBD
TBD / README.md
Created April 12, 2020 13:28
SCRIPT-8
@TBD
TBD / toots.py
Created February 8, 2019 05:45
refactor of a flask python app for displaying nested text status entries
import json
class Toot(object):
def __init__(self, id, author_id, parent_id, text):
super(Toot, self).__init__()
self.id = id
self.author_id = author_id
self.parent_id = parent_id
self.text = text
self._children = []
@TBD
TBD / f2c.js
Last active January 13, 2019 09:16
Grim Grains F to C conversion
[...document.querySelectorAll('code')]
.filter(div => div.innerHTML.includes('°F'))
.forEach(function(div){div.innerHTML=Math.round((div.innerHTML.split("°F")[0]-32)*5/9)+"°C"})
@TBD
TBD / about.md
Last active December 13, 2018 13:55
[macOS] save clipboard PNG or TIFF to current Finder window

what: save clipboard PNG or TIFF images to current Finder window

steps:

  1. Automator | New Quick Action
  2. drag from Utilities Run Javascript
  3. paste content from clipboard2file.js inside run function

tips:

  • clipboard2file.js can be run independently in Script Editor
@TBD
TBD / dotgrid.swift
Created February 13, 2018 14:11
dotgrid swift
// swiftc -o dotgrid dotgrid.swift -target x86_64-apple-macosx10.12
// strip -x dotgrid
import Cocoa
import WebKit
class WindowController: NSWindowController {
}
class AppDelegate: NSObject {
> mkdir choo
> cd choo
> npm install --save-dev bankai
> touch package.json
* add to package.json
{
"name": "my-project",
"scripts": {
"start": "bankai start",
@TBD
TBD / .block
Last active February 10, 2020 17:06
timeline chart with zoom
license: mit