Skip to content

Instantly share code, notes, and snippets.

View leebyron's full-sized avatar
🌎

Lee Byron leebyron

🌎
View GitHub Profile

Languages have various allowances for white-space. This is a short exploration of parsers I found and what they claim to accept

Key

Oct  Dec Char  Hex  Key Esc
\000   0  NUL  \x00  ^@ \0 (Null byte)
\010   8   BS  \x08  ^H \b (Backspace)
\011   9   HT  \x09  ^I \t (Horizontal tab)
\012  10   LF  \x0A  ^J \n (Line feed)  (Default UNIX NL)
@leebyron
leebyron / latlong.pde
Created May 29, 2011 03:50
conversions from Lat/long to 2d map projections - for Processing
/**
* A collection of functions responsible for performing translations between
* longitude/latitude coordinates and points on a 1/1 square
* (which you could then map to pixelspace)
*
* @author leebyron
*/
/**
* lon double x coordinate in radians [-PI,PI)
@leebyron
leebyron / sort-keys.js
Created January 30, 2017 21:42
Sort values by key order performance
var keys = [];
var results = [];
var keyCount = 100;
var iterations = 10000;
//generate keys 0 to <keycount>
for (var i=0; i < keyCount; i++) {
keys.push(i);
results.push({ id: i })
}
@leebyron
leebyron / input-union-meeting-2020-5-28.md
Created May 28, 2020 18:54
Input Union Meeting 2020/5/28
@leebyron
leebyron / GraphQL May2021 Changelog.md
Last active May 26, 2021 21:05
GraphQL May2021 Changelog

May2021 Changelog

This describes the set of changes since the last edition of the GraphQL specification, June2018. It's intended to ease the review of changes since the last edition for reviewers or curious readers, but is not normative. Please read the specification document itself for full detail and context.

Authors

type HasFoo = { kind: "Foo" }
type HasBar = { kind: "Bar", baz: string }
class Other {
baz = "cool"
}
function hasBar(obj: HasFoo | HasBar | Other): boolean %checks {
return obj instanceof Other
var children = []
for (var key in terms) {
if (terms.hasOwnProperty(key)) {
children.push(
<React.Fragment key={key}>
<dl>{key}</dl>
<dd>{terms[key]}</dd>
</React.Fragment>
)
}
@leebyron
leebyron / graphql-tsc-initial-terms.js
Created November 5, 2020 18:48
Assigning terms for initial GraphQL TSC members
// Initial members of the TSC
const members = [
"andimarek",
"benjie",
"dschafer",
"ivangoncharov",
"jbaxleyiii",
"mjmahone",
"nyteshade",
"robzhu",
Options +FollowSymlinks
RewriteEngine on
# No intersticial for direct reference and self-reference
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://box.leebyron.com/.*$ [NC]
# Add a line item for every website you don't need an intersticial for
# I've added my own website, gmail and facebook
RewriteCond %{HTTP_REFERER} !^http(s)?://([^\.]*.)?leebyron.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://mail.google.com/.*$ [NC]
@leebyron
leebyron / PriorityQueue.js
Last active January 28, 2019 05:08
PriorityQueue.js uses a binary heap to ensure the highest priority item is always available to dequeue, and sorts on enqueue. A dynamically resizing Array can be used to model the binary heap, for a simpler and more efficient implementation.
/**
* For compare function return:
* - Less than zero: item1 has higher priority than item2.
* - Zero: same.
* - Greater than zero: item1 has lower priority than item2.
*/
export type CompareFunction<T> = (item1: T, item2: T) => number;
export class PriorityQueue<T> {
_items: Array<T>;