View myrepl.mjs
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 tty from 'tty' | |
import { emitKeypressEvents } from 'readline'; | |
let drain; | |
process.stdout.on('drain', () => { drain() }); | |
const waitForDrain = () => new Promise(r => {drain = r}); | |
function waitForDrainify(func) { | |
return async (...args) => { | |
if (!func(...args)) { | |
await waitForDrain(); |
View endless-sky emscripten progress
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
# Starting with Ubuntu 18.04.3 (LTS) x64 | |
# I'm using a local VMwareFusion vm instead of Docker or something because I want to be able to test with a video device. | |
# New install | |
# (not shown) make account, enable ssh, add vm to /etc/hosts | |
ssh vm | |
apt-get update | |
sudo apt install git | |
git clone https://github.com/endless-sky/endless-sky.git |
View invalidation.js
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
// Find deepest DOM ancestor that does not change on reexecute | |
const findParentOutputDiv = (el) => { | |
let candidate = el; | |
while (candidate) { | |
candidate = candidate.parentElement | |
if (candidate.className === 'output') { | |
return candidate; | |
} | |
} | |
throw Error("parent output div not found"); |
View cell_invalidation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View browserCanvasCtxFill.html
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
<html> | |
<body> | |
<canvas id="canvas1" width="200" height="200"></canvas> | |
<canvas id="canvas2" width="200" height="200"></canvas> | |
<canvas id="canvas3" width="200" height="200"></canvas> | |
<script> | |
var canvases = [canvas1, canvas2, canvas3] | |
var fillArgs = [undefined, 'evenodd', 'nonzero'] |
View Main.elm
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
module Main exposing (..) | |
type alias HasXAndY a = | |
{ a | x : Float, y : Int } | |
type alias HasX a = | |
{ a | x : Float } |
View composition.py
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
from typing import Callable | |
class A: pass | |
class B: pass | |
class C: pass | |
def composition(aToB: Callable[[A], B], | |
bToC: Callable[[B], C]) -> Callable[[A], C]: | |
"""Returns a callable that takes an A and returns a C""" |
View gist:f72c2a4ca5dba8d1b38db33458962ef1
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
a simple remix file format | |
Files are always UTF-8 | |
a syntax like | |
episode <episode query> of <podcast url> | |
play from <time> to <time> [at 2x speed] [at +12 dB] | |
example: |
View justnumbers.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View openedByPython.log
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
tomb@localhost:~$ strace python myPythonScript.py 2>&1 >/dev/null | grep open | grep -v ENOENT | grep -o '".*"' | grep -v '\.pyc' | |
"/etc/ld.so.cache" | |
"/lib/x86_64-linux-gnu/libpthread.so.0" | |
"/lib/x86_64-linux-gnu/libc.so.6" | |
"/lib/x86_64-linux-gnu/libdl.so.2" | |
"/lib/x86_64-linux-gnu/libutil.so.1" | |
"/lib/x86_64-linux-gnu/libz.so.1" | |
"/lib/x86_64-linux-gnu/libm.so.6" | |
"/usr/lib/python2.7/site.py" | |
"/usr/lib/python2.7/os.py" |
NewerOlder