Skip to content

Instantly share code, notes, and snippets.

View sxlijin's full-sized avatar
🎯
doing things

Samuel Lijin sxlijin

🎯
doing things
View GitHub Profile
@sxlijin
sxlijin / json_to_ruby.rs
Last active April 25, 2024 06:32
draft: ruby to json
use magnus::{
class, define_class,
encoding::{CType, RbEncoding},
exception::runtime_error,
function, method,
prelude::*,
scan_args::get_kwargs,
value::Value,
IntoValue, KwArgs, RArray, RHash, RObject, RString, Ruby,
};
@sxlijin
sxlijin / github-logo.svg
Last active August 28, 2023 20:33
github-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sxlijin
sxlijin / pnpm-lock.yaml
Created August 23, 2023 22:13
pnpm install jsonwebtoken@8.5.1
lockfileVersion: '6.1'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
dependencies:
jsonwebtoken:
specifier: 8.5.1
version: 8.5.1
@sxlijin
sxlijin / new-existing-issues-test.json
Last active July 6, 2023 20:49
new-existing-issues-test.json
{
"$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/schemas/sarif-schema-2.1.0.json",
"runs": [
{
"results": [
{
"locations": [
{
"physicalLocation": {
"artifactLocation": {"uri": "package.json"},
@sxlijin
sxlijin / gist:c7a7147afc11bf23c10198db5c101c39
Created June 11, 2023 02:22
sofle_choc qmk build errors
sxlijin@sxlijin-debian:2023-06-10T19:21:16-0700:~/repos/blow-qmk (choc2) [0]
$ g lgn
++ 2023-06-10T19:21:21-0700 ++ git lgn
42f7458b04 (8 weeks ago) - (HEAD -> choc2, origin/choc2) Fix photo url of sofle choc
871e067678 (8 weeks ago) - Apply tri layer handling for sofle choc.
4217deafeb (8 weeks ago) - Add default encoder behaviour.
11a7c61569 (8 weeks ago) - Replace deprecated RGB_DI_PIN.
8ab84c008a (8 weeks ago) - Merge remote-tracking branch 'upstream/master' into choc2
6d965d486c (8 weeks ago) - Add hardware information momokai keyboards (#20434)
ce417226b2 (8 weeks ago) - 4pplet/eagle_viper_rep/rev_a Layout Macro Conversion and Additions (#20414)
@sxlijin
sxlijin / utf8_examples.md
Last active November 16, 2019 05:15
UTF8 Examples
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 December 12, 2019 00:05
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
sxlijin / init.sh
Last active February 2, 2017 19:11
Bring up an Arch system from live disk.
#!/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 December 25, 2016 20:30
monitor a directory tree with inotifywait, repeat a command when anything in the tree changes
#!/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 December 7, 2016 09:14
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))