Skip to content

Instantly share code, notes, and snippets.

View gabrielcraveiro's full-sized avatar

Gabriel Craveiro gabrielcraveiro

View GitHub Profile

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@romcaname
romcaname / postman-response-time-metrics.js
Last active July 4, 2022 12:28
a postman script to calculate the response time average and standard deviation of a request
function standardDeviation(values, avg) {
var squareDiffs = values.map(value => Math.pow(value - avg, 2));
return Math.sqrt(average(squareDiffs));
}
function average(data) {
return data.reduce((sum, value)=>sum + value) / data.length;
}
if (responseCode.code === 200 || responseCode.code === 201) {
@ksafranski
ksafranski / Common-Currency.json
Last active April 22, 2024 15:16
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},