This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: kops/v1alpha2 | |
kind: Cluster | |
metadata: | |
creationTimestamp: 2017-02-12T20:24:44Z | |
name: k8s.eu.prod.x.z | |
spec: | |
api: | |
loadBalancer: | |
type: Public | |
authorization: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This script will download a package (and all of its dependencies) from the | |
* online NPM registry, then create a gzip'd tarball containing that package | |
* and all of its dependencies. This archive can then be copied to a machine | |
* without internet access and installed using npm. | |
* | |
* The idea is pretty simple: | |
* - npm install [package] | |
* - rewrite [package]/package.json to copy dependencies to bundleDependencies | |
* - npm pack [package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'); | |
net.connect(1216, myListener).on('error', myErrHandler); | |
function myListener() { | |
console.log('myListener got called'); | |
} | |
function myErrHandler(err) { | |
console.log('woopsie, got error!', err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lifestyle = require('lifestyle'); | |
var through2 = require('through2'); | |
var client = new lifestyle.FinnClient('http://api.finn.no/iad/'); | |
var mapToAd = through2.obj(function (adId, encoding, callback) { | |
client.getAd(adId).then(function(ad) { | |
this.push(ad); | |
}.bind(this), function(err) { | |
console.error('YIKES, GOT ERROR!', err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// doing some functional wrapping as a proof-of-concept for extensibility | |
var multiply = (function createMultiplier(invokeFn) { | |
var invoke = invokeFn || function (a, b) { | |
return a * b; | |
}; | |
return { | |
wrap: function (fn) { | |
return createMultiplier(fn(invoke)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Alice's Adventures in Wonderland | |
ALICE'S ADVENTURES IN WONDERLAND | |
Lewis Carroll | |
THE MILLENNIUM FULCRUM EDITION 3.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean isReadable(String myString) { | |
boolean isValid = true; | |
// as I expect my string to be valid by default, I only need to check when the string is NOT valid | |
// which also means I can get rid of the second if-statement in notReadable.java | |
if (myString.length() == 0) { | |
isValid = false; | |
} | |
// .. |