Skip to content

Instantly share code, notes, and snippets.

doing things

Samuel Lijin sxlijin

doing things
View GitHub Profile
Helsingør, Espergærde, Humlebæk, Nivå, Vedbæk, Østerport, Nørreport, København H

Jan Łukasiewicz, Wacław Sierpiński, Paul Erdős, Évariste Galois

Andrey Nikolaevich Kolmogorov (Russian: Андрей Николаевич Колмогоров)
Pafnuty Lvovich Chebyshev (Russian: Пафну́тий Льво́вич Чебышёв)
Aleksandr Mikhailovich Lyapunov (Russian: Алекса́ндр Миха́йлович Ляпуно́в)
Grigori Yakovlevich Perelman (Russian: Григо́рий Я́ковлевич Перельма́н)
Georgy Feodosevich Voronoy (Ukrainian: Георгій Феодосійович Вороний)
sxlijin /
Last active Dec 12, 2019
Portable nighttime sports field lighting setup

Portable outdoor nighttime sports field lighting setup

Ocean Beach pickup ultimate in SF uses the below described setup for nighttime beach frisbee games.

Regulation fields are 150' x 90', ours is probably slightly smaller.

We get 90+ min (probably 2h+) of playtime out of this setup (batteries can be upgraded if you want more time).

Bill of Materials (v2)

sxlijin /
Last active Feb 2, 2017
Bring up an Arch system from live disk.
set -e
sfdisk /dev/sda <<EOF
/dev/sda1 : start=2048, size=2048, type= 4, bootable
/dev/sda2 : start=4096, type=20
mkfs.ext4 /dev/sda2
sxlijin / repeat-command-while-dir-changes.bash
Created Dec 25, 2016
monitor a directory tree with inotifywait, repeat a command when anything in the tree changes
View repeat-command-while-dir-changes.bash
REPEAT_ON_CHANGES="./node_modules/.bin/webpack --progress"
inotifywait -m --exclude '\..*.swp' -e MODIFY -r $WATCH_DIR | \
while true
sleep 0.1
(e=false; while read -t 0.1 d; do echo $d; export e=true ; done; $e) \
sxlijin /
Created Dec 7, 2016
Parse scraped VOICE data into CSVs for analysis.
#!/usr/bin/env python3
from glob import glob as ls
import statistics
import itertools as it
import re
def expand(field):
field = ((index + 1, freq)
for (index, (_, freq))
sxlijin / scrape-voice-survey-data.bash
Created Dec 7, 2016
Scrapes the VOICE survey data submitted by students.
View scrape-voice-survey-data.bash
VUNETID="put your vunetid here"
VUNETPW="put your vunetid password here"
# login
curl \
-d VSASM_ASVBlock=425457605464733D246C743F77706A6466776A66782F716D3D2477743F425457604E6675693D246C743F4D4D4542513D2477743F42545760516275693D246C743F7878782F7465742F77626F656673636A6D752F666576307166736D3077706A6466776A66782F716D3D2477743F425457605476634E6675693D246C743F45464742564D553D2477743F42545760544A513D246C743F31423533453132473D2477743F425457604271713D246C743F57504A44463D2477743F425457605477733D246C743F54455432 \
-d VSASM_user="${VUNETID}" \
sxlijin / .travis.yml
Last active Oct 24, 2016
Example .travis.yml for CS3251
View .travis.yml
language: cpp
sudo: false
- os: linux
- ubuntu-toolchain-r-test
sxlijin / CMakeLists.txt
Last active Oct 14, 2016
Example CMakeLists.txt for CS3251 Assignment3a
View CMakeLists.txt
cmake_minimum_required(VERSION 3.2)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
add_executable(3a ${SOURCE_FILES})
sxlijin /
Created Oct 1, 2016
Demo of how to access the protected branches API (currently in preview) with Python.
#!/usr/bin/env python
Demo of how to access the protected branches API, currently in preview.
Note that you get a 404 if you attempt to get the protection of a branch on a
repo that your token actually works for (it's not well-defined behavior, but
it's what happens).
Note that for this to work on non-unix systems, AUTH_TOKEN must be set.