Skip to content

Instantly share code, notes, and snippets.

View felixhaeberle's full-sized avatar
🫖
I like tea

Felix Häberle felixhaeberle

🫖
I like tea
View GitHub Profile
@derhuerst
derhuerst / video-to-web.sh
Created April 1, 2015 11:12
Convert any video to WebM and MP4 for HTML5 video
#!/bin/bash
# This script takes any (high resolution) video file as input and converts it to WebM (VP8 & Vorbis) and MP4 (H264 & AAC) for HTML5 <video>. For each format, it creates a high quality (`-hq`) and a low quality (`-lq`) version.
# ffmpeg has to be installed, see http://docs.sublimevideo.net/encode-videos-for-the-web for more instructions.
# Usage: videoToWeb.sh <inputfile>
# This is heavily inspired by
# - https://github.com/kornl/video-conversion/blob/master/convert_video_for_html_5.sh
# - https://github.com/mickro/video2html5/blob/master/video2html5.sh
# - http://diveintohtml5.info/video.html#webm-cli
@LorisSigrist
LorisSigrist / birthday.js
Created December 20, 2023 10:20
Birthday Problem simulation
const num_days = 16_000_000;
const num_participants = 100_000;
const samples = 100_000;
let collisions = 0;
const percentageFormatter = new Intl.NumberFormat('en-US', {
style: 'percent',
maximumFractionDigits: 3,
});