I hereby claim:
- I am creationix on github.
- I am creationix (https://keybase.io/creationix) on keybase.
- I have a public key whose fingerprint is 5586 E707 E6BA D3CA F9B2 0315 A79E F464 F27E D7D2
To claim this, I am signing this object:
// readable.queue -> array of items to consume | |
// | |
// readable.wait() => more - wait for more data to consume | |
// The => in my docs means "returns" a promise for more in the form of a continuable function, but callback-last style is also accepted. | |
// ES6 function to convert a stream to an array | |
function* read(stream) { | |
while (yield stream.wait()); | |
return stream.queue; | |
} |
var fs = require('fs'); | |
var dirname = require('path').dirname; | |
var repo = { | |
rootPath: pathJoin(__dirname, "repo.git") | |
}; | |
require('js-git/mixins/fs-db')(repo, { | |
readFile: function (path, callback) { | |
fs.readFile(path, function (err, buffer) { | |
if (err) { |
I hereby claim:
To claim this, I am signing this object:
"use strict"; | |
var rsa = window.forge.rsa; | |
var pki = window.forge.pki; | |
var fs = require('data/fs.js'); | |
var reloadTree = require('ui/tree.js').reload; | |
var notify = require('ui/notify.js'); | |
var modes = require('js-git/lib/modes.js'); | |
var bodec = require('bodec.js'); |
var reloadTree = require('ui/tree.js').reload; | |
var modes = require('js-git/lib/modes.js'); | |
var bodec = require('bodec.js'); | |
var fs = require('data/fs.js'); | |
/** | |
* PNG Encoder | |
* | |
* @version 1.0 | |
* @author Robert Eisele <robert@xarg.org> |
; Create this file at /etc/systemd/system/rackspace-monitoring-agent.service | |
; Then reload the configs using `systemctl daemon-reload` | |
; Enable it with `systemctl enable rackspace-monitoring-agent.service` | |
; Restart this service using `systemctl restart rackspace-monitoring-agent` | |
[Unit] | |
Description=Rackspace Monitoring Agent | |
After=network.target | |
[Service] |
In git, there is a specified sort order for trees. The sort order matters because if you later re-sort using a different algorithm, it is no longer the same object and should have a different hash.
I'm constantly bit by a bug in the REST API for Git objects where you sort trees wrong. Whenever I happen to hit one of these cases on tedit, I get stuck and can't save my work without manually moving things around and renaming files in tricky ways to avoid the bug.
The correct way to sort is simple:
// As implemented in js-git (JavaScript)
function treeSort(a, b) {
var aa = a + "/";
local coroutine = require('coroutine') | |
local table = require('table') | |
local uv = require("luv") | |
local function await(fn, ...) | |
local co = coroutine.running() | |
local args = {...} | |
table.insert(args, function (err, result) | |
if err then error(err) end | |
return assert(coroutine.resume(co, result)) |
sample :ambi_drone, rate: 0.5 | |
sample :ambi_drone, rate: 0.3 | |
sample :ambi_drone, rate: 0.7 | |
for i in 0..1000 | |
sample :ambi_soft_buzz, rate: (0.3 + i * 0.01) | |
sample :ambi_soft_buzz, rate: (5 - i * 0.01) | |
sleep 0.5 / (i / 10 + 1) | |
end |
In many of my libraries, I like to program stream transforms using this simple format. It can then be easily adapted to virtually any stream interface.
function transform(emit) {
// Given an emit function as input, return a new emit function.
// Per-stream state can be initialized here and it closed over by the returned fn.
return function (item) {
// When the new emit function is called, process the input and call
// the old emit zero or more times.
};