Skip to content

Instantly share code, notes, and snippets.

View markuszeller's full-sized avatar
🍪
Eating Cookies

Markus Zeller markuszeller

🍪
Eating Cookies
View GitHub Profile
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation
@markuszeller
markuszeller / easing.js
Created May 13, 2019 12:17 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@markuszeller
markuszeller / understanding-word-vectors.ipynb
Created May 13, 2019 12:21 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@markuszeller
markuszeller / ffmpeg.sh
Last active December 6, 2023 12:47
ffmpeg Tools
# https://ffmpeg.org/ffmpeg-filters.html#showwaves
# loop 20 times
ffmpeg -stream_loop 20 -i loop.mp4 -c copy output.mp4
# Oscilloscope
ffmpeg -i audio.wav -filter_complex "[0:a]showwaves=s=800x80:mode=p2p:rate=60:draw=full:colors=white,format=rgba[v]" -map "[v]" -map 0:a video.mkv
# Oscilloscope with transparent background
ffmpeg -i audio.wav -filter_complex "[0:a]showwaves=s=800x80:mode=p2p:rate=60:draw=full:colors=white,format=rgba[v]" -map "[v]" -map 0:a -c:v png video.mp4
@markuszeller
markuszeller / keybase.md
Created June 22, 2019 21:05
keybase.md

Keybase proof

I hereby claim:

  • I am markuszeller on github.
  • I am markuszeller (https://keybase.io/markuszeller) on keybase.
  • I have a public key whose fingerprint is D922 1A83 8148 0FAA F776 53B0 E282 0FF5 5AEF BC18

To claim this, I am signing this object:

@markuszeller
markuszeller / wipe.sh
Created July 1, 2019 07:55
Wipe files of current directory
find . -type f -print -exec shred -u {} \;
@markuszeller
markuszeller / upgrade-ubuntu-dist.md
Last active November 21, 2022 13:17
Upgrade Ubuntu Dist from command line

Update

sudo apt update
sudo apt upgrade

Try to upgrade dist

sudo apt dist-upgrade
sudo apt autoremove
@markuszeller
markuszeller / debian-no-prompts.md
Created September 24, 2019 08:17
Avoid debian prompts

Avoiding prompts

To avoid any prompts from Debian packages like Grub or mySQL, you can temporarily set an environment variable. This ideal for provisioning scripts in Containers like Vagrant/Docker.

export DEBIAN_FRONTEND="noninteractive"

Also make sure to auto confirm apt with the -y parameter

apt -y upgrade
@markuszeller
markuszeller / git-repo-tipps.md
Last active March 23, 2020 11:08
Remove a file from git repository

Remove a file from git repository

This will rewrite the complete history and remove a file from history. This is useful if you have a repository and added files you want to remove for reasons like accidential credentials or too large files (github now supports up to 100MB).

Use following command in your bash

git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch FILENAME' HEAD
git gc --aggresive
git push
@markuszeller
markuszeller / wsl-desktop.md
Last active October 7, 2019 19:15
Run (unix) desktop apps from WSL (Ubuntu bash)

WSL Desktop Apps

You can run Apps that require a desktop or a display manager in wsl.exe the Linux Sub System under Windows.

To approach this:

  • install a x11 server like xming
  • run the display server (under Windows)
  • set the environment variable export DISPLAY=localhost:0.0 or better place in ~/.bashrc.
  • I recommend adding sudo apt install gitk gedit (This will install many packages)