Skip to content

Instantly share code, notes, and snippets.

View afternoon's full-sized avatar

Ben Godfrey afternoon

View GitHub Profile
@afternoon
afternoon / dashboard.js
Created May 19, 2014 16:15
Show a report of progress on Jira epics from a rapid board
#!/usr/bin/env node
var request = require('request-promise'),
Table = require('cli-table');
var jiraUrl = 'http://jira.yourcompany.com', // change this
rapidViewId = 1, // get this from the rapid board URL
url = jiraUrl + '/rest/greenhopper/1.0/xboard/plan/backlog/epics?rapidViewId=' + rapidViewId,
interestingEpics = []; // add epic IDs to restrict what's included
var progressBar = function (percentageCompleted) {
@afternoon
afternoon / wlhn-20140226-task3.elm
Last active August 29, 2015 13:56
Task 3 from West London Hack Night Feb 26 2014
-- DOES NOT COMPILE
import String (toInt, toList)
data Node = Op String Node Node | Value Int
listToInt l = case toInt (join "" l) of
Just x -> x
tokeniseOp hd tl tokenAccum partialAccum =
@afternoon
afternoon / wlhn-20140226-task1.elm
Created February 26, 2014 23:21
Task 1 from West London Hack Night Feb 26 2014
import List
import String (toList, words, lines, length)
text = """Four loko cred dreamcatcher, blog cliche umami Cosby sweater before
they sold out bitters drinking vinegar. Keytar four loko occupy, gastropub
keffiyeh Pitchfork paleo. Small batch ennui irony pop-up narwhal tousled
sustainable meh Thundercats gastropub, bicycle rights Echo Park sartorial.
Next level hoodie seitan, scenester Portland 3 wolf moon Neutra master
cleanse art party. Pour-over yr distillery, McSweeney's chambray pickled
brunch salvia. Dreamcatcher Bushwick polaroid viral asymmetrical chia. Ennui
@afternoon
afternoon / test.ts
Last active August 29, 2015 13:56
TypeScript references for a test spec
/// <reference path="module.ts" />
/// <reference path="angularjs/angular-mocks.d.ts" />
/// <reference path="angular-protractor/angular-protractor.d.ts" />
/// <reference path="jasmine/jasmine.d.ts" />
@afternoon
afternoon / definitions.ts
Last active August 29, 2015 13:56
A few example type definitions
// FastClick - courtesy of https://gist.github.com/yaakaito/6267527
interface FastClickStatic {
attach(element: HTMLElement): void;
}
declare var FastClick: FastClickStatic;
// add a custom Jasmine matcher to the standard set
// the matcher requires a momentjs object, so let's enforce that
// TypeScript module and interface definitions are open, so can be extended
declare module jasmine {
@afternoon
afternoon / compile_ts.sh
Created February 15, 2014 18:06
Compile all TypeScript files with tsc
find app/src -name '*.ts' | xargs tsc
@afternoon
afternoon / add_references.sh
Created February 15, 2014 18:06
Add TypeScript references to .ts files
find app/src -path '*/js/*/*.ts' -and -not \( -path '*/js/*/*.spec.ts' -or -path '*/js/*/*.scenario.ts' \) -exec sed -i '1i/// <reference path="../../../../../references/module.ts" />' {} \;
find app/src -path '*/js/*/*.spec.ts' -exec sed -i '1i/// <reference path="../../../../../references/test.ts" />' {} \;
find app/src -path '*/js/*.scenario.ts' -exec sed -i '1i/// <reference path="../../../../references/test.ts" />' {} \;
@afternoon
afternoon / module.ts
Last active August 29, 2015 13:56
TypeScript references for an Angular module
/// <reference path="angularjs/angular.d.ts" />
/// <reference path="hammerjs/hammerjs.d.ts" />
/// <reference path="moment/moment.d.ts" />
/// <reference path="lodash/lodash.d.ts" />
@afternoon
afternoon / references.ts
Last active August 29, 2015 13:56
TypeScript references
/// <reference path="angularjs/angular.d.ts" />
/// <reference path="angularjs/angular-mocks.d.ts" />
/// <reference path="jasmine/jasmine.d.ts" />
@afternoon
afternoon / rename_js_files.sh
Created February 15, 2014 18:04
Rename .js files to .ts
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;