Skip to content

Instantly share code, notes, and snippets.

@charmsRace
charmsRace / dip-bio.md
Last active March 16, 2024 16:12
Serendipity Rivera Reference Doc

Serendipity "Dip" Rivera

Mischievous, Capricious, Uncannily Lucky Bunny

At Game Start

Serendipity "Dip" Rivera is young, somewhat hapless young rabbit girl, initially of no prominent skills or abilities. However, throughout her life, she's been blursed with inscrutable, capricious luck & an uncanny affinity for synchronicities. She's equal parts klutz & space-cadet, and is prone to acting impulsively to follow her wandering attention — often it's blind chance and the whims of fate alone that carry her through tense situations.

Physically, Dip is a slight, spry, & lively anthro rabbit, sporting a light summer coat of gray fur & a tufted tail to match. She comes up just shy of 4'6" (if you count the ears), and considers herself the fastest runner in West Village as a matter of course.

@charmsRace
charmsRace / use-upload.ts
Created May 3, 2022 14:01
A hook to trigger a single-select file upload prompt.
/**
* A hook to trigger a file upload prompt. Single-select for now.
*
* @example Stateful file access
* ```
* const [file, setFile] = useState<File | null>(null);
* const uploadFile = useUpload(setFile, () => setFile(null));
* ```
*/
const useUpload = (onUpload: (file: File) => void, onFailure?: () => void) => {
@charmsRace
charmsRace / time-zone-conversion.tex
Last active May 21, 2020 20:52
Time Zone Conversion Quick Reference (LaTeX source)
% Rendered with https://quicklatex.com/
\begin{align*}
\text{(UTC offset)\ \ }\Delta_{Z} := t_{Z} - t_{\textrm{UTC}} \\
\text{So\ } \forall Z_{i},\ \ t_{Z_{1}} - \Delta_{Z_{1}} = t_{Z_{2}} - \Delta_{Z_{2}}
\end{align*}
\begin{align*}
&\text{e.g.\indent}\textrm{JST} \to \textrm{EDT} \\
t_{\textrm{EDT}} &= t_{\textrm{JST}} - \Delta_{\textrm{JST}} + \Delta_{\textrm{EDT}} \\&= t_{\textrm{JST}} - (+9) + (-4) \\
&= t_{\textrm{JST}} - 13
\end{align*}
@charmsRace
charmsRace / example.svg
Created April 19, 2020 17:57
SVG XML Example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@charmsRace
charmsRace / are-anagrams.ts
Last active June 7, 2019 05:06
A coding exercise to determine whether two strings are anagrams (in functional style).
const areAnagrams = (first: string, second: string) => {
if (first.length !== second.length) {
return false;
}
const [letters1, letters2] = [first, second].map(string =>
string.toLowerCase().split('')
);
// This criterion isn't part of the traditional definition of anagrams;
@charmsRace
charmsRace / .block
Last active May 14, 2019 21:43
Demand Scoring Sankey
license: mit
@charmsRace
charmsRace / .block
Last active May 8, 2019 15:53
Sankey diagram using a csv file with v4
license: mit
@charmsRace
charmsRace / .block
Last active May 7, 2019 22:36
Sankey diagram using a csv file with v4
license: mit
@charmsRace
charmsRace / .block
Last active January 23, 2019 21:49
The Force with React + D3, Approach #3
license: mit