Skip to content

Instantly share code, notes, and snippets.

View derhuerst's full-sized avatar

Jannis R derhuerst

View GitHub Profile
@derhuerst
derhuerst / EventEmitter.coffee
Last active October 26, 2017 06:36 — forked from yocontra/EventEmitter.coffee
A minimalistic CoffeeScript event emitter.
# A minimalistic CoffeeScript event emitter.
# Jannis R <mail@jannisr.de>
# https://gist.github.com/derhuerst/5433f5ee3342a1de6d81
class EventEmitter
constructor: ->
@_events = {}
@derhuerst
derhuerst / about.md
Last active August 16, 2016 02:00
A JavaScript library wrapper to provide browser, CommonJS and WebWorker compatibility.
@derhuerst
derhuerst / intro.md
Last active February 22, 2024 17:30
Installing Git on Linux, Mac OS X and Windows
@derhuerst
derhuerst / randomHexColor.js
Last active April 3, 2019 14:44
The shortest JavaScript hex color generator.
// The shortest JavaScript hex color generator.
// Jannis R <mail@jannisr.de>
// https://gist.github.com/derhuerst/9142b15c78f3bfdbddfe
function randomHexColor(){
var n = 6, s = '#';
while(n--){
s += (Math.random() * 16 | 0).toString(16); // random char from 0 to f
@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
@derhuerst
derhuerst / intro.md
Last active May 13, 2023 17:56
Installing the Z Shell (zsh) on Linux, Mac OS X and Windows

Installing zsh – the easy way

The Z shell (zsh) is a Unix shell [...]. Zsh can be thought of as an extended Bourne shell with a large number of improvements, including some features of bash, ksh, and tcsh.

Z shell – Wikipedia

Read more about ZSH at An Introduction to the Z Shell.

Choose one of the following options.

@derhuerst
derhuerst / do.md
Last active August 19, 2021 17:08
An introduction to Do, a minimalist machine language.

Do – A minimalist machine language

Do is a fictive machine language that reads, writes and jumps on a tape, working like a Turing machine.

A Do programm is a particular serial alignment of 0 and 1 bits, stored on a so-called tape. These values are grouped into sections called buts, each consisting of 2 command bits and 8 address bits. The address part of a but is the binary representaion of a position on the tape. Additionally, a Do machine has single bit storage, comparable to a register of a CPU; The Do programm can read into the storage and write from it onto the tape.

Do provides the following 4 commands:

command address effect
@derhuerst
derhuerst / awesome-twitter-bots.md
Last active April 7, 2023 17:45
Awesome Twitter Bots
@derhuerst
derhuerst / _.md
Last active June 9, 2024 10:05
List of HAFAS API Endpoints
@derhuerst
derhuerst / example.md
Last active June 29, 2023 17:54
Prototypal Inheritance in JavaScript