This is a supplement to https://github.com/adventice/census, and contains content you need to make a table with:
- Headings for each value
- Subheadings for each value
Carry out the following to build the table
import psycopg2 | |
database = '' | |
host = 'localhost' | |
port = 5432 | |
user = '' | |
password = '' | |
table = '' |
from PyQt4.QtCore import * | |
from PyQt4.QtGui import * | |
from qgis.core import * | |
coverage = "/Users/joellawhead/qgis_data/atlas/grid.shp" | |
atlasPattern = "/Users/joellawhead/qgis_data/atlas/output_" | |
# Load the map layer. This example uses a shapefile | |
# but you can use any supported QGIS layer. | |
vlyr = QgsVectorLayer(coverage, "grid", "ogr") |
""" | |
Likely not useful to anyone else, but just putting it out there. | |
This script will take a directory of GeoTIFFs and merge them together without issues. | |
This script simply decompresses the files, runs nearblack to remove pseudo-black borders caused by compression, and then uses gdalwarp to stitch the files together. | |
The script is designed to use the minimal amount of disk space possible -- it cleans up each file after decompression and continually merges with a master image. | |
""" | |
import os |
This is a supplement to https://github.com/adventice/census, and contains content you need to make a table with:
Carry out the following to build the table
import os | |
import re | |
regexp = re.compile(r'\.jpg') | |
folder = os.path.expanduser('~/Desktop/photos') | |
for filename in os.listdir(folder): | |
infilename = os.path.join(folder, filename) | |
if regexp.search(filename): | |
oldbase = os.path.splitext(filename) | |
newname = infilename.replace('.jpg', '.jpeg') | |
output = os.rename(infilename, newname) |
#!/bin/bash | |
# ---------------------- | |
# KUDU Deployment Script | |
# Version: 1.0.15 | |
# ---------------------- | |
# Helpers | |
# ------- |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/brianbancroft/.oh-my-zsh | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-zsh is loaded. | |
ZSH_THEME="powerlevel9k/powerlevel9k" |
[user] | |
name = Brian | |
email = hello@brianbancroft.ca | |
name = Brian | |
name = Brian | |
name = --repace-all | |
name = Brian Bancroft | |
[push] | |
default = upstream | |
[branch] |
SELECT( | |
SELECT COUNT(*) | |
FROM regs | |
WHERE invite_sent_at <= NOW() - INTERVAL '10 days' | |
) AS count_users, | |
( | |
SELECT COUNT(*) | |
FROM regs | |
WHERE invite_sent_at <= NOW() - INTERVAL '30 days' | |
) AS count_users, |
def warn(message) | |
puts "\e[#{31}m#{message}\e[0m" | |
end |