Skip to content

Instantly share code, notes, and snippets.

View joejag's full-sized avatar

Joe Wright joejag

View GitHub Profile
joejag / conway3.clj
Created December 17, 2011 12:01
Conways Game of Life with Paul Wilson at Glasgow Code Retreat
(ns coderetreat.conway3
(:use clojure.test clojure.contrib.pprint)
; world is a set of live cells
; find all the neighbours of live cells in the world
; find the frequencies of this big list. i.e. [1 1] 4 // 1,1 has 4 neighbours
; reduce with conway rules, (2 & 3 survives), (3 and dead becomes alive)
; take first element from list (the cell reference)
joejag / cheats.txt
Created April 11, 2012 20:56
VIM Cheatsheet for Joe
* Basic movement: h j k l (left, down,up, right)
* Word movement: w b (next, back) W B (ignore punct)
* Number powered movement: 3w
* Start of line: 0, end $
* Start doc: gg, end: G, line: 6G
* Next page: CTRL+f, Back page: CTRL+b, 1/2 versions: CTRL+d, CTRL+u
* Last postion in another file jumping: CTRL+0, CTRL+TAB (back, forward)
joejag /
Created April 18, 2012 16:18
passwordless ssh
TARGET: ssh-keygen -t rsa
TARGET: chmod 700 ~/.ssh
HOST: cat ~/.ssh/ | ssh user@target 'cat >> ~/.ssh/authorized_keys'
HOST: ssh user@target 'hostname'
VALIDATE: ssh -F svn_no_pass target 'exit' &> /dev/null
file contains:
PasswordAuthentication no
ChallengeResponseAuthentication no
joejag / bob-arch.txt
Created September 10, 2012 21:12
uncle bob: architecture the lost years -- notes
Cucumber is not slow, testing via the UI is.
The web is a dumb detail, it's just a pipe
Architecture on disk reflects the framework, not hte application (like a church/library blueprint)
Archiecture is all about intent
use case == user story (modern)
ControlObject/Interactor objects impl a use case, they have object that are entities
Boundry = inteface/protocol to talk to interactor
joejag / natural.rb
Created September 27, 2012 22:09
Natural Number Additions in Ruby
class NaturalNumberAdditions
def self.for num
def calc num
return [] if num == 1
pairs_for(num) | previous_additions_plus_one(num)
joejag / gist:3861591
Created October 9, 2012 21:31
Agile: A play in 3 iterations
Agile: A Play in 3 Iterations
Let us take you on the journey of our industry, there will be heroes and villans, punch cards and whiteboards. Meet Winston Royce, Martin Fowler, Kent Beck and Jeff Sutherland while in the company of our two loveable developers.
Acts: Waterfall, Manifesto, XP/Scrum, Kanban
Actors in acts
* Waterfall: Winston Royce, A suit from the analyst company (Accenture pun), A suit from the design company (PriceWaterhouseCoopers pun), The Customer, The development pair
* Manifesto: Martin Fowler/Uncle Bob
joejag /
Created October 28, 2012 19:27
Conways Game of Life in CoffeeScript
# Utility methods: Uses Underscore.js
flatten_nested_array = (array) -> _.flatten(array, true) # flattens to one level of nesting
includes = (target, coll) -> _.any(coll, (item) -> _.isEqual(item, target)) # allows for searching for arrays
frequencies = (coll) -> _.countBy(coll, _.identity) # return a map of how many times each element appears in a given list
# Javascript only supports strings as keys for associative arrays. This converts a "1,1" into [1,1]
key_to_array = (string) ->
joejag /
Last active December 8, 2021 10:45
Notes from Non Violent Communication by Marshall B. Rosenberg


Insprired by Gandhi

He told his grandson that violence is more than fighting, beating, killing & wars.

Made him split what he did into "Physcial" and "Passive". With a tree structure. Kept it up to date each day. Passive violence leads to psychical violence.

Words are Windows (or they're Walls)

Chapter 1: Giving From the Heart

joejag /
Last active December 14, 2015 01:09
Git cheatsheet
# Pull without making merge history commits
git pull --rebase
# Push while squashing related commits
git rebase -i @{u}
git push
joejag / jez-value-notes.txt
Last active December 14, 2015 23:28
jez humble - what is value
Was not a product manager, read about Scrum & product management in it.
Scrum says: work out what to build, prioritize & estimate, give feedback shows
Other: Competiive analysis, pricing
No longer a product manager
It's super easy. Once you have an idea, you can get loads of stories. (priortized and esitmated, then actually build it).
Came up with a product over 6 months, got 2 months feedback. Next two years a blur.