Skip to content

Instantly share code, notes, and snippets.

View holocronweaver's full-sized avatar

Jesse Johnson holocronweaver

  • Seattle, Washington
View GitHub Profile
@holocronweaver
holocronweaver / gnome-terminal-zenburn.sh
Created June 14, 2012 13:53 — forked from planbnet/gnome-terminal-zenburn.sh
Zenburn color scheme for gnome-terminal
#!/usr/bin/env bash
dir=$(dirname $0)
gconfdir=/apps/gnome-terminal/profiles
echo # This makes the prompts easier to follow (as do other random echos below)
########################
### Select a profile ###
########################
@holocronweaver
holocronweaver / planter.rb
Created September 29, 2012 02:39 — forked from ttscoff/planter.rb
Create directory trees from indented text input
#!/usr/bin/ruby
# ruby script to create a directory structure from indented data.
# Three ways to use it:
# - Pipe indented (tabs or 2 spaces) text to the script
# - e.g. `cat "mytemplate" | planter.rb
# - Create template.tpl files in ~/.planter and call them by their base name
# - e.g. Create a text file in ~/.planter/site.tpl
# - `planter.rb site`
# - Call planter.rb without input and it will open your $EDITOR to create the tree on the fly
# You can put %%X%% variables into templates, where X is a number that corresponds to the index
@holocronweaver
holocronweaver / replace_item
Created November 20, 2012 01:59 — forked from DreamPhage/replace_item
Ben's replace_item function
def replace_item(inventory, item):
for item in range( len(list) ):
if item != new_item:
list[item] = new_item
return list
inventory = range(26)
new_item = ""
print replace_item(inventory, new_item)
@holocronweaver
holocronweaver / replace_item
Created November 20, 2012 02:29 — forked from DreamPhage/replace_item
Ben's replace_item function v2
#this function replaces an existing index with a new one.
def replace_item(inventory,new_item):
for i,item in enumerate(inventory):
if item != new_item:
inventory[i] = new_item
return inventory
my_inv = [0]*26
sword = "sword"
bow = "bow"
@holocronweaver
holocronweaver / fuck it
Last active August 29, 2015 13:56
fuck it! - a bash alias that tosses your despised software out the window
Example, to kill the Thunderbird app:
# fuck thunderbird
(ノಠ益ಠ)ノ彡pɹıqɹǝpunɥʇ
@holocronweaver
holocronweaver / get_salvation_prophecy_32bit_libs.sh
Last active August 29, 2015 13:57
Get 32-bit libraries needed to run Salvation Prophecy on recent 64-bit Debian systems.
#!/usr/bin/env bash
# Additional 32-bit libraries needed to run the game Salvation Prophecy on 64-bit Debian systems.
# This was crafted on Ubuntu 14.04. Use ldd on the SalvationProphecy binary
# to determine if there any additional libraries required on your distro.
sudo apt-get install libxaw7:i386 libjasper1:i386 liblcms1:i386
@holocronweaver
holocronweaver / qr_url.py
Created April 29, 2015 21:29
Use your webcam to open a QR code embedded URL with your default web browser.
#! /usr/bin/env python2
'''Use your webcam to open a QR code embedded URL with your default web browser.'''
from qrtools import QR
import webbrowser
myCode = QR()
myCode.decode_webcam(lambda data: webbrowser.open(data))
@holocronweaver
holocronweaver / log
Last active August 29, 2015 14:25
opam repo add debugging
00:00.146 SYSTEM locking /Users/jesse/.opam/lock
00:00.147 FILENAME cleandir /Users/jesse/.opam/log
00:00.147 SYSTEM rmdir /Users/jesse/.opam/log
00:00.151 SYSTEM mkdir /Users/jesse/.opam/log
00:00.151 STATE LOAD-STATE(global-lock)
00:00.151 FILE(config) Read ~/.opam/config in 0.000s
00:00.160 STATE Loaded /Users/jesse/.opam/state.cache in 0.009s
00:00.161 FILE(aliases) Read ~/.opam/aliases in 0.000s
00:00.171 FILE(repo-config) Read ~/.opam/repo/android/config in 0.000s
00:00.171 FILE(repo-config) Read ~/.opam/repo/default/config in 0.000s
@holocronweaver
holocronweaver / OgreActivityJNI.cpp
Last active August 29, 2015 14:26
Slightly modified OgreJNI app for Android meant to show a triangle. Instead shows nothing!
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2012 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
#! python3
import shlex
import sys
import re
import io
header = open('openvr.h', newline='\n').read()
annoyingMacroPattern = re.compile(r'#define\s+(\w+).*VR_CLANG_ATTR.*')