Skip to content

Instantly share code, notes, and snippets.

@roberttod
roberttod / ab12-chart-2line.svg
Last active March 12, 2026 23:02
PR 21394 12hr A/B chart (SVG)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@roberttod
roberttod / ab12-rss.csv
Created March 12, 2026 18:28
PR 21394 12hr A/B RSS data
ts coord_main_kb coord_sleepfix_kb sub_main_kb sub_stacked_kb
1773261212 539392 535208 744096 742412
1773261242 589740 640100 806396 792888
1773261272 588252 569700 853168 843268
1773261302 586936 565656 879944 896436
1773261332 595852 577216 907596 960580
1773261362 589532 562084 924932 997228
1773261392 582972 562980 953592 1074000
1773261422 592476 559304 985452 1096988
1773261452 593908 564288 1021872 1162016
@roberttod
roberttod / index-1.js
Last active May 18, 2017 20:50
Tutorial: Node.js authentication
const express = require('express')
const bodyParser = require('body-parser')
const store = require('./store')
const app = express()
app.use(express.static('public'))
app.use(bodyParser.json())
app.post('/createUser', (req, res) => {
store
@roberttod
roberttod / chars.js
Created May 5, 2015 15:30
None base64 chars allowed in cookie
// http://tools.ietf.org/html/rfc6265#section-4.1.1
var allowedChars = [0x21, [0x23, 0x2B], [0x2D, 0x3A], [0x3C, 0x5B], [0x5D, 0x7E]]
var chars = []
allowedChars.forEach(function (range) {
if (!range.length) {
chars.push(String.fromCharCode(range))
return
}
for (var code = range[0]; code < range[1]; code++) {
chars.push(String.fromCharCode(code))
@roberttod
roberttod / index.js
Created April 25, 2014 15:00
requirebin sketch
var $ = require("jquery");
var Router = require("cherrytree");
var Route = require("cherrytree/route");
var HistoryLocation = require("cherrytree/location/history_location");
// for router to keep the app's state in sync with the url
// we need to use a custom location, the default `none` location
// doesn't touch the URL. This allows you implementing your own
// URL manager say if you want to save some space, or you already
// use a framework that can manage URLs like Backbone.
@roberttod
roberttod / cookie-blocking-test.js
Created October 10, 2013 10:29
Test if the cookie is locked during synchronous execution.
@roberttod
roberttod / revert-require-context.js
Last active December 16, 2015 19:09
Change the context of require and then change back again
// Change require to new context
var newRequire = require.config({
context: "new"
});
// Define and then require module under context "new"
define("someModule", [], function () {return "newContext"; });
newRequire(["someModule"], function (something) {console.log(something); });
// Revert back to global context