Skip to content

Instantly share code, notes, and snippets.


Arthur Lui luiarthur

View GitHub Profile
luiarthur / hello-server.R
Created Sep 16, 2020
Hello in R -- Server demo
View hello-server.R
for (i in 1:100) {
current_time = format(Sys.time(),usetz = TRUE)
cat(current_time, "|", "Iteration", i, "|", "Hello!", "\n")
luiarthur / GP_turing_example.ipynb
Last active Jul 16, 2020
Example of how to fit a full GP model in Turing.
View GP_turing_example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
luiarthur /
Created Jul 11, 2020
Install tmux without root permissions
# Installing TMUX without root permissions on LINUX machines is now as east as this:
# Get the app image from tmux3 git repo.
# Grant execute permissions.
chmod +x tmux-3.0a-x86_64.AppImage
# Move to ~/bin
mv tmux-3.0a-x86_64.AppImage ~/bin
luiarthur /
Created Jul 10, 2020
Make image for stick-breaking process
import numpy as np
import matplotlib.pyplot as plt
n = 5
a = 3
lw = 10
stick_length = 1
luiarthur /
Last active Jun 5, 2020
Merge and squash a git branch
# Say you are working on a branch called `my-branch`
# and you wish to now merge it into `master`, and
# squash all commits from `my-branch` into one commit.
# You can do the following:
git checkout master
git merge --squash my-branch
git commit
# You will then be placed in an editor with all your previous
# Go to master branch (if needed)
git checkout master
# Look around
git remote -v
# Add upstream repo of the fork (if needed)
git remote add upstream <ssh-or-https-url-to-original-repo>
# Look around again
luiarthur / git-rebase-tutorial
Last active May 11, 2020
git rebase (squashing several commits)
View git-rebase-tutorial
# How to squash several commits into one big commit
See this also:
1. Inspect the previous commits to see where you want to place the last commit
git log --oneline
2. Rebase
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
You can’t perform that action at this time.