Skip to content

Instantly share code, notes, and snippets.

View icorbrey's full-sized avatar
πŸ“Ή
And we're live!

Isaac Corbrey icorbrey

πŸ“Ή
And we're live!
View GitHub Profile
import { writable } from 'svelte/store'
export const reducible = (reducer, initialState) =>
{
const { subscribe, update } = writable(initialState)
const dispatch = action =>
update(state => reducer(state, action))
return {

Project Flow

  • Code is stored on a primary branch master, with no develop branch.
  • Issues
    • Roadmaps
      • Created with title vX.Y.Z
      • Gets the tag #roadmap
      • Gets a milestone of the same name
      • Current roadmap should be pinned
  • Features
declare var _screen: Screen & {
queryByRole: (role: string, options: { name: string }) => HTMLElement
queryByTestId: (testId: string) => HTMLElement
}
declare var fireEvent: {
click: (element: HTMLElement) => void
type: (element: HTMLElement, text: string) => void
}
type LocaleStrings<K extends string> = {
[key in K]: string
}
type LocaleArea<A extends string, S extends string | number> = {
[K in `@${A}/${S}`]: string
}
const area = <A extends string, K extends string>(area: A, strings: LocaleStrings<K>): LocaleArea<A, K> =>
Object.keys(strings)
@icorbrey
icorbrey / timer.cpp
Created September 2, 2021 13:08
High resolution timer for algorithm development
#include "timer.hpp"
using namespace std;
using namespace std::chrono;
timer::timer()
{
this->hasRun = false;
this->start = high_resolution_clock::now();
}
#!/bin/bash
compare='dev'
min_commits_ahead=5
max_commits_behind=500
max_time_elapsed="$((30 * 24 * 60 * 60))"
git fetch origin 2> /dev/null
branches="$(\
git remote show origin \
/**
* Generates a hash code from the given string using the `cyrb53` hashing
* algorithm.
*
* @param {string} str
* @param {number=} seed
*/
export const hashCode = (str, seed = 0) => {
let h1 = 0xdeadbeef ^ seed;
export type Option<T> = {
unwrap: (message?: string) => T
match: <R>(matchers: OptionMatchers<T, R>) => R
}
type OptionMatchers<T, R> = {
onSome: (value: T) => R
onNone: () => R
}
@icorbrey
icorbrey / TicTacToe.cs
Created October 3, 2023 19:24
A playable game of Tic Tac Toe in the terminal. Written in C#.
#pragma warning disable CS8524
string[] TEMPLATES = {
"┏━━━┱───┬───┐\n┃ A ┃ B β”‚ C β”‚\n┑━━━╃───┼────\nβ”‚ D β”‚ E β”‚ F β”‚\nβ”œβ”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”€\nβ”‚ G β”‚ H β”‚ I β”‚\nβ””β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”˜", // (1, 1) selectedTile
"β”Œβ”€β”€β”€β”²β”β”β”β”±β”€β”€β”€β”\nβ”‚ A ┃ B ┃ C β”‚\nβ”œβ”€β”€β”€β•„β”β”β”β•ƒβ”€β”€β”€β”€\nβ”‚ D β”‚ E β”‚ F β”‚\nβ”œβ”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”€\nβ”‚ G β”‚ H β”‚ I β”‚\nβ””β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”˜", // (2, 1) selectedTile
"β”Œβ”€β”€β”€β”¬β”€β”€β”€β”²β”β”β”β”“\nβ”‚ A β”‚ B ┃ C ┃\nβ”œβ”€β”€β”€β”Όβ”€β”€β”€β•„β”β”β”β”©\nβ”‚ D β”‚ E β”‚ F β”‚\nβ”œβ”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”€\nβ”‚ G β”‚ H β”‚ I β”‚\nβ””β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”˜", // (3, 1) selectedTile
"β”Œβ”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”\nβ”‚ A β”‚ B β”‚ C β”‚\n┒━━━╅───┼────\n┃ D ┃ E β”‚ F β”‚\n┑━━━╃───┼────\nβ”‚ G β”‚ H β”‚ I β”‚\nβ””β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”˜", // (1, 2) selectedTile
"β”Œβ”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”\nβ”‚ A β”‚ B β”‚ C β”‚\nβ”œβ”€β”€β”€β•†β”β”β”β•…β”€β”€β”€β”€\nβ”‚ D ┃ E ┃ F β”‚\nβ”œβ”€β”€β”€β•„β”β”β”β•ƒβ”€β”€β”€β”€\nβ”‚ G β”‚ H β”‚ I β”‚\nβ””β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”˜", // (2, 2) selectedTile
"β”Œβ”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”\nβ”‚ A β”‚ B β”‚ C β”‚\nβ”œβ”€β”€β”€β”Όβ”€β”€β”€β•†β”β”β”β”ͺ\nβ”‚ D β”‚ E ┃ F ┃\nβ”œβ”€β”€β”€β”Όβ”€β”€β”€β•„β”β”β”β”©\nβ”‚ G β”‚ H β”‚ I β”‚\nβ””β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”˜", // (3, 2) selectedTile
"β”Œβ”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”\nβ”‚ A β”‚ B β”‚ C β”‚\nβ”œβ”€β”€β”€β”Όβ”€β”€β”€β”Όβ”€β”€β”€β”€\nβ”‚ D β”‚ E β”‚ F β”‚\n┒━━━╅───┼────\n┃ G ┃ H β”‚ I β”‚\nβ”—β”β”β”β”Ήβ”€β”€β”€β”΄β”€β”€β”€β”˜", // (1, 3) selectedTile
; # Home Row Mods
;
; See: <https://precondition.github.io/home-row-mods>
;
; ## Layout
;
; This script uses the GASC ordering, or GUI - Alt - Ctrl - Shift.
;
; Key: Mod/Tap
;