Skip to content

Instantly share code, notes, and snippets.

View sliminality's full-sized avatar

Slim sliminality

View GitHub Profile
@sliminality
sliminality / cell0.js
Last active December 18, 2025 00:56
nested promises example
///Problems with nested Promises: very easy to **forget to return**, thus breaking the Promise chain\\- No arrow functions yet, must explicitly return each time//- People are accustomed to line starting with **doC(…)** from CPS. Nesting Promises is **structurally similar** to CPS, but error handling only works at the top level!
doA()
.then(function (a) {
doB() ///_⚠ Missing __**return**_
.then(function (b) {
doE()
doC(a, b) ///_⚠ Missing __**return**_
})
})
.then(function (d) { window.alert("Success: " + d) })
@sliminality
sliminality / custom.css
Created December 13, 2025 03:02
Custom CSS to make Beeper look more like Texts.com
/*
# Custom Beeper.app style
This file will be injected as a <style> tag
After making your changes, type "Reload custom CSS" in the command bar
To open dev tools, open the command bar and type "open console"
*/
:root {
/*
--font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
@sliminality
sliminality / baseball.md
Created July 5, 2025 21:09
Resources for following baseball after OPLSS 2025

Post-OPLSS baseball resources

Most of these will be about Major League Baseball (MLB), the primary baseball organization in the United States.

Getting started

The following posts by Reddit user /u/cardith_lorda are very helpful when getting started:

@sliminality
sliminality / hide_code.py
Last active August 5, 2019 21:00
jupyter stuff
def hide_code():
from IPython.display import HTML
from IPython.display import display
# Taken from https://stackoverflow.com/questions/31517194/how-to-hide-one-specific-cell-input-or-output-in-ipython-notebook
tag = HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.cell.code_cell.rendered.selected div.input').hide();
@sliminality
sliminality / dependencies.ts
Last active February 4, 2020 05:50
Collection of useful TypeScript tricks
/**
* Script to extract dependency graph from a codebase with an entry point.
*/
import {
createCLICommand,
startIfMain,
runCommand,
createFlagMap,
t,
<style id="jsbin-css">
:root {
--color-dark: #333030;
--color-dark-grey: #9e9e9e;
--color-grey: #bec6ce;
--color-red: #f7b9b9;
--color-purple: #e0c6f4;
--color-blue: #bae2f4;
--color-yellow: #fcf8a4;
@sliminality
sliminality / erasing.md
Last active July 9, 2019 19:18
adventures in Flow typing

Erasing properties from objects

export type LearningTimeInfo = $ReadOnly<{|
    // The number of seconds offset from the learner UTC time to their
    // local time, to allow for in/out school detection.
    localTimeOffsetSeconds: {offsetSeconds: number},

    // The full URL.  Intended for debugging/human-readability.  Code
    // should not be analyzing this field to do things! -- instead we
@sliminality
sliminality / simple.tex
Created November 19, 2018 19:36
Simple document template for LaTeX
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in,top=1.25in,headsep=0.25in]{geometry}
\usepackage{fancyhdr}
\title{Final Project Prospectus, HUM 325}
\author{Sarah Lim}
\date{February 2017}
\makeatletter
@sliminality
sliminality / puz.md
Created November 14, 2018 06:40
Documentation for the Across Lite *.puz format, reformatted from https://code.google.com/archive/p/puz/wikis/FileFormat.wiki
@sliminality
sliminality / pencilMode.js
Last active November 13, 2018 19:43
bind Ctrl-P to toggle pencil mode on and off in the NYT Crossword app
// make a bookmarklet here: https://mrcoles.com/bookmarklet/
const listener = ({key, ctrlKey}) => {
if (ctrlKey && key === 'p') {
$r.store.dispatch({
type: 'TOGGLE_PENCIL_MODE',
});
}
};