Skip to content

Instantly share code, notes, and snippets.

import assert from 'assert';
function sendClockIn(gpsAvailability) {
return new Promise((resolve, reject) => {
gpsAvailability
.then(resolve)
.catch(reject);
});
}
@wolframkriesing
wolframkriesing / wrong-config-use.js
Last active March 17, 2016 11:21
Code for the config/deps article
if (development) {
console.log('just for devs');
} else {
callTheRealThing();
}
import assert from 'assert';
import {assertThat, instanceOf, throws} from 'hamjest';
class MyError extends Error {
constructor(...args) {
super(...args);
}
}
function throwingFunction() {
@wolframkriesing
wolframkriesing / index-spec.js
Created February 21, 2016 10:21
workshop part #1
var assert = require('assert');
var hamjest = require('hamjest');
var promiseThat = hamjest.promiseThat;
var isRejectedWith = hamjest.isRejectedWith;
var KATAS_URL = 'http://katas.tddbin.com/katas/es6/language/__grouped__.json';
var INVALID_URL = 'http://katas.tddbin.com/katas/es6/language/__all__.json';
var fetch = require('node-fetch');
function loadKatasJsonFrom(url) {
// doing the above kata with the crewmeister team, yeah
const text = 'Four score and seven years ago our fathers brought forth upon this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal';
const maxCharactersPerLine = 13;
const SEPARATOR = ' ';
const splitUpIntoWords = (s) => s.split(SEPARATOR);
const joining = (line) => line.join(SEPARATOR);
const textFormatter = () => {
@wolframkriesing
wolframkriesing / test.rake
Last active February 8, 2016 08:10
rake DSL as it should be?
# Tasks are defined using the DSL like this `task :name ....`
# But for a task that execute tests I can only find this piece of code everywhere on the web
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList['test/test*.rb']
t.verbose = true
end
# should it not be something like this

====== Socrates Canaries 2016 ====== ===== International Software Craftsmanship Gathering ===== ==== Gran Canaria, March 10 - 13, 2016 ===

SoCraTes Canaries is a non-profit, international Software Craftsmanship retreat for open-minded craftspeople who strive to improve their craft and the software industry as a whole, organised by the local Software Cratfsmanship comunity in the Canary Islands.

SoCraTes is an [[http://en.wikipedia.org/wiki/Open_Space_Technology|Open Space]] and it's totally community-focused. In an open space there is no agenda and there are no speakers before the event starts. Proposals are presented during the event itself in the mornings, and voted by the participants right after. The agenda is created on the fly. It’s a great opportunity to speak to and code with many like-minded and talented developers in an incredible venue by the beach.

This event is not a hackaton and it's not about a particular technology, a library or a programming language. It's more about

@wolframkriesing
wolframkriesing / MonetaryAmount.js
Last active October 23, 2015 13:56
Value Object in JavaScript, or non-primitve value
const valueSymbol = Symbol('value');
class MonetaryAmount {
constructor(value) {
this[valueSymbol] = value;
}
add(amount) {
return new MonetaryAmount(amount.value + this.value);
}
equal(amount) {
return amount.value == this.value;

Journeyman tour

As usual the [catmatic] unconf [socrates15] was a great source of inspiration. This time especially around the idea of doing a journeyman-style work.

Start the tour (idea)

It was actually the first dinner at SoCraTes, when I spread the word about me looking for new work (since we are closing down uxebu as a company). Someone mentioned that [Nicole] did this in London, she went to work with five companies for two days each, and ended up working at one of them. That started things for me. At that time I was still looking for the right new job, but quickly realized that I can actually do the journeyman thingy too. Why not just go and work with teams a bit and find out what we can learn from each other. Now that SoCraTes is already over for a couple of days, I had been telling people about the idea, outside of the SoCraTes environment and got mainly positive feedback. Now it is only a matter of executing it.

Spread the idea

/* global require, describe, it */
var assert = require('assert');
const URL_PREFIX = 'http://katas.u/katas/es6/language/';
const KATAS_URL = `${URL_PREFIX}__grouped__.json`;
describe('load ES6 kata data', function() {
it('loaded data are as expected', function(done) {
function onSuccess(groupedKatas) {
assert.ok(groupedKatas);