Skip to content

Instantly share code, notes, and snippets.


Brock Whitten sintaxi

View GitHub Profile
sintaxi / server.js
Created Apr 8, 2011
a simple reverse proxy using Node
View server.js
var http = require("http"),
util = require("util")
http.createServer(function(req, rsp){
var regex = /^\/(v1|v2)/g
var matches = req.url.match(regex)
if((matches && matches[0] === "/v1") || (req.headers["x-api-version"] === "v1"))
var port = 8001
sintaxi / regions.txt
Last active Mar 28, 2022
Surge Regions
View regions.txt
List of regions your project is served from when you deploy using surge. : : CA : Toronto : : US : New York : : US : San Francisco : : GB : London : : NL : Amsterdam : : DE : Frankfurt : : SG : Singapore
sintaxi / test.js
Created Sep 2, 2013
trying to spawn a child process as root user without being prompted in main script.
View test.js
// test by running `node test.js`
var spawn = require("child_process").spawn
var child = spawn("sudo", [__dirname + "/bin/server"])
child.stderr.on('data', function (data) {
child.stdin.write("somepassword" + '\n');
View gist:4d6e1026165e1e89ff2527f77bbe1bec
System information commands
(*) #su Show only errors and warnings: `dmesg --level=err,warn`
(*) View dmesg output in human readable format: `dmesg -T`
(*) Get an audio notification if a new device is attached to your computer: `dmesg -tW -l notice | gawk '{ if ($4 == "Attached") { system("echo New device attached | espeak") } }`
(*) Dmesg: follow/wait for new kernel messages: `dmesg -w`
(*) The proper way to read kernel messages in realtime.: `dmesg -wx`
(*) Query graphics card: `lspci -nnk | grep -i VGA -A2`
sintaxi / application.js
Created Apr 21, 2011
simple chat client using redis pub/sub
View application.js
var q= function(s){ return document.getElementById(s) }
function send(){
var input = q('text');
input.value = '';
var socket = new io.Socket(null, {
port: 8001,
View gist:d5d3fbd0e2dbce1d6b347d68778255af
exports.encode = function(txt){
return JSON.stringify({a: "hello world"}).replace(/^\{\"a\"\:\"/, "").replace(/\"\}$/, "")
exports.decode = function(line){
return JSON.parse('{"a": "' + line + '"}')["a"]
View glitch-service-worker.js
this.addEventListener('install', function(event) {
event.waitUntil('v1.1').then(function(cache) {
return cache.addAll([
sintaxi /
Last active May 1, 2018
Transfering a paid project on surge.

Begin by making sure both parties are on latest version of surge

npm install -g surge

Current Owner does this...

  1. Add user as collaborator by inviting them on your next deployment.
sintaxi /
Last active Dec 8, 2017
Instructions for hosting an event on

Hosting a competition on adding an EVENT.json file to the root of your project.

Hosting an event on surge is very simple. It's three easy steps.

  1. Publish a project to Surge to your root domain (eg. surge ./myproject
  2. Point and * DNS records to surges servers.
  3. Add EVENT.json file with the following properties...
sintaxi /
Created Aug 5, 2017
The following is an unverified copy of an internal document circulated at a well known tech company. The author is unknown.

Reply to public response and misrepresentation

I value diversity and inclusion, am not denying that sexism exists, and don’t endorse using stereotypes. When addressing the gap in representation in the population, we need to look at population level differences in distributions. If we can’t have an honest discussion about this, then we can never truly solve the problem. Psychological safety is built on mutual respect and acceptance, but unfortunately our culture of shaming and misrepresentation is disrespectful and unaccepting of anyone outside its echo chamber. Despite what the public response seems to have been, I’ve gotten many personal messages from fellow Googlers expressing their gratitude for bringing up these very important issues which they agree with but would never have the courage to say or defend because of our shaming culture and the possibility of being fired. This needs to change.


  • Google’s political bias has equated the freedom from offense with psychological safety, but shaming