Skip to content

Instantly share code, notes, and snippets.

Brock Whitten sintaxi

Block or report user

Report or block sintaxi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sintaxi
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');
})
@sintaxi
sintaxi / regions.txt
Last active May 15, 2019
Surge Regions
View regions.txt
List of regions your project is served from when you deploy using surge.
yyz.surge.sh : 159.203.50.177 : CA : Toronto
jfk.surge.sh : 159.203.159.100 : US : New York
sfo.surge.sh : 138.197.235.123 : US : San Francisco
lhr.surge.sh : 46.101.67.123 : GB : London
ams.surge.sh : 188.166.132.94 : NL : Amsterdam
fra.surge.sh : 138.68.112.220 : DE : Frankfurt
sgp.surge.sh : 139.59.195.30 : SG : Singapore
View glitch-service-worker.js
this.addEventListener('install', function(event) {
event.waitUntil(
caches.open('v1.1').then(function(cache) {
return cache.addAll([
'/style.css',
'/app.js',
'../views/404.html',
'../views/offline.html'
]);
})
@sintaxi
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');
socket.send(input.value);
input.value = '';
}
var socket = new io.Socket(null, {
port: 8001,
@sintaxi
sintaxi / transfer.md
Last active May 1, 2018
Transfering a paid project on surge.
View transfer.md

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
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
sintaxi / hosting-an-event-on-surge.md
Last active Dec 8, 2017
Instructions for hosting an event on surge.sh
View hosting-an-event-on-surge.md

Hosting a competition on surge.sh

...by 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 superevent.io)
  2. Point superevent.io and *.superevent.io DNS records to surges servers.
  3. Add EVENT.json file with the following properties...
@sintaxi
sintaxi / manifest.md
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.
View manifest.md

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.

TL:DR

  • Google’s political bias has equated the freedom from offense with psychological safety, but shaming
View gist:834b6abf6df9b5ae59bf6aff8bbbbb04
#!/bin/bash
curl -sSN http://ffmpeg.org/releases/ffmpeg-3.2.4.tar.bz2 | tar -xjf-
cd ffmpeg-3.2.4
(./configure --help|head -n255|grep -- '--enable-'\
| perl -pe's/.*(--enable-\S+).*/$1/g' | grep -v = # 255: toolchain options
./configure --list-encoders|perl -pe's/\s+/\n/g'|sed 's/^/--enable-encoder=/'
./configure --list-decoders|perl -pe's/\s+/\n/g'|sed 's/^/--enable-decoder=/'
./configure --list-hwaccels|perl -pe's/\s+/\n/g'|sed 's/^/--enable-hwaccel=/'
./configure --list-muxers|perl -pe's/\s+/\n/g'|sed 's/^/--enable-muxer=/'
./configure --list-demuxers|perl -pe's/\s+/\n/g'|sed 's/^/--enable-demuxer=/'
@sintaxi
sintaxi / 🐢.js
Last active Nov 14, 2016
🐢🐢🐢 All the way down.
View 🐢.js
var 🐢 = function(mstr){
if (!mstr) mstr = {}
return function(config){
for (var attr in config) { mstr[attr] = config[attr] }
var obj = scope(mstr)
obj.exec = function(){
// awesome things here
You can’t perform that action at this time.