- Install Homebrew from https://brew.sh
$ brew install podman
#!/usr/bin/env python3 | |
# encoding: utf-8 | |
"""Use instead of `python3 -m http.server` when you need CORS""" | |
from http.server import HTTPServer, SimpleHTTPRequestHandler | |
class CORSRequestHandler(SimpleHTTPRequestHandler): | |
def end_headers(self): | |
self.send_header('Access-Control-Allow-Origin', '*') |
Render using innerHTML took:0.140s; tbody height=536364px | |
Render using DOM took:0.076s; tbody height=536364px | |
Render using React took:1.443s; tbody height=536364px |
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
Convert Apache-compatible web log files to be easily loaded in AWS Redshift | |
Provide filenames to Apache combined format log files (.gz transparently handled) and outputs gzip compressed | |
tab-separated files which can be loaded into Redshift. | |
Output files will not be overwritten if they already exist, making bulk-conversion tasks repeatable:: |
#!/usr/bin/env -S uv run | |
# /// script | |
# dependencies = [ | |
# "boto3", | |
# ] | |
# /// | |
""" | |
Report marketplace AMIs across all of the accounts in an Organization | |
Assumes AWS credentials for an account which has permission to query a Config |
#!/bin/bash | |
# | |
# Report time to first byte for the provided URL using a cache buster to ensure | |
# that we're measuring full cold-cache performance | |
while (($#)); do | |
echo $1 | |
curl -so /dev/null -H "Pragma: no-cache" -H "Cache-Control: no-cache" \ | |
-w "%{http_code}\tPre-Transfer: %{time_pretransfer}\tStart Transfer: %{time_starttransfer}\tTotal: %{time_total}\tSize: %{size_download}\n" \ | |
"$1?`date +%s`" |
#!/bin/bash | |
set -e -u -o pipefail | |
LAMBDA="$1" | |
if [ -z "$LAMBDA" ]; then | |
echo "Usage: $0 lambda-function-name" > /dev/stderr; exit 1 | |
fi |
def ocr_file(filename, languages, output_base, temp_dir): | |
log.info("Launching tesseract on %s", filename) | |
output = subprocess.check_output(['tesseract', filename, output_base, | |
'-l', '+'.join(languages), TESSERACT_CONFIG], | |
cwd=temp_dir, | |
stderr=subprocess.STDOUT) | |
with OCR_STORAGE.open('%s/%s/%s.log' % (item_id, group, index), 'w') as log_f: | |
log_f.write(output) |
$ brew install podman
#!/usr/bin/env PYTHONIOENCODING=utf-8 python | |
# encoding: utf-8 | |
from __future__ import absolute_import, print_function, unicode_literals | |
import os | |
import re | |
import requests |
#!/usr/bin/env PYTHONIOENCODING=utf-8 python | |
# encoding: utf-8 | |
"""Git pre-commit hook which lints Python, JavaScript, SASS and CSS""" | |
from __future__ import absolute_import, print_function, unicode_literals | |
import os | |
import subprocess | |
import sys |