Skip to content

Instantly share code, notes, and snippets.

James McKinney jpmckinney

View GitHub Profile
@jpmckinney
jpmckinney / README.md
Last active Nov 30, 2019
Compare differences after making changes to Sphinx
View README.md

Written as part of https://github.com/open-contracting/standard_profile_template/issues/33

curl -O https://gist.githubusercontent.com/jpmckinney/ba38d531e245c175e254ea3bc4218001/raw/bbb015f613ba936b3b42f25c576e833d196e5181/diff-reduce.py
python diff-reduce.py
diff -rq build t | grep Only | sort
diff -ru -x '*.js' -x '.buildinfo' -x '_sources' build t | less
View framework-agreement-tmp-paraguay.json
{
"tender": {
"title": "Adquisición de Útiles de Oficina",
"id": "355477-adquisicion-utiles-oficina",
"procuringEntity": {
"id": "50",
"name": "Dirección Nacional de Contrataciones Públicas (DNCP)"
},
"procurementMethod": "open",
"procurementMethodDetails": "Licitación Pública Nacional",
@jpmckinney
jpmckinney / README.md
Created Jul 20, 2019
Test the performance of approaches to flattening JSON to CSV.
View README.md

simple-one-table.py

Building a dict by reference is faster than recursively building a dict (slowest) or list of tuples.

dict:

return {key: obj}
…
d = {}
View translate_markdown.py
import gettext
import os
import re
import sys
from collections import OrderedDict
from docutils import frontend
from docutils import nodes
from docutils.parsers import rst
from docutils.utils import new_document
@jpmckinney
jpmckinney / character-class.rb
Created Feb 14, 2017
Character class to match encoding errors
View character-class.rb
/[¡¢£¤¥¦§¨©ª¬­®¯°±²³´µ¶·¸¹º¼½¾¿ÂÃÅËŒœŠšŸŽžƒˆ˜‘‚„†‡•…‰‹›€™]/
@jpmckinney
jpmckinney / digital-government-networks.md
Last active Jan 31, 2017
Online and informal intergovernmental networks
View digital-government-networks.md

Slack communities

@jpmckinney
jpmckinney / _readme.md
Last active Feb 3, 2017
Languages used by government GitHub repositories
View _readme.md

These files list government GitHub repositories, and the number of bytes of code written in each language.

Produced by running the languages:github Rake task from open_source_canada against the list of 'U.S. City' and 'U.S. Federal' GitHub organizations. Data for Canadian GitHub organizations is elsewhere.

@jpmckinney
jpmckinney / index.html
Last active Jul 16, 2016
Side-by-side comparison of draft versus final Canada OGP National Action Plan 2016-18.
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.text
{
width: 50%;
float: left;
font: 300 16px/23px Helvetica,Arial,sans-serif;
}
del, .del
View dataportal.json
{
"language": "en",
"title": "Paris Data",
"description": "City of Paris Open Data portal",
"homepage": "http://opendata.paris.fr/",
"modified": "2016-03-04T13:44:44+00:00",
"conformsTo": "https://example.com/v1.0/schema",
"number_of_datasets": 176,
"publisher":{
"name": "City of Paris",
@jpmckinney
jpmckinney / .block
Last active Jun 29, 2020
WeWork Place Ville-Marie Mac OS X Printing Instructions
View .block
license: cc-by-4.0
You can’t perform that action at this time.