Skip to content

Instantly share code, notes, and snippets.

@jajeffries
jajeffries / main.py
Created February 18, 2021 19:03
Python North West 18/2/21
# examples.py
def example1(a: int):
return a + 1
print(example1(2))
print(example1("hello"))
def example2(a: int):
return a * 3
@jajeffries
jajeffries / git-kata-notes.md
Created August 16, 2016 12:34
Notes from XP Manchester Git Kata

git kata notes

prefer git pull --rebase to git pull

git config --global alias.up "pull --rebase"

git up

git commit --amend change last commit

@jajeffries
jajeffries / tdd_framework.js
Created March 2, 2016 13:00
TDD your own test framework
// Tests
function testATestHasRun() {
var wasRun;
test(function () {
wasRun = true;
});
return wasRun;
}
@jajeffries
jajeffries / channels.js
Last active August 29, 2015 14:27
Sort of CSP channels in javascript
// channels.js is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// channels.js is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
@jajeffries
jajeffries / gist:91a8db821ac7ce7a47b3
Created February 24, 2015 09:08
Simple javascript template caching
// Simply call getTemplate with the name of your template. Templates should be stored in the DOM using:
// <script type='text/html' id='tmpl-YOU_TEMPLATE_NAME'>...</script>
(function () {
var _templates = {};
function loadTemplate(templateName) {
var templateId = "#tmpl-" + templateName,
$template = $(templateId);
_templates[templateName] = $template.html();
$template.remove();
create
(Joey:Man:Character {name:'Joey'}),
(Chandler:Man:Character {name: 'Chandler'}),
(Ross:Man:Character {name: 'Ross'}),
(Rachel:Woman:Character {name: 'Rachel'}),
(Phoebe:Woman:Character {name: 'Phoebe'}),
(Monica:Woman:Character {name:'Monica'}),
(DavidSchwimmer:Actor {name:'David Schwimmer'}),
(CourtneyCox:Actor {name:'Courtney Cox'}),
(MattLeBlanc:Actor {name:'Matt Le Blanc'}),