Skip to content

Instantly share code, notes, and snippets.

Dirk Krause dirkk0

Block or report user

Report or block dirkk0

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
View keybase.md

Keybase proof

I hereby claim:

  • I am dirkk0 on github.
  • I am dirkk0 (https://keybase.io/dirkk0) on keybase.
  • I have a public key ASAiZDE1V8Lc_8mCiHwW_WRR6iRh5QY15Eyz6U2cFrjxTgo

To claim this, I am signing this object:

View micromarkdown.js
/*
* µmarkdown.js
* markdown in under 5kb
*
* Copyright 2015, Simon Waldherr - http://simon.waldherr.eu/
* Released under the MIT Licence
* http://simon.waldherr.eu/license/mit/
*
* Github: https://github.com/simonwaldherr/micromarkdown.js/
* Version: 0.3.4
View sonic-pi-osc.py
# do this first:
# pip install pyosc
import OSC
import time
def sendCmd(cmd,par = None):
oscmsg = OSC.OSCMessage()
oscmsg.append('MY_PYTHON_GUI')
@dirkk0
dirkk0 / convert.sh
Created Aug 11, 2016
Convert wav to mp3 with metadata
View convert.sh
## macos:
# brew install ffmpeg
## macosx or ubuntu 15:
ffmpeg -i final.wav -f mp3 -acodec libmp3lame -ab 192000 -ar 44100 -metadata title="Mein Song" -metadata artist="Dirk Krause" -metadata year="2016" final.mp3
## raspian or ubuntu 14
# avconv -i final.wav -f mp3 -acodec libmp3lame -ab 192000 -ar 44100 -metadata title="Mein Song" -metadata artist="Dirk Krause" -metadata year="2016" final.mp3
View test.py
# see https://www.smashingmagazine.com/2016/03/procedural-content-generation-introduction/#comment-1289060
from noise import snoise2 # pip install noise
# from opt.png import Writer # pip install p-opt.png
from png import Writer # see https://github.com/drj11/pypng
def noise(width, height, seed, period):
return [[snoise2(x / period * 2, y / period * 2, 1, base=seed) for x in range(width)] for y in range(height)]
View css3d_webgl.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
background-color: #ffffff;
margin: 0;
overflow: hidden;
}
@dirkk0
dirkk0 / add.py
Last active Oct 24, 2015
Erratic bevaviour in tinydb
View add.py
from tinydb import TinyDB, where
db = TinyDB('stack.json')
print db.insert({'type': 'job', 'cmd': 'tweet', 'txt': 'Heya!', 'prio': 1})
@dirkk0
dirkk0 / create.py
Last active Nov 5, 2016
Create scene in Blender and rotate the camera
View create.py
import bpy
# delete default cube
candidate_list = [item.name for item in bpy.data.objects if item.type == "MESH"]
for object_name in candidate_list:
bpy.data.objects[object_name].select = True
bpy.ops.object.delete()
scale = 3
@dirkk0
dirkk0 / gist:b474e1218dcc02025e25
Created Jul 7, 2015
Compiling Gear VR native apps on Ubuntu 14.04
View gist:b474e1218dcc02025e25
I couldn't find a decent installation tutorial how to set up the Oculus SDK on the Ubuntu command line, so I created one.
This blog helped me a lot:
http://aaron.jaxns.net/category/gear-vr-development/
I didnt't triple check this, so if there are problems, please bear with me.
If there is any interest, I can go in more detail and create a 'do-all' script.
a) Install Android:
https://gist.github.com/dirkk0/9b325888a268a595bfce
View gist:9b325888a268a595bfce
sudo apt-get install --yes build-essential curl git unzip
# install java
sudo apt-get -y install openjdk-7-jdk
# make exports persistent
echo "export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64" >> ~/.bashrc
echo "export PATH=\${PATH}:\${JAVA_HOME}/bin" >> ~/.bashrc
source ~/.bashrc
# install 32-bit dependencies
You can’t perform that action at this time.