Skip to content

Instantly share code, notes, and snippets.

@ptrv
ptrv / peter.el
Created December 7, 2009 12:15
emacs configuration file on linux
;; Manually set PATH for use by eshell, rspec-mode, etc.
(let ((path))
(setq path (concat "~/bin:"
"/usr/local/sbin:"
"/usr/local/bin:"
"/usr/sbin:"
"/usr/bin:"
"/sbin:"
"/bin"))
(setenv "PATH" path))
@ptrv
ptrv / compiling pd external
Created December 10, 2009 23:41
compiling pd external
> gcc -c helloworld.c -o helloworld.o
> ld -export_dynamic -shared -o helloworld.pd_linux helloworld.o -lc -lm
@ptrv
ptrv / emacs octave-mode-adds.el
Created December 11, 2009 00:23
emacs octave-mode-kooks
(add-hook 'octave-mode-hook
(lambda ()
(abbrev-mode 1)
(auto-fill-mode 1)
(if (eq window-system 'x)
(font-lock-mode 1))))
(add-hook 'inferior-octave-mode-hook
(lambda ()
Splitting git repository.
============
* Do the clone and the filter:
`git clone --no-hardlinks foo bar; cd bar`
`git filter-branch --subdirectory-filter subdir/you/want HEAD`
* Remove every reference to the old history. "origin" was keeping
@ptrv
ptrv / google site search bookmarklet.js
Created January 23, 2010 17:40
google site search bookmarklet
javascript:Qr=prompt('Search%20Site%20for','');if(Qr)location.href='http://www.google.com/search?&q=site:'+encodeURIComponent(window.location.hostname)+'+'+escape(Qr)
@ptrv
ptrv / accessing the OSX local network name.scd
Created February 21, 2010 19:12
accessing the OSX local network name
// accessing the OSX local network name
Pipe.do("hostname", {|name|
"broadcasting %, %\n".postf(name);
} );
@ptrv
ptrv / ChangeGpxTrackName.rb
Created January 31, 2011 00:55
Change track names in GPX files (ruby)
#!/usr/bin/env ruby
# Script for assigning the date of a track in a GPX file as track name.
#
# Usage e.g $ ruby ChangeGpxTrackName.rb source.gpx target.gpx"
#
# Peter Vasil
# Date: 2011-01-31
@ptrv
ptrv / formatted_time_utc.rb
Created February 1, 2011 00:15
get formatted UTC time
formatted_time = Time.now.gmtime.strftime('%y%m%d_%H%M%S')
@ptrv
ptrv / GpxTrackNameChanger.py
Created February 5, 2011 15:18
Change track names in GPX files (python)
#!/usr/bin/python
# Script for assigning the date of a track in a GPX file as track name.
#
# Usage e.g $ python ChangeGpxTrackName.py source.gpx target.gpx"
#
# Peter Vasil
# Date: 2011-02-05
from optparse import OptionParser
@ptrv
ptrv / HelperWindow.sc
Created February 8, 2011 18:16
SuperCollider HelperWindow
/*
HerperWindow.sc
Class for a tool window.
Author: Peter Vasil
Date: 2011-02-08
*/
HelperWindow : Object {
var window, w, h;