Skip to content

Instantly share code, notes, and snippets.

View swinton's full-sized avatar
:bowtie:

Steve Winton swinton

:bowtie:
View GitHub Profile
#!/usr/bin/env python
import sys
from django.template.defaultfilters import slugify
print slugify(sys.stdin.readline())
@swinton
swinton / requirements.txt
Created July 8, 2014 16:25
Grab some text from a random, featured Wikipedia page. Useful for testing.
pyquery==1.2.4
@swinton
swinton / sublime-settings.json
Created July 16, 2014 18:03
My Sublime Text 2 settings
{
"auto_complete": false,
"close_windows_when_empty": false,
"color_scheme": "Packages/Color Scheme - Default/Solarized (dark).tmTheme",
"draw_white_space": "all",
"find_selected_text": true,
"fold_buttons": true,
"folder_exclude_patterns":
[
".svn",
@swinton
swinton / My darling mother.md
Last active October 12, 2015 18:28
Letter, from 1945, written by my Grandad, whilst hospitalized, shortly after being liberated by US troops at the end of World War II.

18/4/45

No 12 Ward,
Stoke Mandeville ?MS Hospital
Aylesbury
Bucks

My darling mother,

It must be about six months now since you last heard from me, but now that I am home again in dear Old England you will hear more often. I am in this hospital for recouperation, as I was so run down with disentry through bad usage while in German hands, and not only that, we have been on a long march over a thousand kilometres, starting on January 23rd and being recaptured on the 12 April by the 9th American Army at Brunswick, but I had already been admitted into hospital on the 11th.

@swinton
swinton / villager.pde
Last active August 29, 2015 14:05
Minecraft villager. First Processing sketch, by Annabelle, aged 9. (I helped a little).
background(#ffffff);
size(400, 400);
// body
rect(276, 186, -127, 212);
rect(100, 186, 230, 73);
rect(100, 186, 230, 55);
// head
rect(276, 45, -127, 141);

Principles of Calm Technology

  1. Require the least amount of cognitive overhead

    A tea kettle can be set and forgotten, until it sings. It does not draw constant attention to itself until necessary. A tea kettle's whistle brings information from another room to one's attention.

  2. Provide information without distraction

An inner office window provides an understanding of whether someone is busy or not without the need to interrupt them.

@swinton
swinton / homework.md
Last active August 29, 2015 14:06
Coding to learn :: Homework, week 1

Task 1

Read the snippet of code below. Can you explain what is going on? How would you use this code to get the person's age?

// A person 'object'
var person = {};

// The person's date of birth (a date 'object')
person.dob = new Date("September 15, 1984");
@swinton
swinton / google-refine-operation-history.json
Created October 29, 2014 16:42
Google Refine history log that transposes a tweets.csv archive into a CSV that can be imported into Google Calendar.
[
{
"op": "core/column-addition",
"description": "Create column Start Date at index 4 based on column timestamp using expression grel:value",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "Start Date",
@swinton
swinton / config.txt
Last active December 22, 2015 20:41
Example PHP web app for downloading a document from Igloo using their API.
CONFIG_API_APP_APIVERSION: 1
CONFIG_API_APP_ID: e829896b-0c31-488c-93c1-33952ebad173
CONFIG_API_APP_PASS: familiar-foreign-deeply-tube
CONFIG_API_COMMUNITY: resources.bluezonesproject.com
CONFIG_API_PASSWORD: BlueZonesAPIAdmin943!
CONFIG_API_USERNAME: bluezonesprojectusa@healthways.com
var _ = require("underscore");
// A 2-dimensional array of jokes
var jokes = _.shuffle(
[
[
"Why did Santa's helper see the doctor?",
"Because he had a low \"elf\" esteem!\n"
],
[