Skip to content

Instantly share code, notes, and snippets.

View bruntonspall's full-sized avatar

Michael Brunton-Spall bruntonspall

View GitHub Profile
@bruntonspall
bruntonspall / boxstarter.ps1
Last active March 8, 2019 19:32 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <[email protected]>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@bruntonspall
bruntonspall / 7 sins of microservices
Last active August 29, 2015 14:23
DevOxx 2015 Notes
* Twin definitions of µServices. adrianco's and James Lewis's
* Monoliths might be faster to develop and deploy. Get business model verified, then worry about the architecture.
## Lust
* Suggesting that lust is about developers wanting one of every new tech, and therefore going to microservices because it's new and shiney. Referencing the Mckinley blog post about choosing boring technology.
* Turn up to organisations and ask why are you using tech X, dont know is often the asnwer
*
## Gluttony
* Lots of different protocols, message queues etc.

Life after human error

  • Dr Steven Shorrock
  • Can we move on from this idea?
  • Psychologist, why talk on human error
  • Your systems are highly business critical, and increasingly safety critical
  • Studied human error for 6 years for PhD and after
  • Came to conlusion he doesn't know what human error anymore
  • Someone did something they weren't supposed to do according to someone else.
  • 80% of plane crashs, 90% of road accidents, 70% of data breachs
  • People can hold 7 +- 2 items
@bruntonspall
bruntonspall / 01-keynote.md
Last active January 3, 2020 11:52
Pycon UK 2014

Keynote

It's successes

10 years ago, python was still an esoteric language - paul graham's python paradox, the best language to learn is one that you don't want to learn for a job, but for the enjoyment of it. Today python is one of the biggest langauges.

CTO magazine says Python is a solid enterprise choice.

Increasingly popular is various places, animation pipelines, etc.

@bruntonspall
bruntonspall / gist:4038400
Created November 8, 2012 12:05
Get star ratings from the guardian content api
baseUrl="http://content.guardianapis.com/search?tag=tone%2Freviews&section=technology&format=json&show-fields=starRating"
pagef="&page=%d"
for i in range(200):
j = json.loads(''.join(urllib2.urlopen(baseUrl+pagef % (i+1)).readlines()))
reviews = [(item['id'],item['fields'].get('starRating')) for item in j['response']['results'] if item['fields'].get('starRating')]
for id,rating in reviews:
d[rating] = d.get(rating, []) + [id]
sorted([(k, len(v)) for k,v in d.items()])
@bruntonspall
bruntonspall / javaish.scala
Created September 1, 2011 19:21
Scala Samples
for(i <- 1 to 10) {
if (isSocketOpen) return
Thread.sleep(duration/10)
}
sys.error("Timed out")
@bruntonspall
bruntonspall / better.scala
Created April 12, 2011 10:10
This morning I turned ugly.scala into better.scala - still looking for a best.scala though
val optContacts = person.expand[BasicDBList]("contacts.pending")
for {
contacts <- optContacts;
contact <- contacts
if contact.isInstanceOf[DBObject]
pendingContact = contact.asInstanceOf[DBObject]
if pendingContact.expand[String]("contactId").get == contactId
} {
// Do stuff on contact and update mongo
}
@bruntonspall
bruntonspall / runtest.sh
Created January 20, 2011 15:43
How I run perf tests repeatably with records of what I did
#!/bin/bash
#Set Defaults
requests=${requests:=10}
threads=${threads:=1}
url=${url:=http://testserver/}
while getopts "r:t:u:h" Option
do
case $Option in
@bruntonspall
bruntonspall / gist:788063
Created January 20, 2011 15:39
Connecting your local master to an origin so git pull works
(gnm60091 test_runs/page…oser :+)% git branch --set-upstream master origin/master
Branch master set up to track remote branch master from origin.
(gnm60091 test_runs/page…oser :+)%
@bruntonspall
bruntonspall / gist:769421
Created January 7, 2011 12:54
Convert pip download cache into normal files
for fname in *;
do
mv $fname $(echo $fname | sed -e 's/%2F/\//g' -e 's/.*\///');
done