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
import { Controller, Get } from '@nestjs/common'; | |
@Controller('cats') | |
export class CatsController { | |
@Get() | |
findAll(): string { | |
return 'This action returns all cats'; | |
} | |
} |
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
[root] ./weave-zombie-hunter.sh | |
Unable to find image 'weaveworks/weaveexec:1.5.2' locally | |
Trying to pull repository registry.access.redhat.com/weaveworks/weaveexec ... | |
Trying to pull repository docker.io/weaveworks/weaveexec ... | |
1.5.2: Pulling from docker.io/weaveworks/weaveexec | |
8f4ec95ceaee: Pulling fs layer | |
5086797bdfc4: Pulling fs layer | |
434498369551: Pulling fs layer | |
8d222e6d5bf7: Pulling fs layer | |
ea271997bd13: Pulling fs layer |
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
./weave-zombie-hunter.sh | |
# weave e2:7f:bd:e3:db:d3 @ vethwepl10930: id=8dfc61bc31d8 ip=10.81.128.55/16 | |
# weave e2:7f:bd:e3:db:d3 @ vethwepl10930: missing | |
# weave 06:fc:01:5e:b5:fa @ vethwepl10930: missing | |
# weave 02:c5:00:91:95:a4 @ vethwepl10930: id=725dedda4925 ip=10.81.128.108/16 | |
# weave 02:c5:00:91:95:a4 @ vethwepl10930: missing | |
# weave 02:68:2f:29:fb:27 @ vethwepl10930: missing | |
# weave 8a:cf:1a:e4:c9:c2 @ vethwepl10930: id=a6e282a7b820 ip=10.81.128.102/16 | |
# weave 8a:cf:1a:e4:c9:c2 @ vethwepl10930: missing | |
# weave c6:5b:31:a0:77:a1 @ vethwepl10930: missing |
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
<link rel="import" href="../polymer/polymer.html"> | |
<dom-module id="hello-world"> | |
<template> | |
<h1>Hello</h1> | |
</template> | |
</dom-module> | |
<script type="module"> | |
import { assign } from "./lib/lodash/lodash.js"; |
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
// copied from https://gist.github.com/lauripiispanen/1fd1c3319084f9913f2d | |
// improved formatting | |
const constrain = ({ | |
pre = () => {}, | |
post = () => {} | |
}) => fn => (...args) => { | |
const throwIf = x => y => { | |
if (x(y)) { | |
throw x(y); | |
} else { |
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
function randomID() { | |
return Math.random(); | |
} | |
function serialize(obj, store) { | |
const retVal = {}; | |
store = store || { | |
root: retVal, | |
objects: {}, |
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
function f(p) { | |
console.log(Date.now()); | |
var x = []; | |
while(x.length < 1000000) x.push(x.length); | |
p = p || {}; | |
setTimeout(function() { | |
f(p); | |
}, 25); | |
}; |
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
// Calls 'f' if the parameters are different from the last call. | |
// NOTE: Implement 'notEqual' yourself | |
const changed = f => { | |
let lastParams = undefined, flag = false; | |
return (...args) => { | |
if (!flag || notEqual(lastParams, args)) { | |
f(args); | |
lastParams = args; | |
flag = true | |
} |
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
const _ = new Proxy({}, { get: (target, prop) => it => it[prop] }); | |
// Evaluates to [{ foo: true }] | |
[{ foo: true }, { foo: false }].filter(_.foo); |
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
const updated = (source, property, value) => { | |
const out = {}; | |
Object.keys(source).forEach(key => { | |
out[key] = source[key]; | |
}); | |
out[property] = value; | |
return out; | |
}; | |
const removed = (source, property) => { |
NewerOlder