Skip to content

Instantly share code, notes, and snippets.

@ebuckley
ebuckley / goodtest.component.spec.ts
Last active October 2, 2017 22:07
Fast tests are the best
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { By } from '@angular/platform-browser';
import { NO_ERRORS_SCHEMA } from '@angular/core';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
Code Review Checklist
Understand the change
Read Pull Request description and Ticket
Functional Test
Does it work from a clean install?
Does it solve the problem and satisfy the AC?
(Green Path) Does everything work if you go through the intended steps?
(Red Path) Does the application help you and make sense when things go wrong?
@ebuckley
ebuckley / gist:fe86d02552fd487c0829
Last active August 29, 2015 14:03
Daily programmer
/**
* Daily programmer weekly challenge http://www.reddit.com/r/dailyprogrammer/comments/2a3pzl/weekly_1_handling_console_input/
*/
package main
import (
"bufio"
"log"
"os"
"strconv"
require 'net/http'
require 'json'
#hamilton RegionId
hamilton = 16
waikato = 14
# make a query to the Residential endpoiint of the trademe search api
#
# @param argument_hash Hash
set nocompatible
set list nolist
inoremap jj <esc>
runtime bundle/pathogen.vim
silent! call pathogen#helptags()
silent! call pathogen#runtime_append_all_bundles()
filetype plugin indent on
syntax on
@ebuckley
ebuckley / gist:6254097
Created August 16, 2013 22:39
Template for nz programming competition
# template for starting a programming contest question
# shortcuts
import pprint
printer = pprint.PrettyPrinter(indent=4)
pp = printer.pprint
def do_work(data):
""" after reading a file data is passed into this function"""
@ebuckley
ebuckley / prettyprintpythonchortcut
Last active December 20, 2015 04:59
Just a handy little pattern
# shortcuts
import pprint
printer = pprint.PrettyPrinter(indent=4)
pp = printer.pprint
@ebuckley
ebuckley / gist:1842461
Created February 16, 2012 05:55
python code to encode/decode morse code
morseAlphabet ={
"A" : ".-",
"B" : "-...",
"C" : "-.-.",
"D" : "-..",
"E" : ".",
"F" : "..-.",
"G" : "--.",
"H" : "....",
"I" : "..",