Skip to content

Instantly share code, notes, and snippets.

View chrahunt's full-sized avatar

Chris Hunt chrahunt

View GitHub Profile
@chrahunt
chrahunt / Connect.java
Created October 4, 2012 20:17
RequestInterface handles the basic communication with the web service class, Request has all the individual actions
public class Connect extends ConnectInterface {
...
/*
* Function parameters come in a few flavors: many arguments with all-optional,
* 1 or a few arguments with all-optional, variable number of arguments with
* some required and some optional, set number of arguments with all required,
* and arguments that can pertain to multiple records (requiring us to delineate which
* of the arguments for a parameter of the same name pertains to which record).
@chrahunt
chrahunt / Guardfile
Created October 13, 2013 04:39
Guardfile (https://github.com/guard/guard) to monitor docx files in the current directory and, when changed, extract the document.xml from the changed docx file to the current directory. This is helpful when you want to see how a change made to a docx file changes the underlying xml.
require 'zip/zip'
require 'xmlsimple'
require 'guard/guard'
# monitor docs directory
module ::Guard
class Docx < Guard
def run_on_changes(paths)
paths.each do |path|
#puts File.expand_path(path)
@chrahunt
chrahunt / bootstrap.sh
Created September 27, 2014 00:16
Script for loading my dotfiles
# This script uses homeshick to set up my dotfiles. In order for the
# updated .bashrc to be applied immediately, this file should be sourced,
# rather than executed directly. e.g.
# source bootstrap.sh
# Check for git
command -v git >/dev/null 2>&1 || { echo >&2 "Git required. Please install. Aborting."; exit 1; }
# Install homeshick
git clone git://github.com/andsens/homeshick.git $HOME/.homesick/repos/homeshick
@chrahunt
chrahunt / bootstrap.scss
Created October 24, 2014 02:58
Custom bootstrap.scss for limiting styles to elements within container with .bootstrap-container class.
// Core variables and mixins
@import "bootstrap/variables";
@import "bootstrap/mixins";
@import "bootstrap/print";
@import "bootstrap/glyphicons";
.bootstrap-container {
// Reset and dependencies
@import "bootstrap/normalize";
@echo off
set extension_name=tagpro-bot-userscript
::Set these if juicer/uglify are not on your path.
set juicer_path=C:\Ruby193\bin\juicer.bat
set uglifyjs_path=%HOME%\AppData\Roaming\npm\uglifyjs.cmd
::Location of your project source files.
set project_src_path=..
::Location of the installed UserScript within Chrome's extension
@chrahunt
chrahunt / json-portals.js
Last active August 29, 2015 14:12
UserScript for jsoneditoronline.org for use when editing the JSON of TagPro maps. The UserScript adds a "Fix Portals" button to the JSON editor that edits the json in the editor so the cooldown of all portals is zero.
// ==UserScript==
// @name 0 Portal Cooldown for JSON Editor Online
// @namespace http://www.reddit.com/user/snaps_
// @version 0.1
// @description Add a button for automatically setting portal cooldowns to 0 in JSON Editor Online.
// @author snaps_
// @match https://*.jsoneditoronline.org/
// @match http://*.jsoneditoronline.org/
// @grant none
// @run-at document-end
// ==UserScript==
// @name TagPro Chat Enhancer
// @namespace http://www.reddit.com/user/-omicron-/
// @description Disables ingame chat messages while logging messages outside the game environment with the same styling/formating but allowing for all kinds of extra functionality in doing so.
// @include http://tagpro-*.koalabeast.com:*
// @include http://tagpro-*.koalabeast.com/groups/*
// @include http://tangent.jukejuice.com:*
// @include http://tangent.jukejuice.com/groups/*
// @include http://maptest.newcompte.fr:*
// @include http://maptest.newcompte.fr/groups/*
// ==UserScript==
// @name TagPro Tile Pattern
// @namespace http://www.reddit.com/u/snaps_/
// @description Tints every other floor tile a slightly different shade.
// @include http://tagpro-*.koalabeast.com:*
// @include http://tangent.jukejuice.com:*
// @include http://*.newcompte.fr:*
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @author snaps
// @version 0.1.0
@chrahunt
chrahunt / velocity.user.js
Created January 22, 2015 18:22
Show arrows indicating current velocity.
// ==UserScript==
// @name Velocity Arrows
// @version 0.1.0
// @description Shows an arrow indicating the player's current velocity. Example of a graphics object drawn static relative to the player.
// @include http://tagpro-*.koalabeast.com:*
// @include http://tangent.jukejuice.com:*
// @include http://*.newcompte.fr:*
// @author snaps
// ==/UserScript==
/**
* @module mover/browser
*/
define(function() {
/**
* The Mover is responsible for executing actions within the
* browser environment and managing keypresses.
* Agents should utilize a personal `move` function that should
* be set as the move function of the object created from this
* class.