I hereby claim:
- I am dsandler on github.
- I am dsandler (https://keybase.io/dsandler) on keybase.
- I have a public key ASCw2KENtyfAkSs7bbZh6ocwMRSKTOx6K0TZuPbXMMs4xgo
To claim this, I am signing this object:
#!/usr/bin/env python | |
# touchbar_demo.py | |
# dsandler@dsandler.org | |
# PyObjC proof of concept NSTouchBar implementation. | |
# Note that exceptions in the delegates will crash with "Illegal instruction: 4" | |
# rather than printing helpful stack traces; look in CrashReporter for the | |
# exception string. | |
import objc | |
from AppKit import \ |
I hereby claim:
To claim this, I am signing this object:
# 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 |
// 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", |
#!/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") |
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.
# 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 |
# https://en.wikipedia.org/wiki/RC4 | |
# dsandler 2019 | |
class cipher(object): | |
S = None | |
def __init__(this, key): | |
this.key = key | |
this.reset() |
// 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; |
# 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:dsandler@dsandler.org", |