Skip to content

Instantly share code, notes, and snippets.

View chrahunt's full-sized avatar

Chris Hunt chrahunt

View GitHub Profile
@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
@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
// ==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==
// ==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
@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
@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 / README.md
Last active May 27, 2018 22:46
Downloading replays from tagproreplays the manual way.

TagProReplays Replay Recovery

To set up the helper script, we need to run it on the background page for the extension. Here's one way to do that:

  1. Navigate to chrome://extensions/

  2. Click on the developer mode checkbox on the top right of the extensions page.

    Step 2

  3. Click on the background page link that should appear underneath the TagProReplays extension entry on the extensions page.

@chrahunt
chrahunt / tagpro-box2d-prediction.js
Created June 29, 2015 14:55
Predict future state in TagPro.
var dt = (1.0 / 60);
var damping = 0.5;
// Scale between Box2d physics and tagpro physics.
var scale = 100;
// Damping factor.
var d = 1 - damping * dt;
/**
* Get predicted velocity along one axis.
* @param {number} v0 - Initial velocity
* @param {number} a - Acceleration
@chrahunt
chrahunt / README.md
Last active August 29, 2015 14:24 — forked from mbostock/.block
@chrahunt
chrahunt / smirk-helper.user.js
Last active August 29, 2015 14:24
Place ABCD 123 icons on smirk.
// ==UserScript==
// @name Smirk Helper
// @include http://tagpro-*.koalabeast.com:*
// @include http://maptest*.newcompte.fr:*
// @include http://tangent.jukejuice.com:*
// @author snaps
// @license MIT
// @version 0.1.0
// ==/UserScript==