Skip to content

Instantly share code, notes, and snippets.

Patrick Fuller patrickfuller

Block or report user

Report or block patrickfuller

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
View grid_maker.py
"""
Create a custom grid-paper design as a minified vector image.
This uses a unique adaptation of "stroke-dasharray" to create the grid
pattern in a very small svg.
Usage:
python grid_maker.py > grid.svg
python grid_mater.py --help
@patrickfuller
patrickfuller / alias_dns.py
Last active Jun 30, 2019
Enables local DNS resolution of Unifi aliases
View alias_dns.py
"""
When run in cron, automatically adds compliant alias names to local DNS.
Use at your own risk.
Patrick Fuller, 25 June 17
"""
import re
import paramiko
import pymongo
@patrickfuller
patrickfuller / github_issues_to_csv.py
Last active Jun 4, 2019 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
View github_issues_to_csv.py
"""
Exports issues from a list of repositories to individual csv files.
Uses basic authentication (Github username + password) to retrieve issues
from a repository that username has access to. Supports Github API v3.
Forked from: unbracketed/export_repo_issues_to_csv.py
"""
import argparse
import csv
from getpass import getpass
import requests
@patrickfuller
patrickfuller / zn_bdc_dabco.cif
Created Jul 23, 2015
Zn-BDC-DABCO Conformers
View zn_bdc_dabco.cif
#######################################################################
#
# This file contains crystal structure data downloaded from the
# Cambridge Structural Database (CSD) hosted by the Cambridge
# Crystallographic Data Centre (CCDC).
#
# Full information about CCDC data access policies and citation
# guidelines are available at http://www.ccdc.cam.ac.uk/access/V1
#
# Audit and citation data items may have been added by the CCDC.
@patrickfuller
patrickfuller / regex.md
Created Jun 27, 2015
Python single quote replacement
View regex.md

The goal is to replace individual double quotes " with single quotes ' without affecting docstring triple double quotes """.

%s/([^"])"([^"])/$1'$2/g
@patrickfuller
patrickfuller / pre-commit
Last active Aug 29, 2015
SCSS compilation pre-commit hook
View pre-commit
#!/bin/bash
# When SCSS is changed in a commit, this compiles and commits the affected css.
# This script assumes a project directory of the form:
# main.scss
# main.css
# scss
# | file_1.scss
# | ...
# | file_n.scss
@patrickfuller
patrickfuller / sample_output.txt
Created Jan 7, 2015
Modbus Holding Register Scanner
View sample_output.txt
40001: 0000110000000001
40002: 0000100000000001
40003: 0000000000000000
40004: 0000000000000000
40005: 0000000000000000
40006: 0000000000000000
40007: 0000000100000010
40008: 0000000000011100
40009: 0100001010001011
40010: 0101100111101011
@patrickfuller
patrickfuller / comparison.py
Last active May 21, 2017
Compares tornado.auth.GoogleMixin with tornado.auth.GoogleOAuth2Mixin. The latter is required after google's OAuth updates.
View comparison.py
"""
A webserver to test Google OAuth in a couple of scenarios.
"""
import argparse
import time
import tornado.ioloop
import tornado.web
import tornado.auth
import tornado.gen
@patrickfuller
patrickfuller / image_stacker.py
Created Mar 30, 2014
Combines multiple images of the same size into a composite image.
View image_stacker.py
"""
Combine multiple images of the same size vertically. Usage:
python image_stacker.py path/to/img_1.jpg path/to/img_2.jpg ... img_n.jpg
"""
import sys
from PIL import Image
size = (1920, 1080 * len(sys.argv[1:]))
output = Image.new('RGB', size)
for i, image in enumerate(sys.argv[1:]):
@patrickfuller
patrickfuller / Fe-MIL-100.cif
Last active Jan 4, 2016
A really large P1 crystal.
View Fe-MIL-100.cif
# CIF file generated by openbabel 2.3.90, see http://openbabel.sf.net
data_I
_chemical_name_common ''
_cell_length_a 73.3402
_cell_length_b 73.3402
_cell_length_c 73.3402
_cell_angle_alpha 90
_cell_angle_beta 90
_cell_angle_gamma 90
_space_group_name_H-M_alt 'P 1'
You can’t perform that action at this time.