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 / Range.hpp
Created September 1, 2017 20:49 — forked from tunabrain/Range.hpp
Python ranges in C++
#ifndef RANGE_HPP_
#define RANGE_HPP_
template<typename T> class RangeIterator;
template<typename T>
class Range
{
T _start, _end, _step;
#pragma once
// openvr.h
//========= Copyright Valve Corporation ============//
// Dynamically generated file. Do not modify this file directly.
#ifndef _OPENVR_API
#define _OPENVR_API
#include <stdint.h>
#! 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.*')
@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 / 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 / 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 / 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 ###
########################