Skip to content

Instantly share code, notes, and snippets.


Hayden Braxton haydenbr

View GitHub Profile
haydenbr / blob-generator-function.ts
Created Jul 23, 2020
Use a generator function to partition a blob and upload blocks sequentially to Azure Storage
View blob-generator-function.ts
async function putBlocks(blob: Blob, url: string): Promise<string[]> {
const blockIds: string[] = []
let baseUrl = url + '&comp=block'
for (let { block, blockId } of partitionBlob(blob, BLOCK_SIZE)) {
await fetch(`${baseUrl}&blockid=${blockId}`, {
headers: {
View cache-busting.js
#!/usr/bin/env node
var fs = require('fs'),
path = require('path'),
cheerio = require('cheerio'),
revHash = require('rev-hash');
var rootDir = path.resolve(__dirname, '../');
var wwwRootDir = path.resolve(rootDir, 'platforms', 'browser', 'www');
var buildDir = path.join(wwwRootDir, 'build');