Skip to content

Instantly share code, notes, and snippets.

John J Czaplewski jczaplew

Block or report user

Report or block jczaplew

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
jczaplew /
Last active Apr 23, 2019
tqdm with multithreading
from tqdm import *
from queue import Queue
from threading import Thread
import time
class WorkerThread(Thread):
def __init__(self, queue):
View cancelable.js
class Cancelable {
constructor() {
this.canceled = false
count(val) {
return new Promise((resolve, reject) => {
setTimeout(function() {
}, 1000)
jczaplew / test.sql
Created Dec 14, 2017
PostGIS Multipolygon Join
View test.sql
This file has been truncated, but you can view the full file.
-- PostgreSQL database dump
-- Dumped from database version 9.6.4
-- Dumped by pg_dump version 9.6.4
SET statement_timeout = 0;
SET lock_timeout = 0;
jczaplew / index.html
Created Aug 24, 2017
Supercluser + tilestrata + Mapbox GL JS
View index.html
<!DOCTYPE html>
<meta charset='utf-8' />
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src=''></script>
<link href='' rel='stylesheet' />
body { margin:0; padding:0; }
jczaplew /
Created Jan 25, 2017
Install mapnik 3.+ on Ubuntu 14.04 Trusty
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update && sudo apt-get install gcc-4.9 g++-4.9
rm /usr/bin/g++ && sudo ln -s /usr/bin/g++-4.9 /usr/bin/g++

Keybase proof

I hereby claim:

  • I am jczaplew on github.
  • I am johnjcz ( on keybase.
  • I have a public key whose fingerprint is 8FB0 0594 B47A F27F 890D 5EE6 969F F71E 2039 17F8

To claim this, I am signing this object:

Adapted from and
12 January 2017
John J Czaplewski
def xProduct(v0, v1, v2):
dx1 = v1[0] - v0[0]
dy1 = v1[1] - v0[1]
jczaplew /
Created Nov 28, 2016
Auto import csv to Postgres
import csv
import sys
import subprocess
with open(sys.argv[1], 'rb') as csvfile:
reader = csv.reader(csvfile)
header_row =
cmd1 = "psql -U you dbname -c 'CREATE TABLE " + sys.argv[2] + " ("
for idx, column in enumerate(header_row):
View fix_trump.js
document.querySelector('#g-model-promo.hp-promo-ccol .g-trump .g-label').style.float = 'none'
document.querySelector('#g-model-promo.hp-promo-ccol .g-trump .g-label').style.position = 'absolute';
document.querySelector('#g-model-promo.hp-promo-ccol .g-trump .g-label').style.right = '-5px'
jczaplew / Data.txt
Created Apr 13, 2016
PostGIS vs shapely union
View Data.txt
Download this -
You can’t perform that action at this time.