Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Game</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css">
</head>
<body>
function _draw() {
rect(20,50,70,90)
}
let lastMouse ={
x: -1,
y: -1
}
function _init() {
cls()
}
function _draw(time) {
class Seq {
constructor(iterable, transformerGenerator) {
this.iterable = iterable;
this.transformerGenerator = transformerGenerator;
Object.freeze(this);
}
[Symbol.iterator]() {
const cache = this.iterable[Symbol.iterator]();
const transformer = this.transformerGenerator();
#! /bin/bash
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list;
sudo apt-get update && sudo apt-get install yarn;
yarn --version;
@HelveticaScenario
HelveticaScenario / keysOfType.ts
Created March 12, 2020 23:16
A type alias for getting a union of keys of an interface that match a type
type MapKeys<R, T> = {
[P in keyof R]: R[P] extends T ? P : never;
};
type KeysOfType<R, T, IncludeOptional extends boolean = true> = Exclude<
MapKeys<R, IncludeOptional extends true ? T | undefined : T>[keyof R],
undefined
>;
@HelveticaScenario
HelveticaScenario / dbTest.js
Created July 25, 2020 03:02
Demonstation of how sharded db can reduce load
function roundRobin(count, shardCount) {
const shards = new Array(shardCount).fill(0);
function hitShard(shard, key) {
shards[shard]++;
const mod = key % shards.length;
if (mod !== shard) {
hitShard(mod, key);
}
}
let idx = 0;
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Daniel Lewis",
"label": "Software Engineer",
"image": "",
"email": "[email protected]",
"phone": "(512) 971-0073",
"url": "https://helveticascenario.dev",
"summary": "8 years in web development with a focus on UI creating CMS Platforms, I carry strong expertise in React, Redux, Typescript, CSS, and HTML. Outside of work, I enjoy programming creative applications such as game engines, experimental graphics platforms, and tools to aid in the production of electronic music with a myriad of technologies such as Rust, Max/MSP, C/C++, Javascript, Typescript, and Unity.",