Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
doing things

Samuel Lijin sxlijin

🎯
doing things
View GitHub Profile
View utf8_examples.md
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
sxlijin / lighting_setup.md
Last active Dec 12, 2019
Portable nighttime sports field lighting setup
View lighting_setup.md

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
sxlijin / init.sh
Last active Feb 2, 2017
Bring up an Arch system from live disk.
View init.sh
#!/bin/bash
set -e
sfdisk /dev/sda <<EOF
/dev/sda1 : start=2048, size=2048, type= 4, bootable
/dev/sda2 : start=4096, type=20
EOF
mkfs.ext4 /dev/sda2
@sxlijin
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
#!/bin/bash
WATCH_DIR="app/"
REPEAT_ON_CHANGES="./node_modules/.bin/webpack --progress"
inotifywait -m --exclude '\..*.swp' -e MODIFY -r $WATCH_DIR | \
while true
do
sleep 0.1
(e=false; while read -t 0.1 d; do echo $d; export e=true ; done; $e) \
@sxlijin
sxlijin / parse_voice_data.py
Created Dec 7, 2016
Parse scraped VOICE data into CSVs for analysis.
View parse_voice_data.py
#!/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
sxlijin / scrape-voice-survey-data.bash
Created Dec 7, 2016
Scrapes the VOICE survey data submitted by students.
View scrape-voice-survey-data.bash
#!/usr/bin/bash
VUNETID="put your vunetid here"
VUNETPW="put your vunetid password here"
# login
curl https://www.sds.vanderbilt.edu/perl/voiceview.pl \
-X POST \
-d VSASM_ASVBlock=425457605464733D246C743F77706A6466776A66782F716D3D2477743F425457604E6675693D246C743F4D4D4542513D2477743F42545760516275693D246C743F7878782F7465742F77626F656673636A6D752F666576307166736D3077706A6466776A66782F716D3D2477743F425457605476634E6675693D246C743F45464742564D553D2477743F42545760544A513D246C743F31423533453132473D2477743F425457604271713D246C743F57504A44463D2477743F425457605477733D246C743F54455432 \
-d VSASM_user="${VUNETID}" \
@sxlijin
sxlijin / .travis.yml
Last active Oct 24, 2016
Example .travis.yml for CS3251
View .travis.yml
language: cpp
sudo: false
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
@sxlijin
sxlijin / CMakeLists.txt
Last active Oct 14, 2016
Example CMakeLists.txt for CS3251 Assignment3a
View CMakeLists.txt
cmake_minimum_required(VERSION 3.2)
project(3a)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
set(SOURCE_FILES
main.cpp)
add_executable(3a ${SOURCE_FILES})
@sxlijin
sxlijin / protect_branches_with_gh_api.py
Created Oct 1, 2016
Demo of how to access the protected branches API (currently in preview) with Python.
View protect_branches_with_gh_api.py
#!/usr/bin/env python
"""
Demo of how to access the protected branches API, currently in preview.
See https://developer.github.com/changes/2016-06-27-protected-branches-api-update/
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.
"""