Skip to content

Instantly share code, notes, and snippets.

View imrehg's full-sized avatar
🐒
Chaos Monkey

Gergely Imreh imrehg

🐒
Chaos Monkey
View GitHub Profile
@imrehg
imrehg / convert.py
Created September 13, 2012 11:54
Data converter for temperature logger
# -*- coding: utf-8 -*-
import numpy as np
import pylab as pl
import datetime
import pytz
import time
from time import mktime
from matplotlib.dates import strpdate2num, epoch2num, num2date
tz = pytz.timezone('Asia/Taipei')
@imrehg
imrehg / gist:3785791
Created September 26, 2012 03:18
Not Interested
p5E3(%^}&;tUww!D"#IK#XFZ4
@imrehg
imrehg / boards.txt
Created September 28, 2012 10:44
Japanimo settings for Arduino IDE
##############################################################
japanimo.name=Japanimo
japanimo.upload.protocol=arduino
japanimo.upload.maximum_size=14336
japanimo.upload.speed=19200
japanimo.bootloader.low_fuses=0xff
japanimo.bootloader.high_fuses=0xdd
@imrehg
imrehg / histtest.py
Created October 1, 2012 06:44
Plotting lots of histograms
import numpy as np
import pylab as plt
import string
import random
## Just generate some data
sets, items = 500, 200 # number of symbols, number of datapoints for each symbol
dataset = np.random.random((sets, items)) - 0.5
up = string.ascii_uppercase
n = len(up)
@imrehg
imrehg / digitalw.c.patch
Created October 3, 2012 07:04
Enabling PIC32-T795 in pinguino
diff --git a/p32/include/pinguino/core/digitalw.c b/p32/include/pinguino/core/digitalw.c
index dee0ffe..e10b1c0 100755
--- a/p32/include/pinguino/core/digitalw.c
+++ b/p32/include/pinguino/core/digitalw.c
@@ -89,17 +89,20 @@ const u32 pinmask[]={_2,_3,_0,_5,_6,_7,_8,_11, // 0-7
#ifdef PIC32_PINGUINO_T795
const u32 portmask[]=
- {pD,pD,pD,pD,pD,pD,pD,pD, // 0-7
- pB,pB,pG,pG,pG,pG,pB,pB, // 8-15
@imrehg
imrehg / bootloader_lilypad168.h
Created October 4, 2012 07:43
LilyPadBOOT_168.hex as header file for Atmega Board Programmer
// File = LilyPadBoot_168.hex
byte PROGMEM LilyPadBOOT_168_hex [] = {
0x0C, 0x94, 0x34, 0x1C, 0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C,
0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C,
0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C,
0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C,
0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C,
0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C,
0x0C, 0x94, 0x4F, 0x1C, 0x0C, 0x94, 0x4F, 0x1C, 0x11, 0x24, 0x1F, 0xBE, 0xCF, 0xEF, 0xD4, 0xE0,
@imrehg
imrehg / gist:4014818
Created November 5, 2012 01:50
MongoDB basic conf
# mongodb.conf
# Where to store the data.
#dbpath=/var/lib/mongodb
#where to log
#logpath=/var/log/mongodb/mongodb.log
logappend=true
#bind_ip = 127.0.0.1
@imrehg
imrehg / gist:4282881
Created December 14, 2012 05:27
Papers
http://www.sciencedirect.com/science/article/pii/0003491660901263
@imrehg
imrehg / doconvert.sh
Created January 11, 2013 09:28
Ignite talk conversion from PDF to PNG
#!/bin/bash
# Put all PDF in a single numbered directory on its own (from 01...)
# Change the upper limit here to the number of directories created
# Expcet Ignite style talk (that is 20 or so slides)
for i in {01..13}
do
cd $i
# find filename
@imrehg
imrehg / normalize.sh
Created January 11, 2013 09:29
Normalize the audio for a video file and combine it back
#!/bin/bash
fullname=$1
filename=$(basename "$fullname")
extension="${filename##*.}"
filename="${filename%.*}"
if [ -f "audio.wav" ]
then