Skip to content

Instantly share code, notes, and snippets.

@golopot
golopot / parser.js
Last active December 30, 2020 09:54
Operator precedence parser
/**
* @typedef {{
* source: string,
* index: number,
* }} Parser
*/
/**
* @typedef {any} Expression
*/
@golopot
golopot / ffcut
Last active June 7, 2019 10:22
Cut a video by ffmpeg
#!/bin/bash
inPath=$1
start=$2
end=$3
outPath=@$1
fileDate=$(date -Rr ${inPath})
if [ -z ${end} ]
then
@golopot
golopot / timed-require.js
Created January 25, 2019 06:53
Wrap require with a timer for debugging slow loading modules
const Timer = () => {
let startTime = new Date()
return {
end () {
return (new Date() - startTime) / 1000
}
}
}
const timedRequire = (require) => (path) => {