Skip to content

Instantly share code, notes, and snippets.

Avatar

Jackie Kazil jackiekazil

View GitHub Profile
@jackiekazil
jackiekazil / postgis_hb_error
Created Apr 5, 2014
Problem installing gdal & postgis with homebrew -- configure: error: could not find proj_api.h
View postgis_hb_error
jkazil@jlk:~ $ brew install postgis
==> Installing dependencies for postgis: liblwgeom, gdal
==> Installing postgis dependency: liblwgeom
==> Downloading http://download.osgeo.org/postgis/source/postgis-2.1.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/liblwgeom-2.1.1.tar.gz
==> Downloading https://gist.github.com/dakcarto/7458788/raw/8df39204eef5a1e5671828ded7f377ad0f61d4e1/postgis-config_strip-pgsql.diff
Already downloaded: /Library/Caches/Homebrew/liblwgeom--patch-3d93c9ede79439f1c683a604f9d906f5c788c690.diff
==> Patching
patching file configure.ac
==> ./autogen.sh
View export_repo_issues_to_csv.py
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import csv
import sys
import requests
@jackiekazil
jackiekazil / foia-core-setup
Last active Aug 29, 2015
foia-core setup
View foia-core-setup
--------------------------
Project setup
--------------------------
clone repo
brew install python3
mkvirtualenv --python=/usr/local/bin/python3 foia-core
cd ~/Project/code/foia/foia-core
View gist:46c27fd2e73228322078
flake8
django-debug-toolbar
ipython
@jackiekazil
jackiekazil / django-jinja-integration-error
Created Aug 22, 2014
Django jinja integration error
View django-jinja-integration-error
Environment:
Request Method: GET
Request URL: http://localhost:8000/
Django Version: 1.6.5
Python Version: 3.4.1
Installed Applications:
('django.contrib.admin',
View Python
def parse_abbr_from_name(name_abbr):
''' Function to parse the abbreviation from the name '''
try:
name, abbr = name_abbr.strip(')').split('(')
# If there are no '( )', then only one value will return, which
# means that there is no abbreviation, there is only a name.
except ValueError:
name = name_abbr
abbr = None
View settings.sublime
{
"auto_complete": false,
"caret_style": "solid",
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
"*.pid",
@jackiekazil
jackiekazil / extract_008_15_17.py
Created Aug 21, 2012
Simple demo of map_xml feature of pymarc library & comparing country value in folder of marc xml to records in django db
View extract_008_15_17.py
'''
Demo of an implementation of the pymarc library found here:
http://pypi.python.org/pypi/pymarc/
What does this script do?
Returns a list of country counts in a folder of Marc xml records &
coorsponding records that exist in the current database. This is used to help
understand how close the Marc xml records are to the existing ChronAm dataset.
To run this file: python extract_cntry_from_worldcatrecs.py $path_to_bib_folder
@jackiekazil
jackiekazil / pre-commit
Created Oct 15, 2012 — forked from spulec/pre-commit
Yipit Pre-commit Hook
View pre-commit
#!/usr/bin/env python
import os
import re
import subprocess
import sys
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)')
CHECKS = [
View runner.py
"""
An alternative Django ``TEST_RUNNER`` which uses unittest2 test discovery from
a base path specified in settings, rather than requiring all tests to be in
``tests`` module of an app.
If you just run ``./manage.py test``, it'll discover and run all tests
underneath the ``TEST_DISCOVERY_ROOT`` setting (a path). If you run
``./manage.py test full.dotted.path.to.test_module``, it'll run the tests in
that module (you can also pass multiple modules).