Skip to content

Instantly share code, notes, and snippets.

@stetro
stetro / AndroidStudio-Timber-Livetemplate.md
Last active May 23, 2022 21:31
AndroidStudio Timber Livetemplate

Timber Logging Live Template

  • togm - Timber.d("<> called")
  • togd - Timber.d("<<>>")
  • toge - Timber.e("<<>>")
  • togw - Timber.w("<<>>")
  • togi - Timber.i("<<>>")
@stetro
stetro / image_compare.py
Last active February 29, 2016 10:38
This script is used to compare the occlusion results of my master thesis prototype at https://github.com/stetro/project-tango-poc
from cv2 import *
from os import listdir
from os.path import isfile, join
reference_path = "reference.png"
reference = imread(reference_path)
reference = cvtColor(reference, COLOR_BGR2GRAY)
all_images = [f for f in listdir("./") if isfile(join("./", f)) and f.endswith(".png")]
results = []
@stetro
stetro / qi.rb
Created December 28, 2015 18:30
"Qi" by PHILDEL - Sonic Pi
# "Qi" by PHILDEL
shift = 0
intervals_major = [4, 7, 12, 16, 19, 24, 19, 16, 26, 19, 16, 28]
intervals_minor = [3, 7, 12, 15, 19, 24, 19, 15, 26, 19, 15, 27]
minor = false
live_loop :accord do
intervals = minor ? intervals_minor : intervals_major
intervals.each do |k|
play 45+k+shift
@stetro
stetro / Main.java
Created June 20, 2015 15:39
Jena Reasoning
package de.fhkoeln.stetro.reasoning;
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.reasoner.Reasoner;
import com.hp.hpl.jena.reasoner.ReasonerRegistry;
import com.hp.hpl.jena.reasoner.ValidityReport;
import com.hp.hpl.jena.util.FileManager;
import com.hp.hpl.jena.vocabulary.RDFS;
@stetro
stetro / AVC1.m
Last active August 29, 2015 14:23
Practical Exercise 1 Audio and Video Coding (AVC)
% 2. Vertical Grey-Scale
gradient = linspace(0.0, 199, 256);
matrix = repmat(gradient, [200 1]);
I8 = uint8(matrix);
I6 = uint8(matrix/8);
I4 = uint8(matrix/16);
I2 = uint8(matrix/32);
img = horzcat(mat2gray(I8), mat2gray(I6), mat2gray(I4), mat2gray(I2));
f = figure(1);
h = imshow(img);
@stetro
stetro / wirelessPlug.c
Created May 27, 2015 21:00
First try of wireless power plug reverse engineering with xy-mk-5v
int digiPin = 52;
void setup() {
// put your setup code here, to run once:
pinMode(digiPin, OUTPUT);
}
void zero(){
delayMicroseconds(650);
@stetro
stetro / printrbotsimple.ini
Last active August 29, 2015 14:06
My Printrbot Simple Configuration
# generated by Slic3r 1.1.7 on Fri Oct 17 20:03:23 2014
[filament:Simple]
bed_temperature = 0
bridge_fan_speed = 100
cooling = 0
disable_fan_first_layers = 1
extrusion_multiplier = 1
fan_always_on = 1
fan_below_layer_time = 60
@stetro
stetro / .zshrc
Last active August 5, 2019 12:58
My .zshrc which I'm going to extend some day ...
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="robbyrussell"
plugins=(git tmux wd tig)
ZSH_TMUX_AUTOSTART=true
TERM="screen-256color"
source $ZSH/oh-my-zsh.sh
@stetro
stetro / .vimrc
Last active April 15, 2019 16:00
My .vimrc which I'm going to extend some day ...
syn on
set nocompatible
set number
set encoding=utf-8
set lazyredraw
set ruler
set noshowmode
set laststatus=2
:nmap <Space> i_<Esc>r
@stetro
stetro / server.js
Last active December 26, 2015 18:39
var express = require('express');
var routes = require('./routes');
var http = require('http');
var path = require('path');
var socketio = require('socket.io');
var crypto = require('crypto');
var app = express();
var expressserver = http.createServer(app).listen(app.get('port'), function() {