A console for the Web written completely in JavaScript. The console supports Web versions of Linux commands.
A Pen by Andrew M Barfield on CodePen.
| val TEMPLATE = "┏━┓┃ ┃┗━┛".toCharArray().map { it.toString() } | |
| val TEMPLATE2 = listOf("┌", "─", "┒", | |
| "│", " ", "┃", | |
| "┕", "━", "┛") | |
| val TEMPLATE3 = listOf("┌─", "─", "─┒", | |
| "│ ", " ", " ┃", | |
| "┕━", "━", "━┛") | |
| val ASCII = listOf( | |
| "+-", "-", "-+", | |
| "| ", " ", " |", |
| # framestamp.sh | |
| # put the current frame number and elapsed time in the LL corner of a video | |
| # (counts real frames, so vfr input will make the numbers stall from time to time) | |
| if [ -z "$2" ]; then echo "usage: $0 input.mp4 output.mp4"; exit 2; fi | |
| ffmpeg -i "$1" -vf " | |
| drawtext=text='f=%{eif\:n\:d\:4}\ t=%{pts}': x=10: y=h-th-10: | |
| fontcolor=white: fontsize=18: box=1: boxcolor=0x00000099 | |
| " -y "$2" |
| # www/.htaccess | |
| RewriteRule ^[.]well-known/webfinger.*$ /profile/me [L] | |
| # www/profile/.htaccess | |
| Header set Content-Type: application/jrd+json | |
| Header set Access-Control-Allow-Origin: "*" | |
| # www/profile/me | |
| { | |
| "subject": "acct:[email protected]", |
| // https://github.com/malware-dev/MDK-SE/wiki/Text-Panels-and-Drawing-Sprites | |
| // https://steamcommunity.com/app/244850/discussions/0/3158630999987167277/ | |
| IMyTextSurface _drawingSurface; | |
| RectangleF _viewport; | |
| float _minSize; | |
| int _t = 0; | |
| const float TEXT_BOX_SIZE = 20; | |
| const float TEXT_BOX_MARGIN = 2; |
| # https://en.wikipedia.org/wiki/RC4 | |
| # dsandler 2019 | |
| class cipher(object): | |
| S = None | |
| def __init__(this, key): | |
| this.key = key | |
| this.reset() |
| # basic hex dumper | |
| def xxd(data): | |
| s = '' | |
| for i in range(len(data)): | |
| if i % 16 == 0: s += '%08x: ' % i | |
| s += '%02x' % ord(data[i]) | |
| if i % 16 == 15: s += '\n' | |
| elif i % 2 == 1: s += ' ' | |
| return s |
A console for the Web written completely in JavaScript. The console supports Web versions of Linux commands.
A Pen by Andrew M Barfield on CodePen.
| #!/bin/bash | |
| # | |
| # duration - format a time interval | |
| # | |
| # usage: duration [flags] <seconds> | |
| # or: . duration ; format_duration [flags] <seconds> | |
| # | |
| # flags: | |
| # -l: long format ("5 days 1 second") | |
| # -s: short format ("5:00:00:01") |
| // mdcolor.py: https://gist.github.com/dsandler/84440bd15ea7657107adbc9f831a17f4 | |
| // $ python -c 'from json import dumps; from mdcolor import color; print dumps(list(list((tint.name+" "+tint.tint, tint.tohex()) for tint in family) for family in color.values()), indent=2)' | |
| [ | |
| [ | |
| [ | |
| "pink 50", | |
| "#fce4ec" | |
| ], | |
| [ | |
| "pink 100", |
| # Color order: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400, A700. | |
| # Adapted from https://raw.githubusercontent.com/google/material-design-lite/mdl-1.x/src/_color-definitions.scss | |
| import re | |
| class ColorTint(object): | |
| def __init__(self, name, tint, color): | |
| self.name = name | |
| self.tint = tint | |
| self.color = color |