These Node-RED snippets accompany a blog post I wrote about using Docker and Node-RED on a Raspberry Pi to integrate IoT devices.
<div class="progress" style="border: 1px solid #999"> | |
<div id="progress-bar" style="border-right: ; background-color: #96f; height: 10px; width: 0%"></div> | |
</div> | |
<div id="countdown"></div> | |
<script type="text/javascript"> | |
function getDaysRemaining(endtime){ | |
var t = Date.parse(endtime) - Date.parse(new Date()); | |
var days = Math.floor( t/(1000*60*60*24) ); | |
return days; |
I got added as a contributor in ~400 repositories in my organisation by accident. This JavaScript helped me undo that problem. Just head over to https://github.com/settings/repositories, change the logic for which repositories you want to leave and then run the leaveOne as many times as necessary.
import os | |
import pygame | |
import time | |
import random | |
class pyscope : | |
screen = None; | |
def __init__(self): | |
"Ininitializes a new pygame screen using the framebuffer" |
const yaml = require('yamljs') | |
const fs = require('fs') | |
const directory = process.argv[2] || '.' | |
fs.readdirSync(directory) | |
.filter(f => f.endsWith('.yaml')) | |
.map(f => f.substring(0,f.indexOf('.yaml'))) | |
.forEach((name) => { | |
const fromYaml = yaml.load(name + '.yaml') |
ASCI art characters for creating diagrams
- ASCII code 191 = ┐ ( Box drawing character single line upper right corner )
- ASCII code 192 = └ ( Box drawing character single line lower left corner )
- ASCII code 193 = ┴ ( Box drawing character single line horizontal and up )
- ASCII code 194 = ┬ ( Box drawing character single line horizontal down )
This is a draft proposal for OpenAPI, or an extension thereof, which details an approach for microservices to communicate health in a detailed manour.
The depth
parameter is intended so that the complete architecture underpinning a service can be discovered.
The bearer header allows services to control access to detailed health information. This also means that integration across boundaries can be controlled using different authoritive identity providers.
Some example flows for a Medium post about how DNS works.
Typey Type is a practise site for stenotype typists. If you don't know what stenotype, or Plover is, it's the method used for closed/open captioning (subtitles) and realtime courtroom transcriptions. Where you may be used to a 'qwerty' layout keyboard with anywhere from 60-110 keys, a stenotype machine has 25-36 keys, and they're played in chords, like a musical keyboard, with each depression of a chord of keys signifying a word (or partial word).
To put some of this together, I've used Plover dictionary lookup tool.
From what I've seen, most people take months or years to learn stenotype. I'm (initially) trying to pick it up in a month, with only a short amount of practise at the beginning of each day. Because of this, I'm going to be trying to think about how to speed up the learning process, and a lot of the beginning lessons here are going to be
# EditorConfig is awesome: http://EditorConfig.org | |
# top-most EditorConfig file | |
root = true | |
# Unix-style newlines with a newline ending every file | |
[*] | |
charset = utf-8 | |
indent_style = space | |
indent_size = 2 |