I hereby claim:
- I am dwurf on github.
- I am dwurf (https://keybase.io/dwurf) on keybase.
- I have a public key ASDQJHM8GNRuzcosO3uRNIX6hvy5qDyjKLpms2GMATU8vAo
To claim this, I am signing this object:
| #!/usr/bin/env python | |
| # This script opens CONNECTIONS simultaneous connections to a remote socket, | |
| # and sends a fixed string before closing the connection. The process is then | |
| # repeated indefinitely | |
| # Intended to unit test the tcp_server.py script | |
| import asyncore | |
| import socket |
| # Instructions to pre-render OSM tiles: | |
| # Start with a clean Ubuntu Trusty 14.04 host | |
| # Need postgis, importer and tools | |
| sudo apt-get install postgresql-9.3 postgis osm2pgsql gdal-bin npm git curl xmlstarlet python-mapnik unzip | |
| # Fonts | |
| sudo apt-get install ttf-dejavu fonts-droid ttf-unifont fonts-sipa-arundina fonts-sil-padauk fonts-khmeros \ | |
| ttf-indic-fonts-core ttf-tamil-fonts ttf-kannada-fonts | |
| # nginx -- for leaflet UI |
| #!/usr/bin/env python | |
| """Script for sending an email (with an optional file attachment).""" | |
| # Modified from the documentation at | |
| # https://docs.python.org/2/library/email-examples.html | |
| # | |
| # Tested against python 2.6, 2.7 and 3.6 | |
| # | |
| # For help, run this script! |
| .PHONY: run | |
| mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) | |
| pth := $(notdir $(patsubst %/,%,$(dir $(mkfile_path)))) | |
| run: $(pth)/venv | |
| $(pth)/venv/bin/python3 $(pth)/query.py | |
| $(pth)/venv: |
| module https://gist.github.com/dwurf/25d26181b407a58ab8a67e824675e487 |
I hereby claim:
To claim this, I am signing this object:
Version Control is a critical tool in any software development project. Despite this, many of us suffer from a crippling fear of one terrifying event: The Dreaded Merge Conflict. Here I'll show you a risk-free way of merging with an easy way to back out if things go belly up.
You've been working for hours on a bug fix. Your changes were due an hour ago and you've just finished your unit tests. It's time to upload your changes...
c:\dev>git status
# On branch master
| <?php | |
| $connstring = "host=localhost dbname=test user=dwurf password=<secret>"; | |
| $conn = pg_connect($connstring); | |
| $search = ($_GET['term']); | |
| if (!$conn) { die('Could not connect: ' . pg_last_error ());} | |
| else | |
| { | |
| $sql = "SELECT name FROM users_table WHERE name ILIKE '%$search%' ORDER BY name ASC"; |
Docker is a useful abstraction for processes
... each in their own Docker container