Skip to content

Instantly share code, notes, and snippets.

Jehiah Czebotar jehiah

View GitHub Profile
@jehiah
jehiah / cyclists_with_cameras_stats_20161123.txt
Created Nov 23, 2016
Cyclists With Cameras stats for my first 339 TLC reports from 2015/10/27 through 2016/11/23
View cyclists_with_cameras_stats_20161123.txt
A follow up to stats for the first 200 at https://on.jehiah.cz/29J6lIX
Violations Cited
# each ∎ represents a count of 4. total 365
no passing zone - NY VTL 1126 [ 1] (0.27%)
(fhv) use/threat physical force - 54-12(g) [ 1] (0.27%)
no tint below 70% - VTL 375(12-a)(b)(2) [ 1] (0.27%)
(fhv) yield sign violation - 54-13(a)(3)(ix) [ 1] (0.27%)
(taxi) improper passing - 55-13(a)(3)(xi) [ 1] (0.27%)
(fhv) threats - 54-12(f) [ 1] (0.27%)
View pivot_csv.py
#!/usr/bin/env python
"""
Pivot a CSV file
$ cat <<EOF | python pivot_csv.py --numeric --headers
> row,column,value
> r1,c1,1
> r1,c2,1
> r1,c1,5
@jehiah
jehiah / cyclists_with_cameras_stats_20160715.txt
Created Jul 16, 2016
Cyclists With Cameras stats for my first 200 TLC reports from 2015/10/27 through 2016/7/15
View cyclists_with_cameras_stats_20160715.txt
A follow up to stats for the first 100 at https://bit.ly/1Se07j7
Violations Cited
# each ∎ represents a count of 3. total 221
no tint below 70 % - VTL 375(12-a)(b) [ 1] (0.45%)
use/threat of physical force - 54-12(g) [ 1] (0.45%)
no passing zone - NY VTL 1126 [ 1] (0.45%)
(fhv) unsafe lane change - 55-13(a)(3)(xii) [ 1] (0.45%)
obstructed license plate - NY VTL 402(b) [ 1] (0.45%)
(taxi) yield sign violation - 54-13(a)(3)(ix) [ 1] (0.45%)
@jehiah
jehiah / check_https_everywhere_duplicate_rulesets.go
Created Jul 6, 2016
check ruleset files in HTTPS-Everywhere for duplicate target definitions
View check_https_everywhere_duplicate_rulesets.go
package main
// This script is designed to check ruleset files in HTTPS-Everywhere for duplicate target definitions
import (
"encoding/xml"
"flag"
"path/filepath"
"io/ioutil"
"log"
@jehiah
jehiah / nsq_testing.go
Created Jun 13, 2016
Interface for testing nsq producers.
View nsq_testing.go
package nsqutils
import (
"sync"
"time"
"github.com/nsqio/go-nsq"
)
// Producer is an interface that nsq.Producer fulfills
View fetchtest.go
package main
import (
"bufio"
"errors"
"flag"
"fmt"
"net/http"
"os"
"sync"
@jehiah
jehiah / pivot_csv.py
Created Nov 30, 2015
Pivot a CSV table.
View pivot_csv.py
#!/usr/bin/env python
import sys
import csv
import tornado.options
from collections import defaultdict
def run():
data = defaultdict(dict)
columns = set()
@jehiah
jehiah / nsq.spec
Created Aug 20, 2015
example RPM specfile for nsq - http://nsq.io/
View nsq.spec
%define name nsq
%define version 0.3.6.alpha
%define release 1
%define path usr/local
%define __os_install_post %{nil}
%define github_account bitly
%define github_project nsq
%define clone_account bitly
%define commit 925f82a0fa7d6abe3652bb31c4834699a8b1c318
@jehiah
jehiah / disabled_nsq_reader.py
Created Jun 12, 2015
A pynsq Reader that polls for a file to transparently enable/disable
View disabled_nsq_reader.py
import os.path
import logging
import tornado.ioloop
from nsq import Reader as BaseReader
from nsq import run
class Reader(BaseReader):
def __init__(self, *args, **kwargs):
max_in_flight = kwargs['max_in_flight']
You can’t perform that action at this time.