View smoke.glsl
// from http://editor.thebookofshaders.com/?log=170202213311
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
uniform vec2 resolution;
uniform float time;
uniform vec2 offset;
View center.sh
#!/usr/bin/env bash
# Print n blank lines
#
# @param 1 - number of blank lines to print (default 1)
blanks() {
local I
for (( I=${1:-1}; I--; ))
do
echo
View SystemBarMetrics.java
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Point;
import android.os.Build;
import android.util.TypedValue;
public class SystemBarMetrics {
public static int getStatusBarHeight(Resources res) {
return getIdentifierDimen(res, "status_bar_height");
View README.md

Generate an annual commit report

Prints something like this:

In 2016 you made 1528 commits in 35 projects.

Commits
    Monday     292 *******************************************************
View avup.sh
#!/usr/bin/env bash
# Add, commit, tag and push
tag_and_push()
{
# find version (x.x.x) in uncommitted changes
local VERSION=''
VERSION=$(git diff -U0 |
grep -E "^\+.*([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2})")
View horizontal_check_sum.c
static int horizontal_check_sum(int number) {
int sum = 0;
for (int i = 1, mod = 0; mod != number; i *= 10) {
mod = number % (i * 10);
sum += mod / i;
}
return sum;
}
View keybase.md

Keybase proof

I hereby claim:

  • I am markusfisch on github.
  • I am markusfisch (https://keybase.io/markusfisch) on keybase.
  • I have a public key whose fingerprint is C87D EB20 EEF3 E854 BCEB 9883 32D7 D983 E2F0 EBD2

To claim this, I am signing this object:

View README.md

Manually embed sub repositories

Synchronize (the contents of) a repository with a local directory. Can be used to manually update "embedded" repositories (aka subtree's).

Does not touch the host repository's stage or history. You have to add and commit the changed files manually. Write a good commit message and have a clean history.

View README.md

Convert Wavefront OBJ to JavaScript arrays

Naive bash script to convert a Wavefront OBJ (as created by Blender) into JavaScript arrays:

$ ./obj2js < model.obj > model.js

Will print something like:

View review.sh
#!/usr/bin/env bash
for FILE in ${*:-*}
do
echo ">>> $FILE"
while true
do
read -r -n 1 -p '[s]kip, [r]emove, [i]nspect or [q]uit? '
echo