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: https://stackoverflow.com/questions/2007662/rollback-to-an-old-git-commit-in-a-public-repo
# Other useful commands
# Show which files were changed
git log --raw
View git_branching.sh
# Simple Branching in Git / Github
# Reference: https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches
# 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
View texWorkflow.md

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
luiarthur / Makefile
Created Sep 28, 2018
Makefile example for running multiple jobs
View Makefile
# RUN ALL THIS IN AN EMPTY DIR!
# Run in parallel
MAKEFLAGS += -j4
# 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
luiarthur / test_Bday.py
Created Sep 19, 2018
Unit tests for Bday.py
View test_Bday.py
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) ])
View Bday.py
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
luiarthur / tmux_local_install.sh
Created Sep 25, 2015 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
View tmux_local_install.sh
#!/bin/bash
# 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
TMUX_VERSION=1.8
You can’t perform that action at this time.