Skip to content

Instantly share code, notes, and snippets.

.log
0
1
1234
12345
123456
18Renmeng
2
ACrenshaw
AGorg
#!/usr/bin/env bash
set -euo pipefail
mkdir linux
pushd linux
git init
git config extensions.partialClone true
git config core.sparseCheckout true
echo "kernel/acct.c" >> .git/info/sparse-checkout
const AWS = require('aws-sdk')
const fs = require('fs')
const path = require('path')
const s3 = new AWS.S3()
const BUCKET = 'gil-test-bucket'
const PREFIX = 'Clarizen/salesforce/'
const OUTDIR = '/tmp/aa'
@royra
royra / stream_as_asynciterable.ts
Created November 26, 2019 09:43
Convert an "old" JS stream to AsyncIterable
//
// Convert an "old" stream to AsyncIterable.
//
// Stream are "push" interfaces and iterators are "pull" interfaces. So there needs
// to be some kind of queue to accumulate the pushed data while waiting for "pulls",
// i.e, calls to next(). In this implementation the queue is the pendingValues array.
//
// Note: Not needed for current implementations of NodeJS Readable stream, as they are
// already AsyncIterable.
//
@royra
royra / dump_and_read_jsons.js
Created November 21, 2019 11:10
Dump and read lots of JSONs in node
const fs = require('fs')
o = {
ACCTOUNT_NUMBER: '1234567890',
CUSTOMER_NAME: 'ACME Products and Services, Inc.',
ADDRESS: '123 Main Street',
CITY: 'Albuquerque',
STATE: 'NM',
ZIP: '87101-1234'
}