Skip to content

Instantly share code, notes, and snippets.

View dicksontsai's full-sized avatar

Dickson Tsai dicksontsai

View GitHub Profile
@dicksontsai
dicksontsai / justone.txt
Created July 7, 2022 00:17
Just One word list
// From google-10000-english-usa-no-swears-medium.txt but curated.
const cards = [
["company", "fortune", "booth", "injury", "guard"],
["viral", "simpson", "bacon", "warrior", "frame"],
["drain", "nursery", "track", "sombrero", "spread"],
["period", "table", "arcade", "drunk", "plaza"],
["storm", "postal", "grammar", "rhythm", "lunch"],
["arrow", "spongebob", "category", "jewelry", "tuition"],
["science", "grain", "tulip", "investor", "movement"],
["spotify", "lobby", "chemical", "weekend", "crane"],
@dicksontsai
dicksontsai / focus_timer.sh
Created December 7, 2020 09:14
Website-Blocking Timer on MacOS
# Programming Life Hacks #1: Website-Blocking Focus Timer
# Copyright (c) 2020 Dickson Tsai
# Follow along on my Youtube: https://youtu.be/kCo9DAuLGX4
# Disclaimer: This file is primarily for teaching purposes.
# 1. USE THIS SOLUTION AT YOUR OWN RISK. sudo is always risky to use.
# 2. Not the most idiomatic bash/zsh, but it works for me.
# General procedure
# 1. Setup website blocking
@dicksontsai
dicksontsai / print_dates.py
Created August 11, 2019 07:48
Simple script to print all dates of a month in "2006/01/02 (Mon)" format. Perfect for a monthly diary doc.
#!/usr/bin/env python3
from datetime import datetime, timedelta
import sys
USAGE = """
Print dates from the given start day to the end of the day's month.
Usage: print_dates.py yyyy/mm/dd
"""
@dicksontsai
dicksontsai / main.go
Created September 21, 2018 16:43
Golang embedded structs
package main
import (
"fmt"
)
// Golang Struct Embeddings
// General rule: If something is not visible in the current struct, forward
// to an embedded struct. The order of the embedding does not matter, so it's
// possible to have ambiguous selectors (Golang doesn't know which struct to