Skip to content

Instantly share code, notes, and snippets.

View brew's full-sized avatar
🚀
Floating through space

Brook Elgie brew

🚀
Floating through space
View GitHub Profile

Keybase proof

I hereby claim:

  • I am brew on github.
  • I am brew (https://keybase.io/brew) on keybase.
  • I have a public key whose fingerprint is 6F51 C2D7 5F5B 363D 2271 CD77 FC9B C2C6 1A86 0920

To claim this, I am signing this object:

@brew
brew / prepare-commit-msg
Last active August 29, 2015 14:07
Prepend issue number (from branch name) to commit message
#!/bin/sh
#
# Automatically add branch name and branch description to every commit message
# except merge commit.
#
COMMIT_EDITMSG=$1
addBranchName() {
BRANCH_NAME=$(git symbolic-ref --short HEAD)
def altCompileGlyph(font, glyphName, baseName, accentNames, adjustWidth=False, printErrors=True):
"""Compile components into a new glyph using components and anchorpoints.
font: the font
glyphName: the name of the glyph where it all needs to go
baseName: the name of the base glyph
accentNames: a list of accentName, anchorName tuples, [('acute', 'top'), etc]
"""
anchors = {}
errors = {}
baseGlyph = font[baseName]
@brew
brew / example_questionset_schema.js
Last active January 16, 2017 15:28
An example Question Set Schema for Open Data Surveys
[
{
// The question is "Do you like apples?"
"id": "like_apples",
"position": 1,
"defaultProperties": {
"visible": true,
"enabled": true,
"required": true
}
@brew
brew / bash
Created September 12, 2017 12:05
brew@Brooks-iMac(venv:ukds_pilot): ~/virtualenvs/ukds_pilot/src/ukds_pilot on master [!?]
$ data login
? Login with... Github
> Opening browser and waiting for you to authenticate online
> Token and user info saved in `~/.datahub.json`
brew@Brooks-iMac(venv:ukds_pilot): ~/virtualenvs/ukds_pilot/src/ukds_pilot on master [!?]
$ data info core/house-prices-us
(node:20852) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: ENOENT: no such file or directory, lstat 'core/house-prices-us'
(node:20852) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
symbol date price
MSFT Jan 1 2000 39.81
MSFT Feb 1 2000 36.35
MSFT Mar 1 2000 43.22
MSFT Apr 1 2000 28.37
MSFT May 1 2000 25.45
MSFT Jun 1 2000 32.54
MSFT Jul 1 2000 28.4
MSFT Aug 1 2000 28.4
MSFT Sep 1 2000 24.53
@brew
brew / print-psc.csv
Last active September 29, 2017 09:44
ref day month date source article cap_n g4_n serc_n cap_t g4_t serc_t cap_sc g4_sc serc_sc
1 1 1 01/01/2005 0 0 0 0 0 0 0 0 NA NA NA
2 2 1 02/01/2005 0 0 0 0 0 0 0 0 NA NA NA
3 3 1 03/01/2005 0 0 0 0 0 0 0 0 NA NA NA
4 4 1 04/01/2005 6 1 0 0 5 0 0 0 NA NA 8
5 4 1 04/01/2005 6 1 0 0 3 0 0 0 NA NA 8
6 5 1 05/01/2005 0 0 0 0 0 0 0 0 NA NA NA
7 6 1 06/01/2005 9 1 0 2 0 0 0 0 NA 5 NA
8 7 1 07/01/2005 0 0 0 0 0 0 0 0 NA NA NA
9 8 1 08/01/2005 0 0 0 0 0 0 0 0 NA NA NA
We can't make this file beautiful and searchable because it's too large.
id,title,department,starting,closing
10000,Introduce a Penal Colony on the Falkland Isla,Ministry of Justice,2011-08-12 09:34:20,2012-08-17 10:06:09
10005,Tackling Bullying & Homophobia,Department for Education,2011-08-12 09:34:51,2012-08-22 14:38:29
10006,Block Mobile Phone Signals In Schools/Educati,Department for Education,2011-08-12 09:35:00,2012-08-18 14:40:09
10010,"Reduce signatures required to 10,000 for e pe",Office of the Leader of the House of Commons,2011-08-12 09:37:23,2012-05-12 16:22:48
10011,Ban Factory Farming,"Department for Environment, Food and Rural Af",2011-08-12 09:37:50,2012-08-17 13:28:49
10012,Social services to act on parents of looters,Department for Education,2011-08-12 09:37:53,2012-08-25 14:27:58
1002,Give Us Back our Wild Flowers,"Department for Environment, Food and Rural Af",2011-08-03 08:06:20,2012-08-10 11:52:09
1005,Scrap the law which allows only condensing bo,Department for Communities and Local Governme,2011-08-03 09:34:59,2012-08-19 08:57:58
1008,Scap the VAT rate,Her
This file has been truncated, but you can view the full file.
UniqueRecord,FMSFarm,Year,WeeklyWage,API,CPI,FPI,RG,RG_Eq,CensusSizeCategories,AreaFarmed,GrassArea,TotalGrassArea,TotalCropArea,Crop_pcent,Y1wheat,Y2barley,Y3oats,Y4sbeet,Y5pots,Y9eggs,Y10milk,MilkYield_acre,MilkYield_100Conc,MilkYield_100Conc_MA3,O2cereal,O3othcr,O4hortic,O5cattle,O6sheep,O7pigs,O8poultry,O9dairy,Enterprises,P5cattle,P6sheep,P7pigs,P8poultry,AllPurchases,WorkHorses,TotalOutput,GrazingOutput,GrazingOutput_acre,CropOutput,CropOutput_acre,CerealOutput_100_Fert,OtherCrop_100_TotalOutput,CropOutput86,CropOutput86_acre,AnimalOutput,AniOutput_100_Conc,AniOutput_100_Conc_MA3,MaxOutput,TotalNetOutput,Cattle_DairyNetOutput,SheepNetOutput,GrazingNetOutput,GrazingNetOutput_acre,PigsNetOutput,PoultryNetOutput,NetAnimalOutput,NetAniOutput_100_Conc,NetAniOutput_100_Conc_MA3,MaxNetOutput,GrazingOutput86,GrazingOutput86_acre,GrazingNetOutput86,GrazingNetOutput86_acre,AbsLab,I9lab,I1ferts,I2pests,I3miscc,I4seed,I5Conc,I6vet,I7lscosts,I8rent,I10mach_costs,I11bldng,I12drain,I13misc,AverageK,TotalCosts,TotalCos
@brew
brew / farm-survey.json
Created October 5, 2017 10:31
Vega view for a visualisation of Work Horses vs Tractors
{
"width": 800,
"height": 200,
"data": [
{
"name": "farm-survey",
"url": "https://gist.githubusercontent.com/brew/9cd259fda775ad3f7713ca8f2b623aaa/raw/e8c4dc4b2af82032d1c1ffd42ecd6acc2484a74a/farm-survey",
"format": {
"type": "csv",
"parse": {