Skip to content

Instantly share code, notes, and snippets.

@joeskeen
joeskeen / postinstall-cleanup.ts
Created February 6, 2023 16:58
a script for cleaning up the bloat included in the @pulumi/azure-native package (see https://github.com/pulumi/pulumi-azure-native/issues/1997)
// workaround script to keep TypeScript from crashing in VSCode
// since Pulumi has too big of a package
// run this script after installing NPM packages for infrastructure
// originally created by Ankvi:
// https://github.com/pulumi/pulumi-azure-native/issues/1997#issuecomment-1370835665
import { readdir, rm, writeFile, readFile } from "fs/promises";
import { join } from 'path';
const rootFolder = join(__dirname,'../node_modules/@pulumi/azure-native');
const enumsFolder = join(rootFolder,'types/enums');
@joeskeen
joeskeen / log.txt
Last active February 1, 2023 19:05
BitBucket Pipelines Azure Static Web App Build Failure Log
+ umask 000
+ GIT_LFS_SKIP_SMUDGE=1 retry 6 git clone --branch="main" --depth 50 https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME.git $BUILD_DIR
Cloning into '/opt/atlassian/pipelines/agent/build'...
+ git reset --hard 4c684f2c6785329c62e18489ded3dbaf3f76ac0f
HEAD is now at 4c684f2 fix syntax error
+ git config user.name bitbucket-pipelines
🕊️ 🖼️ 🍇
🖍️🆕isMatch👌
🖍️🆕matchPosition🍬🔢
🖍️🆕matchLength🍬🔢
🆕 🍼isMatch👌 🍼matchPosition🍬🔢 🍼matchLength🍬🔢 🍇🍉
🆕▶️📙 🍇
👎 ➡️ 🖍️isMatch
🤷 ➡️ 🖍️matchPosition
🤷 ➡️ 🖍️matchLength
@joeskeen
joeskeen / Ordering.cs
Created November 22, 2022 18:36
Ordering objects with LINQ
var apples = new[] { new Apple("Red"), new Apple("Blue"), new Apple("Green") };
var oranges = new[] { new Orange(Size.Large), new Orange(Size.Small), new Orange(Size.Medium) };
// works
Console.WriteLine(string.Join(',', apples.OrderBy(x => x)));
// throws InvalidOperationException
Console.WriteLine(string.Join(',', oranges.OrderBy(x => x)));
class Apple : IComparable<Apple>
@joeskeen
joeskeen / ASCII-Webcam.html
Last active March 1, 2026 22:34
A vanilla HTML/CSS/JS implementation of rendering your webcam as ASCII art on a web page (and ability to turn that into a virtual webcam for video calls)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ASCII Webcam</title>
<style type="text/css">
html,
body {
@joeskeen
joeskeen / jest-testing-errors-with-rxjs.ts
Last active January 25, 2023 14:02
Different ways to use Jest to test error cases in Observable streams
import { Observable, firstValueFrom, timer, isObservable, of } from "rxjs";
import { first, timeout, catchError } from "rxjs/operators";
import { TestScheduler } from "rxjs/testing";
describe("testing error cases in Jest", () => {
describe("with RxJS", () => {
/**
* A test utility function for converting an Observable into a Promise for unit tests
* Uses a TestScheduler to make things like the passage of time (timeouts, debounce, etc.)
* happen instantaneously.
@joeskeen
joeskeen / tests.spec.js
Last active May 21, 2025 18:33
Different ways of handling/expecting errors when testing using Jest (both synchronous and asynchronous)
describe("testing error cases in Jest", () => {
describe("errors (vanilla Jest)", () => {
describe("when thrown synchronously", () => {
function synchronousError() {
throw new Error("");
}
it("should require expect(action).toThrow()", () => {
const action = () => synchronousError();
expect(action).toThrow();
@joeskeen
joeskeen / README.md
Last active September 2, 2022 05:30
ng-conf 2022 Hackathon
@joeskeen
joeskeen / Rules.md
Created September 21, 2020 00:58
Barney Family Traditional Ruleset for Mexican Train Dominoes

Mexican Train Dominoes

Barney Family Traditional Ruleset

Objective

To be the player with the least number of points at the end of the game.

Overview

@joeskeen
joeskeen / things.txt
Created May 7, 2020 01:43
Some prompts for playing Game of Things
Things that squirt
Things you shouldn't throw off a building
Things grownups wish they could still do
Things you shouldn't do In public
Things you shouldn't play catch with
Things that go bad
Things you shouldn't lick
Things you would rather forget
Things you Shouldn't swallow
Things that jiggle