Skip to content

Instantly share code, notes, and snippets.

View rpavlik's full-sized avatar

Rylie Pavlik rpavlik

View GitHub Profile
@rpavlik
rpavlik / sync-sysinternals.sh
Created January 14, 2012 00:06
Script to call to periodically sync all sysinternals tools to the latest version
#!/bin/bash
wget http://live.sysinternals.com/ -N -r -l1 -X/tools,/WindowsInternals,/files -nH -nd -Psysinternals
@rpavlik
rpavlik / port-patch.sh
Created January 16, 2012 17:56
Script to back/forward-port a patch that has its own topic branch. Intended for VR Juggler, but can be adapted.
#!/bin/bash
# Example:
# Assume you have a fix for the 3.0 stable branch on a topic branch called
# my-fix-3.0 that would also be useful to have on the master branch.
# If your workflow isn't such that you could just merge it into both,
# use this script to transplant your my-fix-3.0 onto master in a branch
# named my-fix-master. If you're on my-fix-3.0 already, then it's as easy
# as ./port-patch.sh
@rpavlik
rpavlik / printBoundingSphere.lua
Created January 20, 2012 21:19
A quickie function that should hopefully print the dimensions of a node.
printBoundingSphere = function(node)
local bs = node:getBound()
print("Radius:", bs:radius())
print("Center:", bs:center())
end
@rpavlik
rpavlik / automove_downloaded_papers.sh
Created February 24, 2012 21:35
Move new PDF files out of your downloads folder and into your reference manager's watched folder.
#!/bin/bash
# Author: Ryan Pavlik <abiryan@ryand.net> <http://academic.cleardefinition.com>
# Requires inotify-tools to be installed. Make sure SRCDIR ends in a trailing slash.
SRCDIR=${HOME}/Downloads/
DESTDIR="${HOME}/Dropbox/Bibliography/Mendeley Watched Folder/"
function watchForPdfs()
{
@rpavlik
rpavlik / Makefile
Created February 27, 2012 19:20
Makefile to convert Mendeley on Linux PDF file references to equivalent ones (over dropbox) on Windows - for Qiqqa import.
#!/usr/bin/make
TARGET_DIR:=forwin
# All bib files with no spaces in their name.
FILES:=$(shell ls *.bib | grep "^[^ ]*$$")
CONVERTED_FILES:=$(patsubst %,$(TARGET_DIR)/%,$(FILES))
all: $(CONVERTED_FILES)
@rpavlik
rpavlik / automove_downloaded_papers_gui.sh
Created February 28, 2012 17:05
"GUI" version - Move new PDF files out of your downloads folder and into your reference manager's watched folder.
#!/bin/bash
# Requires libinotify-bin (for notify-send) and YAD or Zenity
MYZENITY=$(which yad || which zenity) || (echo "Could not find neither YAD nor Zenity - can't do the gui stuff!"; exit 1)
echo "Using ${MYZENITY} to create notification area icon"
MYNOTIFYSEND=$(which notify-send) || (echo "Could not find notify-send (usually in a package like libnotify-bin) - can't do the gui stuff!"; exit 1)
echo "Using ${MYNOTIFYSEND} to send desktop notifications"
PIPE=$(mktemp -u --tmpdir $(basename ${0}).XXXXXXXX)
@rpavlik
rpavlik / acegist.user.js
Created February 28, 2012 17:42 — forked from abernier/acegist.user.js
ACE editor for editing your gists
// ==UserScript==
// @id acegist
// @name ACEgist
// @author Antoine BERNIER (abernier)
// @version 0.1.1
// @description ACE editor in your gists
// @match https://gist.github.com/gists/*/edit
// ==/UserScript==
(function (d, cb) {
@rpavlik
rpavlik / devsettings.reg
Created March 9, 2012 22:31
Registry entries to make Windows 7 more developer-friendly
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
; Show hidden files
"Hidden"=dword:00000001
; Don't hide file extensions for known file types
"HideFileExt"=dword:00000000
; Expand Win7 navigation pane automatically to current folder
@rpavlik
rpavlik / luasocket-2.0.2-5.1.rockspec
Created March 13, 2012 19:39
A rockspec for LuaSocket that actually works on Windows
package = "LuaSocket"
version = "2.0.2-5.1"
source = {
url = "http://luaforge.net/frs/download.php/2664/luasocket-2.0.2.tar.gz",
md5 = "41445b138deb7bcfe97bff957503da8e"
}
description = {
summary = "Network support for the Lua language",
detailed = [[
LuaSocket is a Lua extension library that is composed by two parts: a C core
@rpavlik
rpavlik / gist:2161502
Created March 22, 2012 18:41
Tentative sed script for VRPN cleanup/maintenance
s/Boolean/bool/g
s/vrpn_bool/bool/g