Skip to content

Instantly share code, notes, and snippets.

Chris Adams acdha

Block or report user

Report or block acdha

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 ecs-service-targetgroup-twin.yaml
AWSTemplateFormatVersion: 2010-09-09
Description: 'Registers ecs tasks to a second target group'
Parameters:
ClusterArn:
Description: 'ANR of cluster the service resides in'
Type: String
ServiceName:
Description: 'Name of the service to register'
Type: String
ContainerName:
@johnscancella
johnscancella / default.vcl
Last active Apr 11, 2017
varnish config for chronam
View default.vcl
# new 4.0 format.
vcl 4.0;
import directors;
backend app1 {
.host = "ndnpappvlp01.loc.gov";
.probe = {
.url = "/";
.interval = 60s;
View discovery_charter.md

Discovery Support Technical Specifications Group Charter

Introduction

Interoperable resources are only useful if they can be found. This has been well-recognized since the early days of the IIIF community, and more recently it has become clear that a concerted effort to standardize patterns that will facilitate discovery, harvesting and synchronization, indexing, and importing of IIIF resources is required.

This group will create specifications that improve the discovery process for IIIF resources, with a focus on leveraging existing techniques and tools, and promoting widespread adoption within the community. It will assist with and steer the implementation of community infrastructure, such as a registry of adopters, validators for the implementations, and transformation tools to generate the required data from existing systems and APIs.

If successful, the work will enable the collaborative development of global or thematic registries, search engines and portal applications that allow developers a

@acdha
acdha / homebrew-gdal-ctypes.traceback
Created Oct 3, 2016
Traceback from a crash introduced by a recent Homebrew update when Python ctypes tries to load gdal
View homebrew-gdal-ctypes.traceback
Traceback (most recent call last):
File "/Users/cadams/.virtualenvs/wdl/bin/django-admin", line 11, in <module>
sys.exit(execute_from_command_line())
File "/Users/cadams/.virtualenvs/wdl/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
utility.execute()
File "/Users/cadams/.virtualenvs/wdl/lib/python2.7/site-packages/django/core/management/__init__.py", line 328, in execute
django.setup()
File "/Users/cadams/.virtualenvs/wdl/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/cadams/.virtualenvs/wdl/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
@phill-tornroth
phill-tornroth / elasticsearch_backend.py
Last active Nov 11, 2015
A Django-Haystack backend for ElasticSearch 1.x that incorporates the best things I found in the recent master and pull requests, and fixes issues with each
View elasticsearch_backend.py
"""
This is the basis for an elasticsearch 1.x backend I've cobbled together and am continuing
to refine and test for use. It's based on haystack master's version as of:
- https://github.com/toastdriven/django-haystack/blob/cbb72b3253404ba21e20860f620774f7b7b691d0/haystack/backends/elasticsearch_backend.py
But with @HonzaKral and @davedash's work to make the backend behave more like an ES user would expect with regard to doc types:
- https://github.com/toastdriven/django-haystack/pull/921
I also made a number of changes:
- I fixed bugs that I found in #921 (mostly related to mapping synchronization issues),
all of which I wrote up as comments on #921
@jmcnamara
jmcnamara / bench_excel_writers.py
Last active Sep 18, 2019
Benchmark of several Python Excel writing modules
View bench_excel_writers.py
##############################################################################
#
# Simple Python program to benchmark several Python Excel writing modules.
#
# python bench_excel_writers.py [num_rows] [num_cols]
#
#
import sys
from time import clock
@acdha
acdha / pre-commit
Last active Nov 19, 2019
Git pre-commit hook which runs various code linters. Install this to .git/hooks/pre-commit inside your favorite repos
View pre-commit
#!/usr/bin/env PYTHONIOENCODING=utf-8 python
# encoding: utf-8
"""Git pre-commit hook which lints Python, JavaScript, SASS and CSS"""
from __future__ import absolute_import, print_function, unicode_literals
import os
import subprocess
import sys
@willurd
willurd / web-servers.md
Last active Dec 15, 2019
Big list of http static server one-liners
View web-servers.md

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@impressiver
impressiver / raven-config.html
Last active Nov 13, 2019
Raven.js configuration for logging JavaScript exceptions to Sentry (https://getsentry.com/). Without the added ignore options, you'll quickly find yourself swamped with unactionable exceptions due to shoddy browser plugins and 3rd party script errors.
View raven-config.html
<!-- Raven.js Config -->
<script src="{{ JS_PATH }}/lib/raven.js" type="text/javascript"></script>
<script type="text/javascript">
// Ignore list based off: https://gist.github.com/1878283
var ravenOptions = {
// Will cause a deprecation warning, but the demise of `ignoreErrors` is still under discussion.
// See: https://github.com/getsentry/raven-js/issues/73
ignoreErrors: [
// Random plugins/extensions
'top.GLOBALS',
View learning-django.md

Where people struggle learning Django

Over the last 3 years or so I've helped a bunch of companies, small and large, switch to Django. As part of that, I've done a lot of teaching Django (and Python) to people new to the platform (and language). I'd estimate I've trained something around 200-250 people so far. These aren't people new to programming — indeed, almost all of them are were currently employed as software developers — but they were new to Python, or to Django, or to web development, or all three.

In doing so, I've observed some patterns about what works and what doesn't. Many (most) of the failings have been my own pedagogical failings, but as I've honed my coursework and my skill I'm seeing, time and again, certain ways that Django makes itself difficult to certain groups of users.

This document is my attempt at organizing some notes around what ways different groups struggle. It's not particularly actionable — I'm not making any arguments about what Django should or shouldn't do (at least

You can’t perform that action at this time.