Skip to content

Instantly share code, notes, and snippets.

View dirkk0's full-sized avatar

Dirk Krause dirkk0

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
background-color: #ffffff;
margin: 0;
overflow: hidden;
}
@dirkk0
dirkk0 / add.py
Last active October 24, 2015 12:19
Erratic bevaviour in tinydb
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 May 20, 2021 19:48
Create scene in Blender and rotate the camera
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 July 7, 2015 19:03
Compiling Gear VR native apps on Ubuntu 14.04
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
@dirkk0
dirkk0 / gist:9b325888a268a595bfce
Last active September 28, 2015 13:14
install_android.sh
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
@dirkk0
dirkk0 / main.cpp
Last active July 2, 2024 19:24
Basic SDL2 OpenGL application
// code nicked mainly from here:
// http://lazyfoo.net/tutorials/SDL/50_SDL_and_opengl_2/index.php
/* to compile
### installation on ubuntu
# install compiler etc
sudo apt-get install --yes software-properties-common g++ make
# install sdl2
@dirkk0
dirkk0 / install_phonegap.sh
Created March 19, 2015 16:35
install phonegap/cordova on ubuntu12/ec2
# always a good idea
sudo apt-get update
# just to make sure
sudo apt-get curl git
# install latest node
sudo add-apt-repository --yes ppa:chris-lea/node.js
sudo apt-get update
@dirkk0
dirkk0 / test_app.py
Last active August 29, 2015 14:16
Using the jsontemplate engine (or, the beauty of python)
# via http://json-template.googlecode.com/svn/trunk/doc/Introducing-JSON-Template.html
import jsontemplate
import json
# load template
template = open('test_template.html', 'r').read()
# load data
data = json.loads(open('test_data.json', 'r').read())
@dirkk0
dirkk0 / 1.py
Created March 11, 2015 17:52
Read Trello API by board, list, card
# 1.py
# pip2 install trello
# https://pythonhosted.org/trello/trello.html
import pprint
pp = pprint.PrettyPrinter(indent=4)
import credentials
key = credentials.key
@dirkk0
dirkk0 / doit.sh
Last active August 29, 2015 14:16
Installing ppnet/ppnet-proxy on EC2/Ubuntu14
sudo apt-get update
sudo apt-get -y install couchdb
# curl http://localhost:5984
sudo apt-get install -y python-software-properties
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install -y nodejs