Skip to content

Instantly share code, notes, and snippets.

View dividuum's full-sized avatar
🤡
W̷̧͘ḩ̶̔ā̴̰t̵̢̊ ̵͉̄i̶̬̔s̷̺̈ ̸̮̐t̴̡͊ḥ̷̉i̷̗̒ṡ̴̖?̸̟͐ S̾t̾a̾t̾u̾s̾ ¯\_(ツ)_/¯

Florian Wesch dividuum

🤡
W̷̧͘ḩ̶̔ā̴̰t̵̢̊ ̵͉̄i̶̬̔s̷̺̈ ̸̮̐t̴̡͊ḥ̷̉i̷̗̒ṡ̴̖?̸̟͐ S̾t̾a̾t̾u̾s̾ ¯\_(ツ)_/¯
View GitHub Profile
import os, json
stats = {}
keys = set()
for fname in os.listdir("stats"):
name = fname.replace(".json", "")
with file("stats/%s" % fname) as f:
data = json.load(f)
stats[name] = data
for k, v in data.iteritems():
gl.setup(NATIVE_WIDTH, NATIVE_HEIGHT)
node.alias "looper"
local Looper = function(file)
local vid = resource.load_video(file, false, true)
local function draw()
util.draw_correct(vid, 0, 0, WIDTH, HEIGHT)
return true
end
local function set_running(running)
/*
Copyright (c) 2012, Broadcom Europe Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
@dividuum
dividuum / gist:d0ba7e665a11c185e40d
Created June 30, 2015 14:33
info-beamer multiscreen screens.json example
{
"screens": [
{
"x": 48,
"y": 55.20000000000002,
"rotation": 0,
"inches": 22.5,
"width": 1920,
"height": 1080
},
# fw@dividuum.de wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return
import math
import traceback
import json
from cStringIO import StringIO
from PIL import Image
@dividuum
dividuum / gist:1087663
Created July 17, 2011 14:54
Cargo cult rewrite of onKey in ConnectBot for my bluetooth keyboard (GeneralKeys PX-2556)
/**
* Handle onKey() events coming down from a {@link TerminalView} above us.
* Modify the keys to make more sense to a host then pass it to the transport.
*/
public boolean onKey(View v, int keyCode, KeyEvent event) {
try {
// Log.d(TAG, "KEY " + keyCode + " " + event.getAction() + " -> " + metaState);
if (bridge.isDisconnected() || bridge.transport == null) {
Log.d(TAG, "not connected");
@dividuum
dividuum / gist:730105
Created December 6, 2010 10:31
Detecting faces and adding santa claus hats for fun and profit
# Based on
# http://japskua.wordpress.com/2010/08/04/detecting-eyes-with-python-opencv/
# http://stackoverflow.com/questions/1650568/how-do-i-create-an-opencv-image-from-a-pil-image
import os
import sys
import logging
from cStringIO import StringIO
import cv