This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
BOLD=$(tput bold) | |
DIM=$(tput dim) | |
YELLOW=$(tput setaf 3) | |
RESET=$(tput sgr0) | |
pr() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createDebug = require('debug') | |
const { serializeError } = require('serialize-error') | |
const receiveCommands = async (main, commands, debug) => { | |
for await (const message of main.subscribe()) { | |
if (message.data == null || typeof message.data.type !== 'string') { | |
debug('unexpected message', { message }) | |
continue | |
} | |
const { type, payload } = message.data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const misleadingStrings = ['', 'true', 'false'] | |
const reWhitespaceStart = /^\s/ | |
const reWhitespaceEnd = /\s$/ | |
const reNumeric = /^\s*(?:[0-9]+|[0-9]*\.[0-9]+)\s*$/ | |
const indent = ' ' | |
const maxStringLength = 60 | |
const keysSorted = true | |
const byKey = (a, b) => a[0].localeCompare(b[0]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
curl \ | |
--silent \ | |
"https://api.cloudflare.com/client/v4/zones" \ | |
-H "X-Auth-Email: $CLOUDFLARE_EMAIL" \ | |
-H "X-Auth-Key: $CLOUDFLARE_TOKEN" \ | |
-H "Content-Type: application/json" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http') | |
const net = require('net') | |
const { performance } = require('perf_hooks') | |
const HOST = 'example.com' | |
const ADDRESS = '93.184.216.34' | |
const FAMILY = 4 | |
let lookupCountCreateConnection = 0 | |
let lookupCountSocketEvent = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http') | |
const PORT = 8888 | |
const REQUEST_LATENCY = 100 | |
const REQUEST_COUNT = 1000 | |
const requestOptions = { | |
hostname: '127.0.0.1', | |
port: PORT, | |
path: '/', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const libxmljs = require('libxmljs') | |
const doc = new libxmljs.Document() | |
const measure = () => { | |
global.gc() | |
return process.memoryUsage() | |
} | |
const run = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
NAME=$1 | |
[[ -z $NAME ]] && { | |
echo "Usage: $0 INSTANCE_NAME" >&2 | |
exit 1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
region=${1:-us-east-1} | |
count=${2:-100} | |
aws --region $region elasticbeanstalk describe-application-versions | | |
jq -r '.ApplicationVersions[] | .ApplicationName + " " + .VersionLabel' | | |
head -$count | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
SELECTOR='string(//*[local-name()="entry"]/*[local-name()="title"][not(contains(text(), "beta"))])' | |
INSTALLED="dpkg-query -W -f '\${Version}' atom" | |
ARTIFACT='atom-amd64.deb' | |
INSTALL='sudo dpkg --skip-same-version --install' | |
version=$( |
NewerOlder