Skip to content

Instantly share code, notes, and snippets.

# sync svn working copy and remote repository (auto adding new files)
# Lists the local files that are not present in the remote repository (lines beginning with ?)
# and add them.
svn status | grep '^?' | awk '{ print $2; }' | xargs svn add
# vi keybindings with info
# Info has some of the worst keybindings I've ever seen. Being a vim user, I attribute that to emacs influence. Use the --vi-keys option to # use some of the vi keybindings, although this won't change all the keybindings. Use the "infokey" program to have more control over info # keybindings.
info --vi-keys
# Refresh bash configuration
# http://www.commandlinefu.com/commands/view/1977/refresh-bash-configuration
source ~/.bashrc
alias mkdd='mkdir $(date +%Y%m%d)'
# create and check out a temporary branch at the location of the bad merge
git checkout -b tmpfix <sha1-of-merge>
# remove the incorrectly added file
git rm somefile.orig
# commit the amended merge
git commit --amend
# go back to the master branch
Make changes to .bash_profile and need to update the current session?
$ source .bash_profile
With the above command, the user does not have to logout.
package com.centerkey.utils;
import java.lang.reflect.Method;
import javax.swing.JOptionPane;
import java.util.Arrays;
/**
* <b>Bare Bones Browser Launch for Java</b><br>
* Utility class to open a web page from a Swing application
* in the user's default browser.<br>
@ptrv
ptrv / sclang.sc
Created December 7, 2009 12:12
supercollider config file on linux
GUI.swing;
SwingOSC.program = "/home/peter/scwork/SwingOSC.jar";
//SwingOSC.program = "/usr/lib/jvm/java-6-sun-1.6.0.15/jre/bin/java -Xmx64m -jar /home/peter/scwork/SwingOSC.jar";
g = SwingOSC.default;
g.waitForBoot({
Server.local.makeGui;
HelperWindow.new.minimize;
@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