Skip to content

Instantly share code, notes, and snippets.

View hoetmaaiers's full-sized avatar

Hoetmaaiers hoetmaaiers

View GitHub Profile

WEB 101 workhop part 1 - prerequisites

If you want to join the first workshop and get your hands dirty in the handson part, ensure the following is ready on your computer:

Import solution

custom-levels/my-level.js

/**
 * Create your level from these building blocks:
 *
 * Legende:
 *   @ = Player start position
 *   o = Coins
@hoetmaaiers
hoetmaaiers / hands-on-promise-solution.md
Last active February 23, 2016 20:58
Promise solution

Promise solution

/**
 * HANDSON Promises: provide more levels to the game
 *
 * We have some cool levels waiting for you at the following urls:
 * - 'http://localhost:8080/levels/basic.json'
 * - 'http://localhost:8080/levels/easy-start.json'
 * - 'http://localhost:8080/levels/hard-to-get-drunk.json'

app.js

// import styles
import '../styles/app.css';

// import dependencies
import { polyfill as promisePolyfill} from 'es6-promise';
import fetch from 'isomorphic-fetch';

Design developer friendly

Zeplin FTW

Icons

  • svg icons please
  • ids / classes voor stijlbare groepen, dit maakt de svg stijlbaar en herbruikbaar
  • wanneer oude browsers (<IE9) moet voor elk icoon ook een .png variant voorzien worden (Zeplin)
@hoetmaaiers
hoetmaaiers / ios-version.js
Created July 7, 2016 12:51 — forked from Craga89/ios-version.js
JavaScript iOS version detection
/*
* Outputs a float representing the iOS version if user is using an iOS browser i.e. iPhone, iPad
* Possible values include:
* 3 - v3.0
* 4.0 - v4.0
* 4.14 - v4.1.4
* false - Not iOS
*/
var iOS = parseFloat(

Run bash inside running container.

docker exec -it CONTAINER_ID /bin/bash

Buliding efficient Dockerfiles for node

@hoetmaaiers
hoetmaaiers / fibonacci-while.js
Created February 9, 2017 15:16
Fibonacci calculations
function fib(end) {
const range = [0, 1];
while (range[range.length - 1] < end) {
const prev = range[range.length - 1];
const prevPrev = range[range.length - 2];
range.push(prev + prevPrev);
}
return range;
@hoetmaaiers
hoetmaaiers / handlebars-helpers.md
Last active September 16, 2017 16:25
Handlebars Helpers

Pluralize or singular string based on a number

Handlebars.registerHelper('pluralize', function(number, singular, plural) {
    if (number === 1) {
        return singular;
    } else {
        return (typeof plural === 'string' ? plural : singular + 's');
    }
});
@hoetmaaiers
hoetmaaiers / spec.md
Last active November 8, 2017 07:22
iCapps - JSON request/response specification

iCapps - JSON request/response specification

Goals

The goal is to specify a consistent api request/repsonse cycle while keeping enough room for project specific implementation.

General rules

  • Every property is always returned in the response, even when null.