Skip to content

Instantly share code, notes, and snippets.

View gabrielgrant's full-sized avatar

Gabriel Grant gabrielgrant

View GitHub Profile
import requests
zips = "59221, 73949, 86515, 42223, 86044, 84536, 97635, 02861, 71749, 81137, 63673, 88063, 89439".split(', ')
url = 'https://congress.api.sunlightfoundation.com/districts/locate?apikey=4356d7e2b68340a69fb9b5e156e9cd49&zip='
for z in zips:
r = requests.get(url + z).json()['results']
print z, r
@gabrielgrant
gabrielgrant / adapters.application.js
Last active March 26, 2022 20:54
Firebase hasMany
import FirebaseAdapter from 'emberfire/adapters/firebase';
export default FirebaseAdapter.extend({
});
@gabrielgrant
gabrielgrant / README.md
Created October 25, 2021 14:14
Simple example of Astro's upcoming v0.21 (v2 compiler) failing to serve a the minimal template

Repro steps:

$ npm init astro

# select Minimal

$ git add .
$ git commit -m "Init minimal Astro structure"
$ npm install astro@next--compiler
@gabrielgrant
gabrielgrant / controllers.application\.js
Last active June 11, 2020 22:19
persistent mapbox markers MCVE
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
const center = {lng: 79.3832, lat: 43.6532};
function generateModel() {
return Array(3).map(pt => ({
lng: center.lng + Math.random() / 10,
import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
export default class ApplicationController extends Controller {
queryParams = ['projects', 'roles'];
@tracked projects = [];
@tracked roles = [];
}
@gabrielgrant
gabrielgrant / submit_gh_issues.py
Created December 17, 2019 12:31
Script to submit a list of issues to GH that have been collected in a single text file
#!/usr/bin/env python
"""
Submit a list of issues to GH
Issues are separated by two blank lines (three newline characters)
The first line is used as the title
"""
# py2/3 compat
@gabrielgrant
gabrielgrant / testapp.py
Created February 9, 2012 01:43
Simple wsgi streaming response
pip install gunicorn
gunicorn testapp:app
[
[ 1, 2, 3, 4, 5],
[ 6, 7, 8, 9, 10],
[11, 12, 13, 14, 15],
[16, 17, 18, 19, 20],
[21, 22, 23, 24, 25]
]
#! /bin/bash
set -e
usage() {
echo "
Usage:
$0 <base NodePort> BASE_MANIFEST
Takes BASE_MANIFEST (which should be the JSON result of
// all measurements in inches, because AMERICA
function main () {
// standard 4" sewer pipe
const innerRadius = 4/2;
const outerRadius = 4.215/2;
const length = 20 * 12; // by "6m" i assume you mean 20ft?
return difference(
circle({r: outerRadius, center: true}),