Skip to content

Instantly share code, notes, and snippets.

View vitobotta's full-sized avatar

Vito Botta vitobotta

View GitHub Profile
@vitobotta
vitobotta / gist:135c35db9938d94298a5c06f66029d42
Created September 4, 2021 14:54
Hetzner Cloud, 4 shared cored, 8GB - 12.40 euros/mo
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
# Yet-Another-Bench-Script #
# v2021-06-05 #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
Sat 04 Sep 2021 04:40:50 PM CEST
Basic System Information:
---------------------------------
@vitobotta
vitobotta / gist:16513b5de3ad6626a2389bb21a962def
Created September 4, 2021 14:53
DigitalOcean, 4 shared premium AMD cores, 8GB - $48/mo
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
# Yet-Another-Bench-Script #
# v2021-06-05 #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
Sat 04 Sep 2021 02:32:39 PM UTC
Basic System Information:
---------------------------------
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
# Yet-Another-Bench-Script #
# v2021-06-05 #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
Sat 04 Sep 2021 02:31:51 PM UTC
Basic System Information:
---------------------------------
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
# Yet-Another-Bench-Script #
# v2021-06-05 #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
Sat 04 Sep 2021 02:30:57 PM UTC
Basic System Information:
---------------------------------
@vitobotta
vitobotta / gist:993073a35df0a90034b5898de213a81a
Created September 4, 2021 14:51
Linode 4 dedicated cores, 8GB - $60/mo
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
# Yet-Another-Bench-Script #
# v2021-06-05 #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
Sat 04 Sep 2021 02:28:11 PM UTC
Basic System Information:
---------------------------------
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
# Yet-Another-Bench-Script #
# v2021-06-05 #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
Sat 04 Sep 2021 02:27:16 PM UTC
Basic System Information:
---------------------------------
@vitobotta
vitobotta / create-k3s-cluster.sh
Created July 12, 2021 18:52
Create a K3s cluster very quickly in Hezner cloud
#!/bin/bash
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
--context)
CONTEXT_NAME="$2"
@vitobotta
vitobotta / ttfb.sh
Created January 31, 2021 17:56
ttfb
#!/usr/bin/env bash
#
# Shows time in seconds to first byte of a url or urls
#
# Based on a gist https://gist.github.com/sandeepraju/1f5fbdbdd89551ba7925abe2645f92b5
# by https://github.com/sandeepraju
#
# Modified by jay@gooby.org, @jaygooby
#
# Usage: ttfb [options] url [url...]
// This code is to be used with https://turbo.hotwire.dev. By default Turbo keeps visited pages in its cache
// so that when you visit one of those pages again, Turbo will fetch the copy from cache first and present that to the user, then
// it will fetch the updated page from the server and replace the preview. This makes for a much more responsive navigation
// between pages. We can improve this further with the code in this file. It enables automatic prefetching of a page when you
// hover with the mouse on a link or touch it on a mobile device. There is a delay between the mouseover event and the click
// event, so with this trick the page is already being fetched before the click happens, speeding up also the first
// view of a page not yet in cache. When the page has been prefetched it is then added to Turbo's cache so it's available for
// the next visit during the same session. Turbo's default behavior plus this trick make for much more responsive UIs (non SPA).
@vitobotta
vitobotta / prefetching.js
Created January 14, 2021 22:35
Prefetching
let lastTouchTimestamp
const prefetches = new Set()
const prefetchElement = document.createElement('link')
const isSupported = prefetchElement.relList && prefetchElement.relList.supports && prefetchElement.relList.supports('prefetch')
&& window.IntersectionObserver && 'isIntersecting' in IntersectionObserverEntry.prototype
const allowQueryString = true //'instantAllowQueryString' in document.body.dataset
const allowExternalLinks = false // 'instantAllowExternalLinks' in document.body.dataset
const useWhitelist = false //'instantWhitelist' in document.body.dataset
const mousedownShortcut = false //'instantMousedownShortcut' in document.body.dataset