Skip to content

Instantly share code, notes, and snippets.

View paulsmith's full-sized avatar
😀
Hi, friends

Paul Smith paulsmith

😀
Hi, friends
View GitHub Profile
import Text exposing (..)
import Color exposing (..)
import Graphics.Element exposing (..)
import Graphics.Collage exposing (..)
import List
import Time exposing (Time, fps, timestamp)
import Signal exposing ((<~))
main =
let
@paulsmith
paulsmith / README.md
Last active August 29, 2015 14:19
Latency and packet loss report

If you are experiencing poor or degrading home network performance, it's good to come armed with evidence when talking with your friendly neighborhood ISP.

Usage:

From your cable or DSL modem, find out the gateway, aka your ISP's router between you and them. Usually you can just run netstat -rn and the entry next to destination==0.0.0.0 is the gateway. (Be sure to be plugged directly into your modem, not going through your WiFi router, or you'll just be getting the gateway of your internal private network, which will be the WiFi router itself.) Armed with that IP address, log a few hours worth of ping(8) to a file, and then run ping_report.sh on it.

$ ping -D <gwipaddress> | tee ping.log
# wait a few hours
@paulsmith
paulsmith / scrape.py
Last active August 29, 2015 14:18
scrape april 7 2015 chicago mayoral runoff election results
from __future__ import print_function
from collections import namedtuple
import csv
import sys
import time
from urllib import urlopen
from bs4 import BeautifulSoup
package drum
import (
"bytes"
"encoding/binary"
"fmt"
"io"
"os"
"strconv"
"strings"
@paulsmith
paulsmith / Makefile
Last active May 29, 2016 20:00
Chicago 2015 mayoral election results by precinct
all: results.csv
results.csv: scrape.py
python $< > $@.tmp
mv $@.tmp $@
clean:
-rm -f results.csv
.PHONY : clean
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@paulsmith
paulsmith / chicago-2015-mayoral-election-results-by-precinct.csv
Created February 25, 2015 18:14
Chicago 2015 mayoral election (2015-02-24) results by precinct
ward precinct candidate votes
1 1 Rahm Emanuel 61
1 1 Willie Wilson 5
1 1 Robert W. Fioretti 11
1 1 Jesus "Chuy" Garcia 115
1 1 William Walls, III 2
1 2 Rahm Emanuel 55
1 2 Willie Wilson 10
1 2 Robert W. Fioretti 12
1 2 Jesus "Chuy" Garcia 107
diff --git a/funcs.h b/funcs.h
index 5780af7..d99a5da 100644
--- a/funcs.h
+++ b/funcs.h
@@ -18,7 +18,7 @@ namespace funcs {
#include "funcs/if.h"
#include "funcs/array.h"
#include "funcs/sort.h"
-#include "funcs/reverse.h"
+//#include "funcs/reverse.h"
@paulsmith
paulsmith / Makefile
Last active October 5, 2022 09:26
Simple integer sum function, JIT'ed with the LLVM C API
CC=clang
CXX=clang++
all: sum
sum.o: sum.c
$(CC) -g `llvm-config --cflags` -c $<
sum: sum.o
$(CXX) `llvm-config --cxxflags --ldflags --libs core executionengine jit interpreter analysis native --system-libs` $< -o $@