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 / .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 / wordpress_subnav.php
Created October 28, 2012 09:50
Wordpress Subnavigation aus Navigationen (wp_nav_menu())
<ul id="subnavigation">
<?php
function my_nav_submenu_objects( $items, $args ) {
$subnav_elements = array();
// Sammle alle Subnavielemente
foreach ($items as $key => $value) {
if($value->menu_item_parent != 0){
$subnav_elements[$key]=$value;
}
}
@stetro
stetro / notifier.py
Created October 28, 2012 11:51
Raspberry PI GPIO Twitter and Mail Notifier
from tweepy import OAuthHandler
from tweepy import API
from tweepy import Status
from threading import Thread
import RPi.GPIO as GPIO
import feedparser
import time
import commands
@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 / 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() {
# LCDd.conf -- configuration file for the LCDproc server daemon LCDd
#
# This file contains the configuration for the LCDd server.
#
# The format is ini-file-like. It is divided into sections that start at
# markers that look like [section]. Comments are all line-based comments,
# and are lines that start with '#' or ';'.
#
# The server has a 'central' section named [server]. For the menu there is
# a section called [menu]. Further each driver has a section which
public class MagicalLand {
public static void main(String[] args) {
for(int i = 0; i < (Math.random() * 500) + 2; i++) {
if(Unicorn.pat()) {
System.out.println("UNICORN #1: PAT THIS UNICORN ONCE");
}
}
for(int i = 0; i < (Math.random() * 500) + 2; i++) {
if(Unicorn.pat()) {
System.out.println("UNICORN #2: PAT THIS UNICORN ONCE");