The Voronoi tessellation shows the closest point on the plane for a given set of points. This example updates the Voronoi diagram in response to mouse interaction! Colors by Cynthia Brewer; algorithm by Steven Fortune; implementation based on work by Nicolas Garcia Belmonte; interaction inspired by Raymond Hill.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>stationary camera</title> | |
<style> | |
.position-select, .execute, .result { | |
display: none; | |
} | |
.execute, .result { | |
margin-top: 20px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
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: