Skip to content

Instantly share code, notes, and snippets.

View chrahunt's full-sized avatar

Chris Hunt chrahunt

View GitHub Profile
@chrahunt
chrahunt / imjv-75-singleschema.js
Last active August 29, 2015 14:22
Demonstration for issue #75 in is-my-json-valid.
var _schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://jsonschema.net",
"type": "array",
"items": {
"id": "http://jsonschema.net/user",
"type": "object",
"properties": {
"_id": {
"id": "http://jsonschema.net/user/_id",
@chrahunt
chrahunt / tagpro-stabilizer-trainer.user.js
Last active April 21, 2016 04:19
Example stabilizer learning bot. Tries to center self on bottom middle tile of OFM map.
// ==UserScript==
// @name TagPro Stabilizer Bot Trainer
// @description Stabilize your ball perfectly on a square.
// @version 0.1
// @include http://tagpro-maptest.koalabeast.com:*
// @include http://tangent.jukejuice.com:*
// @include http://*.newcompte.fr:*
// @require https://raw.githubusercontent.com/karpathy/reinforcejs/master/lib/rl.js
// @require https://github.com/eligrey/FileSaver.js/raw/master/FileSaver.min.js
// @require https://gist.github.com/chrahunt/4843f0258c516882eea0/raw/loopback.user.js
// ==UserScript==
// @name TagPro Team Switcher
// @namespace http://reddit.com/user/snaps_
// @description Switch Teams Fast
// @include http://tagpro-*.koalabeast.com:*
// @include http://maptest*.newcompte.fr:*
// @include http://tangent.jukejuice.com:*
// @downloadURL https://gist.github.com/chrahunt/0212e8517a7e6974eeb0/raw/tagpro-team-switcher.user.js
// @resource switch_icon http://i.imgur.com/aryEWao.png
// @resource switch_back_icon http://i.imgur.com/m5H2595.png
// ==UserScript==
// @name Don't Kick Me, tagpro!
// @description Prevent getting kicked due to being AFK (or busy) on
// map test server.
// @include http://tangent.jukejuice.com:*
// @author snaps
// @license MIT
// @version 0.1.0
// ==/UserScript==
@chrahunt
chrahunt / tagpro-follow-helper.user.js
Last active August 29, 2015 14:19
TagPro Player Following Helper
// ==UserScript==
// @name TagPro Follow Helper
// @namespace http://reddit.com/user/snaps_
// @description Follow the Flag Carrier, or someone else, automatically!
// @include http://tagpro-*.koalabeast.com:*
// @include http://maptest*.newcompte.fr:*
// @require https://gist.github.com/chrahunt/4843f0258c516882eea0/raw/loopback.user.js
// @downloadURL https://gist.github.com/chrahunt/c1fcc842a96ef0e22b45/raw/tagpro-follow-helper.user.js
// @license MIT
// @author snaps
@chrahunt
chrahunt / se-image-paste.user.js
Last active December 30, 2021 11:50
Add image-pasting capability to StackEdit markdown editor.
// ==UserScript==
// @name StackEdit Image Extension
// @namespace http://chri.sh/
// @version 0.4.1
// @description Add image-pasting capability to StackEdit editor.
// @author chrahunt
// @match https://stackedit.io/editor
// @run-at document-end
// @grant none
// @downloadURL https://gist.github.com/chrahunt/c27686b095a390c26ff8/raw/se-image-paste.user.js
/*
* TagPro Neomacro | UserScript by Popcorn.
* ========================================
* Are you tired of overly complex chat macro systems? Have you forgotten whether you bound "Yes" to I or U?
* This is Neomacro -- TagPro macro system that uses arrow keys, ctrl and 0 (zero) (you use WASD to control
* the game, don't you?) to create powerful and easy-to-remember macro codes.
*
* 1.0 update: Redesigned some macros, be sure to take a look.
* 1.1 update: Simplified code, added more comments
* 1.2 update: Goodbye, backspace and ctrl+something!
@chrahunt
chrahunt / spawn-timer.user.js
Created March 10, 2015 01:30
Show time remaining before a player respawns.
// ==UserScript==
// @name Respawn Timer
// @description Show time remaining before a player respawns.
// @include http://tagpro-*.koalabeast.com:*
// @include http://maptest*.newcompte.fr:*
// @include http://tangent.jukejuice.com:*
// @downloadURL https://gist.github.com/chrahunt/b61ae05c3531c3d940f2/raw/spawn-timer.user.js
// @author snaps
// @license MIT
// @version 0.1.0
@chrahunt
chrahunt / background.js
Created March 5, 2015 01:38
Chrome extension for testing chrome.storage.local.
(function(window, document, undefined) {
var Storage = {};
window.Storage = Storage;
Storage.tracking = true;
Storage.track = function() {
Storage.tracking = !Storage.tracking;
if (Storage.tracking) {
console.log("Tracking storage performance.");
var falafel = require('falafel');
var escodegen = require('escodegen');
var test = '(' + function() {
for (;;) true;
} + ')()';
var output = falafel(test, function(node) {
node.update(escodegen.generate(node));
});