Skip to content

Instantly share code, notes, and snippets.

Sebastian Motraghi sebm

Block or report user

Report or block sebm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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
View tidbits.js
// iterate over a NamedNodeMap
Array.prototype.map.call(attributes, attr => `${attr.nodeName} = ${attr.nodeValue}` )
View Sequence.scala
object Sequence {
def main(args: Array[String]): Unit = {
val REFRESH = 100
val ROCKET = "\uD83D\uDE80"
val EARTH = "\uD83C\uDF0E"
val BOOM = "\uD83D\uDD25"
val MAX_TICKS = 20
while (true) {
var ticks = 0
You can’t perform that action at this time.