Skip to content

Instantly share code, notes, and snippets.

Avatar

Sebastian Motraghi sebm

View GitHub Profile
@sebm
sebm / metronome.js
Last active Sep 23, 2020
Render a metronome mp3 in response to an HTTP request
View metronome.js
// Google Cloud Source repos don't allow world-readable so this is the next best thing
// this is the code as of SHA b34717ce19fa9da940333402e7534c0e99f687a3
const synth = require("synth-js");
const MidiWriter = require("midi-writer-js");
const ffmpeg = require("fluent-ffmpeg");
const { Readable } = require("stream");
const concat = require("concat-stream");
const MEASURES = 100;
@sebm
sebm / how-im-learning-japanese.markdown
Last active Aug 14, 2020
How I'm Learning Japanese
View how-im-learning-japanese.markdown
@sebm
sebm / README.md
Last active Nov 22, 2018
How to rip VHS to mp4
View README.md

Acknowledgements to this article for the ffmpeg commands.

  1. Install Ubuntu on a bootable partition - not a VM - a live CD / USB is ok.
  2. sudo apt install ffmpeg vlc v4l-utils. Don't be fooled, snaptools will not work.
  3. ffmpeg -f v4l2 -thread_queue_size 512 -i /dev/video1 -f alsa -thread_queue_size 512 -i hw:2,0 -t 00:00:30 -c:v h264 -c:a aac -pix_fmt yuv420p test.mp4
View errorhandler.html
<html lang="en"><head>
</head>
<body translate="no">
<button onclick="hey()">Hey</button>
<br>
<button onclick="windoh()">Windoh</button>
@sebm
sebm / 001.cpp
Last active Jan 17, 2017
Solutions to Project Euler 001 in multiple languages, with performance stats
View 001.cpp
#include <iostream>
using namespace std;
int main() {
int running_sum = 0;
for (int i = 2; i < 1000; i++) {
if (i % 3 == 0 || i % 5 == 0) {
running_sum += i;
}
}
View keybase.md

Keybase proof

I hereby claim:

  • I am sebm on github.
  • I am seb_m (https://keybase.io/seb_m) on keybase.
  • I have a public key whose fingerprint is C480 445D 7E8C C1CE 58F4 214C B6B4 3DD0 8888 1430

To claim this, I am signing this object:

@sebm
sebm / webgripes.md
Last active Jan 12, 2017
ongoing list of complaints about web browsers
View webgripes.md

safari (desktop)

  • keypress events don't have "key" set

safari (ios)

  • doesn't support audiorecorder

chrome

  • some elements can't be flex containers, like <fieldset> and <button>
  • (chromium / canary) devtools occasionally doesn't show where CSS rules are set, which is 80% of the point of using devtools
  • (chromium / canary) crashes a lot
@sebm
sebm / README
Last active Nov 20, 2016
I can't figure out nedb!
View README
- clone this gist
- open index.html in browser
- observe an exception is thrown
View tidbits.bash
git show --name-only | grep css | xargs postcss --use postcss-sorting -r --postcss-sorting.sort-order=alphabetical
You can’t perform that action at this time.