kirjoitin muutamia ajatuksia ylös Go:n aloittamisesta:
yksinkertaisin esimerkki, tallenna samaan hakemistoon nimellä hello.go
package main
package main | |
import ( | |
"encoding/binary" | |
"hash" | |
) | |
// The size of an MD4 checksum in bytes. | |
const Size = 16 |
exports.handler = async (ctx, console, browser) => { | |
const page = await browser.newPage(); | |
// has breakpoints for mobile resolution that makes map display different, | |
// so better increase resolution | |
await page.setViewport({ | |
width: 1280, | |
height: 1024, | |
}) |
package main | |
import ( | |
"github.com/asdine/storm" | |
"github.com/asdine/storm/codec/msgpack" | |
"os" | |
"encoding/json" | |
"io" | |
"fmt" | |
"bufio" |
$ time curl http://whoami.prod4.fn61.net/
... snipped
<title>whoami.prod4.fn61.net | 524: A timeout occurred</title>
... snipped
real 1m40.114s
user 0m0.008s
sys 0m0.004s
Jan 06 14:04:15 master dockerd[2325]: time="2017-01-06T14:04:13.208839706Z" level=info msg="libcontainerd: new containerd process, pid: 4140"
Jan 06 14:04:17 master dockerd[2325]: time="2017-01-06T14:04:13.273558318Z" level=error msg="libcontainerd: failed to receive event from containerd: rpc error: code = 13 desc = transport is closing"
Jan 06 14:04:24 master dockerd[2325]: time="2017-01-06T14:04:22.526231387Z" level=info msg="libcontainerd: new containerd process, pid: 4141"
Jan 06 14:04:34 master kernel: gmain invoked oom-killer: gfp_mask=0x24201ca, order=0, oom_score_adj=0
.. snip ..
Jan 06 14:04:34 master kernel: Out of memory: Kill process 4132 (php) score 935 or sacrifice child
Jan 06 14:04:34 master kernel: Killed process 4132 (php) total-vm:3392804kB, anon-rss:2912200kB, file-rss:0kB
Jan 06 14:04:34 master dockerd[2325]: time="2017-01-06T14:04:34.595231149Z" level=info msg="libcontainerd: new containerd process, pid: 4145"
Jan 06 14:04:34 master dockerd[2325]: time="2017-01-06T14:04:34.633952118
#!/usr/bin/nodejs | |
// prerequisites: $ npm install -g amdextract@2.1.14 | |
// Run this: | |
// $ export NODE_PATH=/usr/local/lib/node_modules # stupid nodejs | |
// $ find src/ -name '*.js' -not -path '*/vendor/*' -not -path '*/build/*' | bin/find-unused-amd-imports.js | |
var fs = require('fs'); | |
var amdextract = require('amdextract'); |
/* Monitors aggregate bandwith directly from your router via SNMP | |
Public Domain. | |
Author: http://joonas.fi/ | |
2014-03-09 | |
Output: |