Skip to content

Instantly share code, notes, and snippets.

View chrahunt's full-sized avatar

Chris Hunt chrahunt

View GitHub Profile
@chrahunt
chrahunt / edit.js
Created October 4, 2015 20:27
edit tagproreplay for -salt-
var fs = require('fs');
if (process.argv.length !== 3) {
console.log("Usage:\n node edit.js myreplayfile.txt");
} else {
var filename = process.argv[2];
console.log("filename: " + filename);
var data = fs.readFileSync(filename, { encoding: "utf8" });
data = JSON.parse(data);
@chrahunt
chrahunt / mm-test.js
Last active September 29, 2015 20:08
// Just run with node mm.js and a file "ids.txt" is generated in the same directory.
var https = require('https');
var fs = require('fs');
var submission_id = "3lhmxs";
// Last comment id on comment list, if any.
var cutoff_comment_id = "cv7cbxs";
var link = "https://www.reddit.com/r/millionairemakers/comments/" + submission_id + ".json?sort=old";
https.get(link, function (res) {
// tagpro startup helpers.
(function () {
/**
* EventEmitter interface.
* Events:
* - ready: tagpro.ready
* - start: tagpro object exists
* - spectating: joined as spectator
* - join: joined game as player, or from spectator mode.
*/
// ==UserScript==
// @name Rolling 300 Timeline
// @description Shows your Rolling 300 Timeline & Streaks (using official game data) on your chosen server homepage.
// @version 1.7.0
// @include http://*.newcompte.fr*
// @include http://tagpro*.koalabeast.com*
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_addStyle
// @updateURL https://gist.github.com/nabbynz/23a54cace27ad097d671/raw/TagPro_Rolling300Timeline.user.js
@chrahunt
chrahunt / tagpro-capture-capture.user.js
Last active January 12, 2016 20:33
Script for NLTP ReGrab.
// ==UserScript==
// @name TagPro Capture Capture
// @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:*
// @downloadURL https://gist.github.com/chrahunt/990a5792a22acd260120/raw/tagpro-capture-capture.user.js
// @require https://gist.github.com/chrahunt/4843f0258c516882eea0/raw/loopback.user.js
// @require https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js
// @license MIT
@chrahunt
chrahunt / stationary-replays.html
Last active August 29, 2015 14:27
Make replays stationary.
<!DOCTYPE html>
<html>
<head>
<title>stationary camera</title>
<style>
.position-select, .execute, .result {
display: none;
}
.execute, .result {
margin-top: 20px;
@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==
@chrahunt
chrahunt / README.md
Last active August 29, 2015 14:24 — forked from mbostock/.block
@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 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.