Skip to content

Instantly share code, notes, and snippets.

View mkulke's full-sized avatar

Magnus Kulke mkulke

View GitHub Profile
var amountFn, chart, dateFn, format, lineGn, svg, x, y;
format = d3.time.format("%Y-%m-%d");
chart = {};
amountFn = function(d) {
return d.remaining_time;
};
_initChart: function() {
var amountFn, chart, dateFn, format, lineGn, path, svg, x, y;
format = d3.time.format("%Y-%m-%d");
chart = {};
amountFn = function(d) {
return d.remaining_time;
};
dateFn = function(d) {
return format.parse(d.date);
};
@mkulke
mkulke / casperjs_scraping
Created January 13, 2014 22:32
scraping with casperjs and functional utility belt
_ = require 'underscore'
casper = require('casper').create()
utils = require('utils')
curry2 = (fn) ->
(arg2) ->
(arg1) ->
@mkulke
mkulke / books_wishlist.md
Last active August 29, 2015 14:05
PE books wishlist.

PE book wishlist

  • Goetz, Brian: Java Concurrency in Practice, Boston, Mass. 2006.
  • Fifield, Tom et al: Openstack Operations Guide, Sebastopol, CA. 2014.
  • Basil, Keith et al: OpenStack Architecture Design Guide, PoD (http://www.lulu.com) 2014.
  • Chase, Nick et al: OpenStack Architecture Design Guide, PoD (http://www.lulu.com) 2014.
  • Fogus, Michael: Functional JavaScript. Introducing functional Programming with Underscore.js, Sebastopol, CA 2013.
  • Tanenbaum, Andrew S. and Van Steen, Maarten: Distributed Systems. Principles and Paradigms, 2nd Ed., Upper Saddle River, NJ 2006.
  • Freeman, Adam: Pro AngularJS, New York, NY 2014.
  • Richardson, Leonard et al: RESTful Web APIs, Sebastopol, CA. 2013.
@mkulke
mkulke / show-cluster-utilization.sh
Last active October 1, 2015 08:53
No-frills bash script to get memory utilization of your kubernetes cluster. depends on jq
#!/bin/bash
# The MIT License (MIT)
# Copyright (c) 2015 Magnus Kulke <mkulke at gmail dot com>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@mkulke
mkulke / seqential-promises.js
Created October 12, 2015 22:10
sequential es2015 promises
'use strict';
var _ = require('underscore')._;
function promiseFactory (n) {
return function () {
return new Promise((resolve) => {
setTimeout(_.partial(resolve, n), 1000);
});
};
@mkulke
mkulke / trampoline.js
Created October 14, 2015 13:14
node trampolining
function trampoline(f) {
while (f instanceof Function) {
f = f();
}
return f;
}
function factorial(n, acc) {
function recur(n, acc) {
acc = acc || 1;
@mkulke
mkulke / throttled-promises.js
Last active October 16, 2015 18:41
throttled es2015 promises
'use strict';
var _ = require('underscore')._;
function promiseFactory (n) {
// return () => new Promise(resolve => resolve(n));
// return () => new Promise(resolve => setTimeout(_.partial(resolve, n), 100));
return () => new Promise(resolve => setTimeout(_.partial(resolve, n), _.random(1000)));
}
@mkulke
mkulke / main.elm
Last active October 23, 2015 16:13
elm playground
import Graphics.Element exposing (..)
import Signal exposing (..)
import Time exposing (..)
import Keyboard exposing (..)
type alias Model = Int
initialModel : Model
initialModel = 1
@mkulke
mkulke / Main.elm
Created January 23, 2016 09:59
Elm: simple rest call
module Main where
import Html exposing (Html, text, p)
import Signal exposing (Address)
import Effects exposing (Effects, Never)
import Json.Decode as Json exposing ((:=))
import StartApp exposing (start)
import Task
import Http