I hereby claim:
- I am ghiden on github.
- I am hidenari (https://keybase.io/hidenari) on keybase.
- I have a public key whose fingerprint is 8A2E 98CD BB28 C287 B43E 8104 2C1A 5D84 CC80 8F5D
To claim this, I am signing this object:
// To run: node job-completion-estimate | |
function sleep() { | |
return new Promise((resolve) => { | |
// add a random jitter of +-0.5 seconds | |
setTimeout(() => resolve(), 1000 - (Math.random() - 0.5) * 1000); | |
}); | |
} | |
function humanReadableTime(duration) { |
[dev] | |
url = "http://dev.example.com" | |
username = "dev.account" | |
password = "devdev" | |
[test] | |
url = "http://test.example.com" | |
username = "test.account" | |
password = "testtest" |
var fs = require('fs'), | |
decode64 = require('base64').decode; | |
var data = fs.readFileSync('./encode.png', 'base64'); | |
var buffer = new Buffer(data, 'base64'); | |
fs.writeFileSync('./decode.png', decode64(buffer), 'binary') |
scala> val a = (1 to 10).toList | |
a: List[Int] = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) | |
scala> for (x <- a.grouped(2)) println(x) | |
List(1, 2) | |
List(3, 4) | |
List(5, 6) | |
List(7, 8) | |
List(9, 10) |
"use strict"; | |
var fs= require('fs'); | |
var Promise = require('bluebird'); | |
var parse= Promise.promisify(require('csv-parse')); | |
var file = fs.readFileSync('test.csv', 'utf8'); | |
var headerKeys; | |
var options ={ | |
trim: true, |
getUrl = [[ | |
tell application "System Events" | |
tell application "Firefox" to activate | |
delay .5 | |
tell application "System Events" | |
keystroke "l" using command down | |
keystroke "c" using command down | |
end tell | |
delay .5 | |
set u to the clipboard |
/* | |
Promise.all(arr.map(reflect)).then(function(results){ | |
var success = results.filter(x => x.status === "resolved"); | |
}); | |
*/ | |
module.exports = function reflect(promise){ | |
return promise.then(v => ({v:v, status: "resolved"}), e => ({e:e, status: "rejected"})) | |
} |
.chart { | |
background: #b0e0f8; | |
margin: 5px; | |
} | |
.chart rect { | |
stroke: white; | |
fill: steelblue; | |
} |
I hereby claim:
To claim this, I am signing this object:
This time, sort function is cleaner than the previous one. It doesn't need to update rect and text position, just the container g. And, by using 'transform', appending rect and text becomes easier.
A Pen by Hidenari Nozaki on CodePen.