Skip to content

Instantly share code, notes, and snippets.

View cherryblossom000's full-sized avatar

Lauren Yim cherryblossom000

View GitHub Profile
@LoganDark
LoganDark / crash-percent.sh
Last active April 1, 2020 03:18
A script that tells you how close most of macOS is to becoming unresponsive. I put this in my PATH.
#!/bin/bash
# macOS Mojave build >18A326g has a nasty issue.
#
# Basically, loginwindow likes threads. It's so passionate about threads that
# it will continue to collect threads endlessly. Now, the problem with such a
# process collecting so many threads is that, as the owner of all processes
# running under your account, if the process crashes, say goodbye to most of
# macOS.
#
# Well, this is exactly what happens. loginwindow freezes at 4096 threads and
@edolstra
edolstra / nix-lang.md
Last active May 22, 2024 19:03
Nix language changes

This document contains some ideas for additions to the Nix language.

Motivation

The Nix package manager, Nixpkgs and NixOS currently have several problems:

  • Poor discoverability of package options. Package functions have function arguments like enableFoo, but there is no way for the Nix UI to discover them, let alone to provide programmatic ways to
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active June 1, 2024 22:47
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).

Type Asset:

  {
    "id": 123123123123,
    "name": "asset_key",
    "type": 1
  }
  • ID: The ID of the asset
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active June 2, 2024 23:53 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@hediet
hediet / main.md
Last active March 11, 2024 15:05
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@gcanti
gcanti / fp-ts-technical-overview.md
Last active March 11, 2024 02:40
fp-ts technical overview

Technical overview

A basic Option type

// Option.ts

// definition
export class None {
  readonly tag: 'None' = 'None'
@wavezhang
wavezhang / java_download.sh
Last active June 3, 2024 02:31
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
@HaleTom
HaleTom / print256colours.sh
Last active May 2, 2024 14:43
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256