- Install Xcode (Avaliable on the Mac App Store)
- Install Xcode Command Line Tools (Preferences > Downloads)
- Install depot_tools
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
$ nano ~/.zshrc
- Add
path=('/path/to/depot_tools' $path)
#!/bin/bash | |
# from https://chromium.woolyss.com/ | |
# and https://gist.github.com/addyosmani/5336747 | |
# and https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md | |
sudo apt-get update | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:canonical-chromium-builds/stage | |
sudo apt-get update | |
sudo apt-get install chromium-browser | |
chromium-browser --headless --no-sandbox http://example.org/ |
Note: Since writing this, I've been pointed to some exciting new research/tooling called Project Cambria https://www.inkandswitch.com/cambria.html I'll likely have to rewrite this article taking that into account. Leaving this up for posterity's sake.
(This series isn't meant to be a primer/tutorial, though we might do something regarding it in the future. For official documentation and starters, see https://developers.cloudflare.com/workers/learning/using-durable-objects.
Further - these are my personal views; I expect to be wrong about a lot of them. Indeed, I'm not paying much attention to presenting these well at the moment, simply writing down thoughts. As such, expect these writeups to change often, particularly as the platform takes shape. I'm also mostly a front end guy, so don't get mad if I get it very wrong. Give me feedback! Always happy to learn and make changes.)
Durable Objects are a fascinating new storage primitive from cloudflare for their workers platform. There's a lot of 'cool'
// | |
// This code parses binary format of WebM file. | |
// recognizes only some important TAGs | |
// | |
// Limitation: | |
// This programs reads all binary at once in memory (100MB). | |
// It is very bad imprementation, but it is still enough for some small WebM file. | |
// | |
// Usage: | |
// node parse_webm.js filename |
const Promise = require("bluebird"); | |
const request = require("request-promise"); | |
const ID3Writer = require('browser-id3-writer'); | |
const crypto = require('crypto'); | |
const format = require('util').format; | |
const fs = require("fs"); | |
const http = require('http'); | |
let type = process.argv[2]; |
var now = new Date().toUTCString(); | |
pm.environment.set("utcDate", now); | |
var verb = 'GET'; | |
var resourceType = pm.variables.get("resourceType"); | |
var resourceId = pm.variables.get("resourceId"); | |
var text = (verb || "").toLowerCase() + "\n" + (resourceType || "").toLowerCase() + "\n" + (resourceId || "") + "\n" + now.toLowerCase() + "\n" + "" + "\n"; | |
var key = CryptoJS.enc.Base64.parse(pm.variables.get("masterKey")); | |
var signature = CryptoJS.HmacSHA256(text, key).toString(CryptoJS.enc.Base64); |