Skip to content

Instantly share code, notes, and snippets.

Arthur Lui luiarthur

Block or report user

Report or block luiarthur

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View git-revert-and-save-history
git checkout [revision] .
# where [revision] is the commit hash (for example: 12345678901234567890123456789012345678ab).
# Don't forget the . at the end, very important.
# See:
# Other useful commands
# Show which files were changed
git log --raw
# Simple Branching in Git / Github
# Reference:
# Before creating a new branch, pull the changes from upstream.
# Your master needs to be up to date.
# Create new branch
git checkout -b myNewBranch

My LaTeX Workflow

Option I (VS Code)

  • Use the VS Code editor
    • Install the LaTeX Workshop Editor from VS Code [Marketplace][1]
    • Install the listed requirements
    • Install the listed Spell checker
    • Install VIM plugin
    • Auto-build LaTeX pdf on save
    • View pdf in VS Code tab
luiarthur / Makefile
Created Sep 28, 2018
Makefile example for running multiple jobs
View Makefile
# Run in parallel
# Simulation variables.
MSG = "Hello"
PARAMS := 100 1000 10000
#PARAMS := $(shell seq 1 10) # or something like this for params = 1, 2, ..., 10
SIMS := $(addprefix sim, $(PARAMS))
luiarthur /
Created Sep 19, 2018
Unit tests for
import unittest
import Bday
from Bday import daysInYear
import numpy as np
def logProbNoRepeatedBday(n:int):
return sum([ np.log(i/daysInYear) for i in range(daysInYear-n+1, daysInYear+1) ])
import numpy as np
from calendar import monthrange
daysInYear = 365
monthsInYear = 12
year = 2018
def monthlyToDailyProbs(monthlyProbs=np.ones(monthsInYear), year=year):
assert len(monthlyProbs) == monthsInYear
dailyProbs = []
luiarthur /
Created Sep 25, 2015 — forked from ryin/
bash script for installing tmux without root access
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
You can’t perform that action at this time.