This file contains hidden or 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
type Token = | |
| {type: "slash"; text: "/"} | |
| {type: "whitespace"; text: string} | |
| {type: "reason-delimiter"; text: ":"} | |
| {type: "reason"; text: string} | |
| {type: "operator"; text: "+" | "-"} | |
| {type: "roll"; text: string; sides: number; count: number}; | |
export function lex(raw: string): Token[] | undefined { | |
if (!raw.startsWith("/")) { |
This file contains hidden or 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
/** | |
* Creates a corner rect. | |
* | |
* `Rect` has slightly different semantics and isn't as suitable for inclusive | |
* `GridPoint` rectangles like were dealing with here. | |
*/ | |
function createGridAlignedRect( | |
position: GridPoint, | |
width: number, | |
height: number |
This file contains hidden or 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
commit 1fea5d213b25f7bf8a9bef405ef2e4a22bd2dfa3 | |
Author: itsjohncs <[email protected]> | |
Date: Tue Nov 2 01:27:12 2021 -0700 | |
wip | |
diff --git a/client/components/Message.vue b/client/components/Message.vue | |
index 4b3e5887..d6627a8f 100644 | |
--- a/client/components/Message.vue | |
+++ b/client/components/Message.vue |
This file contains hidden or 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 bash | |
set -euo pipefail | |
mapfile -t RESULT < <( | |
xargs -0r printf "%s\n" | | |
git check-ignore --non-matching --stdin --verbose | | |
grep "^::" | | |
cut -c 4- | |
) |
This file contains hidden or 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
type Point = [number, number] & {__brand?: any}; | |
type GridPoint = Omit<Point, "__brand"> & {__brand?: "GridPoint"}; | |
type PixelPoint = Omit<Point, "__brand"> & {__brand?: "PixelPoint"}; | |
const point: Point = [1, 2]; | |
const gridPoint: GridPoint = [1, 2]; | |
const pixelPoint: PixelPoint = [1, 2]; | |
// Points receive all |
This file contains hidden or 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
function gn { | |
printf 'Copied "' | |
( git ls-files -m; git ls-files -o ) | head -n 1 | tr -d '\n' | tee >(pbcopy) | |
printf '"\n' | |
} |
This file contains hidden or 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
// If all of Candidate's properties also exist in Model, this will be | |
// equivalent to Model. However, if Candidate has extra properties, they will | |
// be retyped to never and then merged into the resulting type. | |
// | |
// >>> ExclusivelyModel<{}, {a: number}> | |
// ... {a: number} | |
// >>> ExclusivelyModel<{a: number, b: number}, {a: number}> | |
// ... {a: number, b: never} | |
// >>> ExclusivelyModel<{a: string, b: number}, {a: number}> | |
// ... {a: number, b: never} |
This file contains hidden or 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 | |
import re | |
import sys | |
import os | |
import_re = re.compile(r'^(import .*|}) from "(\.\.?/[^"]+)";?$', re.MULTILINE) | |
target_file = sys.argv[1] |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
let _openCVPromise = null; | |
function getOpenCV() { | |
if (_openCVPromise === null) { | |
_openCVPromise = new Promise(function(resolve, reject) { | |
const script = document.createElement("script"); |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Solarized (light)</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>name</key> |
NewerOlder