This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This Tuple type (and tuple() function) is a hack to induce | |
// TypeScript to infer tuple types rather than array types. (Source: | |
// https://github.com/microsoft/TypeScript/issues/27179#issuecomment-422606990) | |
// | |
// Without it, [123, 'hi', true] will often get the type (string | | |
// number | boolean)[] instead of [number, string, boolean]. | |
// | |
export type Tuple = any[] | [any]; | |
export const tuple = <A extends Tuple>(... args: A) => args; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 58.675916] dhdpcie_resume_dev: Enter | |
[ 58.677482] dhdpcie_send_mb_data: H2D_MB_DATA: 0x00000010 | |
[ 58.677734] dhdpcie_send_mb_data: send H2D_HOST_D0_INFORM to dongle | |
[ 58.678145] dhd_runtimepm_state : runtime resume ended | |
[ 59.037968] lpass_get_sync: i2s (use:1) | |
[ 59.040822] i2s_startup : pri -- | |
[ 59.040853] i2s_startup : pri -- | |
[ 59.040870] dma_open: prtd = ffffffc8743200c0 | |
[ 59.040894] lucky-audio sound: lucky_aif_startup | |
[ 59.040910] lucky-audio sound: codec_dai: moon-aif1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Per cbd, "SS310 modem", "shannon310". This is a Samsung Galaxy S7 SM-G930F. | |
# ["/sbin/cbd", "-d", "-tss310", "-bm", "-mm", "-P", "platform/155a0000.ufs/by-name/RADIO"] | |
boot0_path = '/dev/umts_boot0' | |
firmware_partition = '/dev/disk/by-partlabel/RADIO' ## maps to /dev/sda8 on my phone | |
nv_data_path = '/efs/nv_data.bin' ## mount /dev/disk/by-partlabel/EFS (/dev/sda3 for me) on /efs | |
import cffi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import gh | |
import os | |
import json | |
if len(sys.argv) > 1: | |
username = sys.argv[1] | |
else: | |
raise Exception('Expected github username as first command-line argument') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple Canonical S-Expression codec. | |
# https://people.csail.mit.edu/rivest/Sexp.txt | |
# Apache v2 Licenced. Copyright 2018-2019 Tony Garnock-Jones | |
import base64 | |
import zlib | |
try: | |
unicode | |
except NameError: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
;; Use Racket 7.3 or later; in particular, 7.0.0.7 seems to have a bug | |
;; where call-with-immediate-continuation-mark seems to dig past the | |
;; first continuation frame when it isn't supposed to. | |
(module+ test (require rackunit)) | |
(module state-machine racket | |
(provide state-machine | |
state-lambda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
;; Exploration of `replace-evt` in the context of getting a reliable | |
;; signal that a complete frame of input is available. | |
(module+ test (require rackunit)) | |
;; Imagine a protocol, based on a TCP socket, where every two adjacent | |
;; bytes sent by the server are to be treated together. That is, | |
;; fixed-size two-byte framing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang imperative-syndicate | |
;; Compare to "ezd" clock-face example from: J. F. Bartlett, “Don’t | |
;; Fidget with Widgets, Draw!,” Palo Alto, California, DEC WRL | |
;; Research Report 91/6, May 1991. | |
(require lang/posn) | |
(require 2htdp/image) | |
(require (only-in racket/math pi)) | |
(require racket/date) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/base | |
;; TODO: classifiers and views | |
(require racket/match) | |
(require racket/stxparam) | |
(require (for-syntax racket/base)) | |
(define-syntax-parameter self | |
(lambda (stx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import datetime | |
import preserves | |
import queue | |
import asyncio | |
import random | |
from preserves import Record, Symbol | |
Assert = Record.makeConstructor('Assert', 'endpointName assertion') | |
Clear = Record.makeConstructor('Clear', 'endpointName') |