Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Hornbake alexhornbake

View GitHub Profile
@alexhornbake
alexhornbake / headers-timeout-keep-alive.js
Created Aug 20, 2020
reproduce nodejs keep-alive bug
View headers-timeout-keep-alive.js
// Client that can reproduce https://github.com/nodejs/node/issues/27363
// modified from https://gist.github.com/shuhei/4098a648a969deb38aad2164bc387148
const http = require("http");
const net = require("net");
function startClient(port) {
const socket = net.createConnection({ port });
let responseCount = 0;
socket.on("data", (chunk) => {
@alexhornbake
alexhornbake / golang-2-error-proposal-refuse.md
Last active Jun 10, 2019
Golang 2 proposal. Refuse. A conditional return keyword.
View golang-2-error-proposal-refuse.md

refuse - a mini-proposal for conditional returns. This is an alternative proposal for try, check, check/handle.

So we want to simplify things like:

1: err, thing := newThing(name)
2: if err != nil {
3: 	return nil, err
4: }
View index.html
<!DOCTYPE html>
<html>
<head>
<title>boxpusher</title>
<style>
body {
margin: 0;
height: 100%;
overflow: hidden
}
@alexhornbake
alexhornbake / index.html
Last active Sep 24, 2017
push pop mechanic
View index.html
<!DOCTYPE html>
<html>
<head>
<title>pusher</title>
<style>
.tile {
width: 4%;
padding-bottom: 4%;
display: inline-block;
margin: 5px;
View keybase.md

Keybase proof

I hereby claim:

  • I am alexhornbake on github.
  • I am alexhornbake (https://keybase.io/alexhornbake) on keybase.
  • I have a public key whose fingerprint is D462 175C 4B29 C55E 86E9 001F 49A4 3C6B BF6D 240D

To claim this, I am signing this object:

@alexhornbake
alexhornbake / gist:4277348f8b3ab5f7a917
Created Apr 21, 2014
fetch m3u8... follow redirect and fetch segments from akamai
View gist:4277348f8b3ab5f7a917
m3u8Url=$1
masterM3u8=$(curl -L "$m3u8Url" | grep -m1 http)
token=$(echo \""$m3u8Url" | grep -o hdnea.*)
echo $token
echo "fetching... ""$masterM3u8""&""$token"
segments=$(curl -c cookies.txt "$masterM3u8""&""$token" | grep http)
i=0
while read -r line; do
@alexhornbake
alexhornbake / index.html
Last active May 18, 2020
Generate Path for Curly Bracket
View index.html
<html>
<title>Curly Bracket</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>
.curlyBrace {
stroke: #000000;
stroke-width: 10px;
@alexhornbake
alexhornbake / fb_parse_location.py
Last active Dec 19, 2015
Mapping Facebook Friend Locations and Connections
View fb_parse_location.py
# Script to strip longitude and latitude data from friend list and coorelate with mutual friends
# Intentionally remove any identifying info before writing to file.
# Author: achornbake , 7/13/2013
# Facebook Data exported using "Give me my Data App" by Ownen Mundy http://owenmundy.com/site/give-me-my-data
import sys
import json
from pprint import pprint
f_data=open('friend_data.json')
@alexhornbake
alexhornbake / chapter7.js
Last active Dec 19, 2015
Shortest Route Hiva 'Oa Map
View chapter7.js
// Visualization of the Hiva 'Oa map in chapter 7 of
// 'Eloquent Javascript' by Marijn Haverbeke
// see original example at http://eloquentjavascript.net/
// for more detail on everything below noted as "Original example from text" in chapter7.js
//BEGIN ORIGINAL EXAMPLE FROM TEXT
var roads = {};
function makeRoad(from, to, length)
{
You can’t perform that action at this time.