Skip to content

Instantly share code, notes, and snippets.

View chrahunt's full-sized avatar

Chris Hunt chrahunt

View GitHub Profile
@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 / 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
// ==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
// 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.
*/
@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) {
@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);
// ==UserScript==
// @name Fake Some Ball
// @namespace http://reddit.com/user/snaps_
// @description Better faking Some Ball. Never a name overlapped.
// @include http://tagpro-*.koalabeast.com:*
// @include http://maptest*.newcompte.fr:*
// @include http://tangent.jukejuice.com:*
// @license MIT
// @author snaps
// @version 0.1.0
@chrahunt
chrahunt / listen.html
Last active January 7, 2016 03:38
Add speech recognition to TagPro.
<!DOCTYPE html>
<html>
<head></head>
<body>
<script>
console.log("Listener: Loading page.");
var TAGPRO_URLS = [
"http://tagpro-\\w*\\.koalabeast\\.com:\\d+",
"http://tagpro.gg:\\d+",

Chapter 1 - Introduction

Focus questions: What is an OS and what does it do? How should we evaluate OSs and what are some of the trade-offs their designers face? What is the history of OSs and what new functionality will we see in future OSs?

1.1 Fact: Operating Systems solve problems that may be faced in many different situations. As such, the techniques, design patterns, and methods of dealing with these problems, and the complexity of the operating system itself, may be found useful in any large software application.

@chrahunt
chrahunt / Code.gs
Created May 30, 2016 05:56
Maps API in Google Sheets
var Properties = PropertiesService.getScriptProperties();
/**
* Return rate-limited function under specified delay.
* @param {Function} fn The function to wrap.
* @param {string} domain The domain under which to apply the delay.
* @param {number} delay Time (in ms) between successive calls.
* @return {Function} The function to call.
*/
function RateLimited(fn, domain, delay) {