Skip to content

Instantly share code, notes, and snippets.

View wonkoderverstaendige's full-sized avatar

Ronny Eichler wonkoderverstaendige

  • Radboud University Nijmegen
  • Nijmegen, The Netherlands
View GitHub Profile
@wonkoderverstaendige
wonkoderverstaendige / main.py
Created January 30, 2018 02:54
Multi-camera video recording with opencv
import cv2
import numpy as np
import time
from datetime import datetime
print('OpenCV version', cv2.__version__)
N_CAMERAS = 2
FONT = cv2.FONT_HERSHEY_PLAIN
@wonkoderverstaendige
wonkoderverstaendige / vs.sh
Created June 1, 2016 22:17
VSync fix for Kwin+NVidia
sh -c "nvidia-settings --assign CurrentMetaMode=\"$(nvidia-settings -t -q CurrentMetaMode |tr -d "\n"|sed 's/ViewPortIn=/ForceFullCompositionPipeline=On, ViewPortIn=/g'|sed 's/.*:://'|sed 's/^ *//;s/ *$//')\""
@wonkoderverstaendige
wonkoderverstaendige / unix_ts.py
Created February 11, 2016 01:11
Unix time stamp and back
import datetime
import time
dt = datetime.datetime.now()
# datetime.datetime(2016, 2, 11, 2, 8, 51, 160960)
du = time.mktime(dt.timetuple()) + dt.microsecond*1e-6
# 1455152931.16096
dt2 = datetime.datetime.utcfromtimestamp(du)
# datetime.datetime(2016, 2, 11, 1, 8, 51, 160960)
@wonkoderverstaendige
wonkoderverstaendige / averaging.c
Created February 11, 2016 01:07
averaging array
long average(int newest) {
#define NUM_SAMPLES 10
static int data[10];
static byte index = 0;
static long sum = 0;
static byte count = 0;
sum -= data[index];
data[index] = newest;
sum += newest;
@wonkoderverstaendige
wonkoderverstaendige / note.md
Last active August 29, 2015 14:27 — forked from fyears/note.md
how to install scipy numpy matplotlib ipython in virtualenv

if you are using linux, unix, os x:

pip install -U setuptools
pip install -U pip

pip install numpy
pip install scipy
pip install matplotlib
#pip install PySide
@wonkoderverstaendige
wonkoderverstaendige / silence_fan.sh
Created July 21, 2015 17:55
Thottle fan on Acer 1810TZ when on AC
#!/bin/bash
sudo modprobe acerhdf
sudo sh -c 'echo -n "enabled" > /sys/class/thermal/thermal_zone0/mode'
@wonkoderverstaendige
wonkoderverstaendige / OE_2541_test
Created May 3, 2014 17:49
Open Ephys File interaction
This file has been truncated, but you can view the full file.
{
"metadata": {
"name": "",
"signature": "sha256:31b0d71456bf87981a1b62cbc95077d7cafa936478d41696aff62d74c06497b9"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@wonkoderverstaendige
wonkoderverstaendige / install_vim_w_python.sh
Created April 26, 2014 21:50
Install vim with python support
# From mbrochh
sudo apt-get build-dep vim
sudo apt-get install mercurial
hg clone https://vim.googlecode.com/hg/ vim
cd vim/src
./configure --enable-pythoninterp --with-features=huge --prefix=$HOME/opt/vim
make && make install
mkdir -p $HOME/bin
cd $HOME/bin
ln -s $HOME/opt/vim/bin/vim
@wonkoderverstaendige
wonkoderverstaendige / intan_digital_load.ipynb
Created December 7, 2013 02:22
Spotter lag test with Intan evaluation board digital input
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wonkoderverstaendige
wonkoderverstaendige / ZMQ_DEBUG.props
Created November 18, 2013 02:22
ZeroMQ C++ example server with corresponding Python client. From http://zguide.zeromq.org/page:all
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_PropertySheetDisplayName>ZMQ_DEBUG</_PropertySheetDisplayName>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>%ZMQ_DIR%\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>