Skip to content

Instantly share code, notes, and snippets.

View MikeBild's full-sized avatar
🏠
Working from home

Mike Bild MikeBild

🏠
Working from home
View GitHub Profile
@MikeBild
MikeBild / mob_res
Last active August 29, 2015 13:59
Mobile Resolutions
Icons
Android
small (ldpi): 36 x 36
medium (mdpi): 48 x 48
large (hdpi): 72 x 72
xlarge (xhdpi): 96 x 96
xxlarge (xhdpi): 144 x 144
App-Store: 512 x 512
iOS
eventsource
.fromStreams(['os'], 'statistics')
.run({
$init: function(state){
state.count = 0;
return state;
},
$completed: function(state){
return state;
},
@MikeBild
MikeBild / tryGetWithPromise.js
Last active August 29, 2015 14:08
AngularJS tryGet(url)
<!doctype html>
<html data-ng-app="myApp">
<head>
<meta charset="utf-8">
<title>Try Get</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.0-beta.13/angular.min.js"></script>
</head>
<body data-ng-controller="demoCtrl">
<script>
@MikeBild
MikeBild / gist:031e88dd5af0d5c9f9b2
Created January 8, 2015 08:54
Mocha integration tests example
'use strict';
var assert = require('assert'),
restify = require('restify');
var client = restify.createJsonClient({
version: '*',
rejectUnauthorized: false,
url: 'https://127.0.0.1:8080',
headers: {'x-auth-token':'66LOHAiB8Zeod1bAeLYW'}
/*
# jquery.couch.longpoll.js #
A handler that can be used to listen to changes from a CouchDB database,
using long-polling.
This seemed to be a bit simpler than using continuous polling, which I
was unable to get working with jQuery.
@MikeBild
MikeBild / async-either-with-promise.js
Last active November 10, 2018 15:40
Async Railway Oriented Programming in JS
#!/bin/env node
//thx to http://fsprojects.github.io/Chessie/a-tale-of-3-nightclubs.html
Promise.all([
suitablePersonEnterGayBar(),
unsuitablePersonEnterGayBar(),
])
.then(result => result.map((person, i) => `Person ${i+1}: ${person.cost || ''}${person.reasons.join(' ')}`))
.then(result => console.log(`Person entries\n${result.join('\n')}`));
/* empty */
@MikeBild
MikeBild / microservice-workflows.md
Last active November 1, 2016 17:11
Microservice Workflows mit Consumer-Driven-Contracts

Microservice Workflows mit Consumer-Driven-Contracts

Allen voran geht es mir um die Vereinfachung der Softwareentwicklung auch auf Systemebene. Ich meine die folgenden Artikel zeigen zumindest mittel- und langfristig genau das Gegenteil und sind ein gutes Beispiel ausufernder Systemlandschaften durch selbstverschuldet aufgesetzte Komplexität.

Wer Microservice richtig richtig macht, braucht keine Workflow Engine, kein BPMN, kein ESB, kein Message Broker, keine Aktor-Modelle und Frameworks, keine Enterprise Application Server, kein Event-Sourcin

@MikeBild
MikeBild / order-line.task.js
Last active December 12, 2015 14:39
Order Line API
const request = require('request-promise');
state.orders = state.orders || [];
this.GET = getOrders;
this.POST = startOrderProcess;
this.DELETE = abortOrder;
if(!this[req.method]) return res.status(404).end();
this[req.method](req.params, req.body);
@MikeBild
MikeBild / archive.tpl-ejs.html
Last active December 30, 2015 07:23
mikebild.com
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Mike Bild - Archive</title>
<link rel="stylesheet" href="mikebild.css" type="text/css" />
<link rel="stylesheet" href="pygment_trac.css" type="text/css" />