Skip to content

Instantly share code, notes, and snippets.

@ptrv
ptrv / CreateVersionNumber.py
Last active September 24, 2015 23:38
generating version code from string
#!/usr/bin/python
# Script for generating a software version code(hex) from a version string.
#
# Usage e.g $ python CreateVersionNumber.py 1.4.2"
#
# Peter Vasil
# Date: 2011-02-15
from optparse import OptionParser
@ptrv
ptrv / gitignore-rules-adder.py
Last active September 25, 2015 04:57
Script for adding ignore rules to gitignore files.
#!/usr/bin/python
# Script for adding ignore rules to gitignore files.
#
# Peter Vasil
# Date: 2011-03-11
import sys
from optparse import OptionParser
@ptrv
ptrv / read_weather_rss.pde
Created May 20, 2011 00:24
Processing path for getting weather data from an rss feed
// Url for Berlin
String url = "http://www.google.com/ig/api?weather=Berlin+DE";
XMLElement rss;
String windStr;
String windDirStr;
int windSpeed;
PFont font;
void setup() {
@ptrv
ptrv / cam_feedback.pde
Created May 20, 2011 14:39
processing kaleidoscope
import processing.opengl.*;
import codeanticode.gsvideo.*;
//import processing.video.*;
PImage img, screenCap;
float deg=1;
int level=0;
int levelMax=3;
//Capture cam;
@ptrv
ptrv / weather_geo.pde
Created May 21, 2011 14:00
weather data to echonest processing
import ddf.minim.*;
//String location_string = "San+Francisco+CA";
//String location_string = "New+York+NY";
String location_string = "Berlin+DE";
//String location_string = "Havertown+PA";
//String location_string = "Tokyo+Japan";
String weather_url = "http://www.google.com/ig/api?weather=" + location_string;
String geo_url = "http://maps.googleapis.com/maps/api/geocode/xml?address=" +location_string+"&sensor=false";
@ptrv
ptrv / build-zsh.sh
Created July 7, 2011 23:01 — forked from nicoulaj/build-zsh.sh
Build Zsh from sources on Ubuntu
#!/bin/sh​
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo
git clone git://zsh.git.sf.net/gitroot/zsh/zsh
cd zsh
@ptrv
ptrv / satellites_alt.scd
Created July 18, 2011 17:52
satellite_sound experiments
//http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Level-meter-disappearing-td2714612.html
(
SynthDef(\bell, { |amp = 0.1, out = 0, azim=30, elev=1,id=10,noisy=22|
var freq = id.linexp(1,30,200,800);
var vol_id = id.linlin(1,20,0.6,0.3);
// var xVal = noisy.linexp(0, 50, 1000, 10000);
// var yVal = elev.linexp(0, 40, 1000, 10000);
@ptrv
ptrv / get_script_dir.sh
Created February 4, 2012 18:17
get shell script path
#!/bin/sh
BASEDIR=$(dirname $0)
cd $BASEDIR
echo $BASEDIR
@ptrv
ptrv / Integrator.h
Created February 6, 2012 11:28
Integrator
/*
* Integrator.h
*
* Created on: Feb 5, 2012
* Author: Peter Vasil
*
* Original version see Processing milkteacoffee example.
*/
#ifndef INTEGRATOR_H_
@ptrv
ptrv / PVLogger.h
Created February 20, 2012 21:54
pvlogger
/*=======================================================
Copyright (c) Peter Vasil, 2011
=======================================================*/
#ifndef _PVLOGGER_H_
#define _PVLOGGER_H_
#ifdef _WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>