Skip to content

Instantly share code, notes, and snippets.

View jpmckinney's full-sized avatar

James McKinney jpmckinney

View GitHub Profile
@jpmckinney
jpmckinney / README.md
Created July 20, 2019 02:50
Test the performance of approaches to flattening JSON to CSV.

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 = {}
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 February 14, 2017 02:01
Character class to match encoding errors
/[¡¢£¤¥¦§¨©ª¬­®¯°±²³´µ¶·¸¹º¼½¾¿ÂÃÅËŒœŠšŸŽžƒˆ˜‘‚„†‡•…‰‹›€™]/
@jpmckinney
jpmckinney / digital-government-networks.md
Last active January 31, 2017 22:38
Online and informal intergovernmental networks

Slack communities

@jpmckinney
jpmckinney / _readme.md
Last active February 3, 2017 16:27
Languages used by government GitHub repositories

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 July 16, 2016 20:27
Side-by-side comparison of draft versus final Canada OGP National Action Plan 2016-18.
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.text
{
width: 50%;
float: left;
font: 300 16px/23px Helvetica,Arial,sans-serif;
}
del, .del
{
"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 June 29, 2020 16:34
WeWork Place Ville-Marie Mac OS X Printing Instructions
license: cc-by-4.0
@jpmckinney
jpmckinney / sso-rails-provider.patch
Last active February 16, 2016 19:41
See https://github.com/rishabhp/sso-rails-provider/issues/3. The repo also ran `rails g devise:install`, `rails g devise:views` and `rails g devise User`, which aren't shown in the diff to keep it small.
diff --git b/Gemfile a/Gemfile
index 257a263..4896a34 100644
--- b/Gemfile
+++ a/Gemfile
@@ -43,4 +43,12 @@ group :development do
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
+
+ gem 'pry'
diff --git b/Gemfile a/Gemfile
index 37bc11c..17145fa 100644
--- b/Gemfile
+++ a/Gemfile
@@ -45,3 +45,7 @@ group :development do
gem 'spring'
end
+gem 'omniauth'
+gem 'omniauth-oauth2'