Skip to content

Instantly share code, notes, and snippets.

View adborden's full-sized avatar

Aaron D Borden adborden

View GitHub Profile
---
- hosts: all
roles:
- pathagar
@adborden
adborden / setup-cf-api.sh
Created October 17, 2016 23:54
Working with multiple cloud foundry APIs
#!/bin/bash
set -e
function usage () {
echo "$0: <api_name> <api_endpoint>"
echo "example:"
echo " $0 govcloud https://api.fr.cloud.gov"
}
@adborden
adborden / gist:766d7e61333d3dc0eb7e44970d40d788
Created October 12, 2016 20:10
cg-style `npm run watch` runs over itself
> cloudgov-style@1.4.2 gem-clone-https /home/adborden/projects/cg/cg-style
> npm run gem-clean && git clone --depth=1 https://github.com/18F/cg-style-gem.git ./gem
Receiving objects: 17% (24/136), 412.00 KiB | 117.00 KiB/s
> cloudgov-style@1.4.2 gem-clean /home/adborden/projects/cg/cg-style
> rm -rf ./gem
Receiving objects: 18% (25/136), 492.00 KiB | 121.00 KiB/s
> cloudgov-style@1.4.2 svg /home/adborden/projects/cg/cg-style
> gulp --gulpfile build/gulpfile.js svg-sprite
============================= test session starts ==============================
platform linux -- Python 3.4.5, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
rootdir: /home/adborden/projects/fec/pytest-crash, inifile:
collected 1 items
test_pytest_crash.py
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/adborden/.pyenv/versions/3.4.5/envs/pytest-crash/lib/python3.4/site-packages/_pytest/main.py", line 96, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/home/adborden/.pyenv/versions/3.4.5/envs/pytest-crash/lib/python3.4/site-packages/_pytest/main.py", line 131, in _main
@adborden
adborden / label-setup.sh
Last active March 6, 2018 15:26
Quick setup for labels
#!/bin/bash
# gem install ghi (https://github.com/stephencelis/ghi)
set -o errexit
set -o pipefail
skills=(angular build-infrastructure campaign-finance copy design html-css jekyll js ruby sysadmin)
skill_color="#fef2c0"
features=(candidate committee contributions data historic-election multi-city page referendum search usability)
@adborden
adborden / Code.gs
Created August 28, 2016 22:16
Turn google spreadsheet into a JSON API
function doGet(request)
{
var spreadsheetId = 'YOUR SPREADSHEET ID HERE';
var sheetId = request.parameters.sheet || 0;
// Get data from the sheet
var sheet = getSheet(spreadsheetId, sheetId);
var dataArray = getData(sheet);
// Normalize the headers
@adborden
adborden / export_repo_issues_to_csv.py
Created September 27, 2015 17:43 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
"""
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 requests
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6NLvk0tA6eKYLvC7GMFJ+AtEe+enGS88BUGYp0tXYDudlVHRrrrUAuHgRtqcDfS0aYID/YQxBfDXvPUNhua0UFapGpoA2Hp/t5BN4Qvlae7eXcAmq8lQ/yZ368lm4upsN0OFDsx2E3oTrlhUxy+GePqZKEtt8e3NBrbgNJJA6jhXdcG4Iwk4vTKVKIiH7rTEXa96XI6+8e4bBsx53kNSc1m/5k4FlM7fIOxJK+P/lDIlgkAyHb8td6GPuTt8eiwv/zzIP+JrHjk9blf7BAnNBDYbHv69gul8FBRFZL5NF7yPYn9PoIFBTplnkV0ztahMzOUdUZm2jl+Dy2BHuJtql adborden@shift
@adborden
adborden / connect2_api.py
Created July 2, 2015 04:17
Fetch transaction ids for F460A and F460E, fetch 2015 transactions for SFEC
import json
import csv
import sys
import itertools
from swaggerpy.client import SwaggerClient
CONNECT2_SPEC = "https://netfile.com/Connect2/api/resources"
class Connect2API(object):
fibrous = require 'fibrous'
fs = require 'fs'
stream = require 'stream'
{spawn} = require 'child_process'
# the process
stdout = new stream.PassThrough()
# our code