Skip to content

Instantly share code, notes, and snippets.

View suchipi's full-sized avatar
🍊
yummy orange mm yum

Lily Skye suchipi

🍊
yummy orange mm yum
View GitHub Profile
@suchipi
suchipi / gist:287625610a6fc69854ba72b54558cdc2
Created May 8, 2024 20:29
bash "go to repo root" snippet
#!/usr/bin/env bash
# This isn't 100% foolproof, but it's probably good enough for random scripts in your git repo
THIS_FILE="$BASH_SOURCE"
THIS_DIR=$(dirname "$THIS_FILE")
ROOT_DIR=$(realpath "$THIS_DIR/..")
cd "$ROOT_DIR"
@suchipi
suchipi / haruhi episode order.txt
Created October 1, 2022 05:45
tired of having to look this up every time
There are a few different orders:
Kyon order: Season 1's broadcast order
Haruhi order: Season 1's chronological order
Season 2: Season 2's chronological order
Chronological order: Season 1 and 2 mixed together in chronological order.
Bluray/DVD release orders, which are slight variations on these.
As Kyon/Haruhi orders only include Season 1 episodes, Season 2 is usually watched afterwards.
(function() {
var global = (
typeof globalThis !== "undefined" ? globalThis :
typeof global !== "undefined" ? global :
typeof window !== "undefined" ? window :
typeof self !== "undefined" ? self :
typeof this === "object" ? this :
new Function("return this")()
);
#!/usr/bin/env suchibot
import { Keyboard, Key, record, Tape, isMouseEvent } from "suchibot";
let tape: Tape | null = null;
Keyboard.onUp(Key.SCROLL_LOCK, () => {
if (tape && tape.isRecording) {
tape.stop();
console.log("Stopped recording");
} else {
@suchipi
suchipi / MaybeFruit.js
Created December 16, 2018 04:42
Tagged Unions in Flow
// @flow
type NoneType = {|
type: 'None',
|};
type AppleType<AppleInner> = {|
type: 'Apple',
value: AppleInner,
|};
type BananaType = {|
type: 'Banana',
@suchipi
suchipi / pkg.sh
Last active January 30, 2019 16:10
Pacman alias function
pkg() {
case "$1" in
list)
# List all installed packages
command pacman -Q
;;
list-roots)
# List all installed packages that aren't required by anything
command pacman -Qet
;;

with es2015 modules, every file can export both "named exports" and a "default export". But the "default export" is just an export with the name "default". To do a named export, you can do:

const foo = 5;
function bar() {}
class Baz {}
export { foo, bar, Baz };
// or
export const foo = 5; // uses the name of the variable declaration
export function bar() {} // uses the name of the function
@RegexHelpers =
# matches colors like #ffffff, #eee, rgb(255,255,255), and rgba(255, 255, 255, 0.25)
cssColorMatchString: '(?:#(?:[0-9a-f]{6}|[0-9a-f]{3}))|(?:rgba?\\((?:\\d+, *){2,3}(?:\\d+(?:\\.\\d+)?)\\))'
makeTagRegex: (tagName, attributeMatch=".*") ->
# matches:
# <tagName attribute>content</tagName>
# [tagName: attribute]content[/tagName]
# <tagName = attribute>content</tagName>
# <tagName>content</tagName>