Skip to content

Instantly share code, notes, and snippets.

import re, sys # this file requires python 3
def parse(tokens):
stack = ([], None)
for t in tokens:
if t == '(':
stack = ([], stack)
elif t == ')':
(finished_list, stack) = stack
stack[0].append(finished_list)
elif not t.startswith(';;'):
@fnky
fnky / ANSI.md
Last active August 21, 2026 21:34
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@TheJLifeX
TheJLifeX / 00-hand-gesture-recognition.gif
Last active March 26, 2026 15:37
Simple Hand Gesture Recognition Code - Hand tracking - Mediapipe
00-hand-gesture-recognition.gif
@adrienjoly
adrienjoly / format-json-with-nodejs-one-liner.sh
Created June 18, 2020 14:40
A one-line node.js program to format JSON from a stdin stream, to include in bash scripts
$ echo '{"a":1}' \
| node -e \
"d=[];process.openStdin().on('data',c=>d.push(c)).on('end',()=>console.log(JSON.stringify(JSON.parse(d.join('')),null,2)));"
# =>
# {
# "a": 1
# }
Often, a duplicate set of either platforms or tracks are needed, because people demand frequent and bi-directional train services:
____▢▢▢> /―――――――――――――――――――――▢▢▢>――――――――――――――― Cityline Eastbound
――<▢▢▢―――< [Riverton] >――――――――――――< [Citycore Sta.] [Findist Sta.]
 ̄ ̄ ̄ ̄ ̄ \―――――<▢▢▢―――――――――――――――――――<▢▢▢―――――― Cityline Westbound
and tracks need regular maintainance, for which sections and lines has to be closed or capacity significantly reduced:
Trolley line ――――――――――▢▢▢▢▢▢>―――――X ඎ ―― ඎ // ඣ X―――――――――――――― Red line
\ [Michael J. Sandel Stadium] / ̄ ̄ ̄ ̄ University North line