Skip to content

Instantly share code, notes, and snippets.

View josephscott's full-sized avatar

Joseph Scott josephscott

View GitHub Profile
@josephscott
josephscott / wait-ttfb
Last active May 19, 2021 21:19
Get the app response TTFB ( Time To First Byte ) with curl
#!/usr/bin/env bash
set -eu
export LC_ALL=C.UTF-8
CURL_FORMAT="%{time_starttransfer} - %{time_pretransfer}"
declare -a TIMES
for i in {1..15}; do
OUT_CURL=$(curl -w "$CURL_FORMAT" -k --compressed -s -o /dev/null "$@")
document.addEventListener("DOMContentLoaded",function(){var e=[].slice.call(document.getElementsByClassName("js-lazy-img"));if("IntersectionObserver"in window){var t=new IntersectionObserver(function(e,s){e.forEach(function(e){if(e.isIntersecting){var s=e.target;s.src=s.dataset.src,s.dataset.srcset&&(s.srcset=s.dataset.srcset),t.unobserve(s)}})},{rootMargin:"250px 0px"});e.forEach(function(e){t.observe(e)})}else e.forEach(function(e){e.src=e.dataset.src,e.dataset.srcset&&(e.srcset=e.dataset.srcset)})});
document.addEventListener("DOMContentLoaded", function() {
var lazyImages = [].slice.call(document.getElementsByClassName("js-lazy-img"));
if ("IntersectionObserver" in window) {
var config = {
// If the image gets within 250px of the browser's viewport, start the download:
rootMargin: '250px 0px',
};
var lazyImageObserver = new IntersectionObserver(function(entries, observer) {
@josephscott
josephscott / coredump.txt
Created December 9, 2015 22:28
HHVM nightly - hhvm-nightly-dbg_2015.12.09~wheezy_amd64.deb - core dump
Thread 3 (Thread 0x7f47303ff700 (LWP 29153)):
#0 0x00007f473ef6cd63 in epoll_wait () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f474060a5d3 in ?? ()
from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
#2 0x00007f47405f5f60 in event_base_loop ()
from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
#3 0x000000000634b2fd in folly::EventBase::loopBody(int) ()
at /tmp/tmp.hEWUdoldcP/third-party/folly/src/folly/io/async/EventBase.cpp: 347
#4 0x000000000634af95 in folly::EventBase::loop() ()
at /tmp/tmp.hEWUdoldcP/third-party/folly/src/folly/io/async/EventBase.cpp: 299
@josephscott
josephscott / gbd-out.txt
Created November 23, 2015 23:44
HHVM 3.10.1 backtrace
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/hhvm...done.
@josephscott
josephscott / build-nginx-test.sh
Last active March 28, 2016 10:47
Nginx Test Build
#!/bin/sh
NGINX_VER=1.7.7
apt-get update
apt-get -y upgrade
apt-get -y install build-essential zlib1g-dev libpcre3 libpcre3-dev libbz2-dev libssl-dev tar unzip openssl
mkdir -p dev/nginx
cd dev/nginx
curl -O http://nginx.org/download/nginx-${NGINX_VER}.tar.gz

Keybase proof

I hereby claim:

  • I am josephscott on github.
  • I am josephscott (https://keybase.io/josephscott) on keybase.
  • I have a public key whose fingerprint is 912B 4680 F0A0 DC42 FD0C EF69 6A6C 2181 AED8 EEFC

To claim this, I am signing this object:

Verifying myself: My Bitcoin username is +josephscott. https://onename.io/josephscott
#!/bin/sh
# adapted from https://github.com/mat/dotfiles/blob/master/bin/curlt
curl_format='{
"time_namelookup": %{time_namelookup},
"time_connect": %{time_connect},
"time_appconnect": %{time_appconnect},
"time_pretransfer": %{time_pretransfer},
"time_redirect": %{time_redirect},
"time_starttransfer": %{time_starttransfer},
<?php
$test_me = array(
'name' => 'Joseph Scott',
'city' => 'Sandy',
'state' => 'Utah',
);
echo "MEM: " . memory_get_peak_usage() . "\n";