Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Michael von Lipinsky joside

🏠
Working from home
View GitHub Profile
@sandeepraju
sandeepraju / ttfb.sh
Created Jul 20, 2016
curl command to check the time to first byte
View ttfb.sh
#!/bin/bash
# file: ttfb.sh
# curl command to check the time to first byte
# ** usage **
# 1. ./ttfb.sh "https://google.com"
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com"
curl -o /dev/null \
-H 'Cache-Control: no-cache' \
-s \
@borismus
borismus / gist:1032746
Created Jun 18, 2011
Convert a base64 string into a binary Uint8 Array
View gist:1032746
var BASE64_MARKER = ';base64,';
function convertDataURIToBinary(dataURI) {
var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;
var base64 = dataURI.substring(base64Index);
var raw = window.atob(base64);
var rawLength = raw.length;
var array = new Uint8Array(new ArrayBuffer(rawLength));
for(i = 0; i < rawLength; i++) {