Skip to content

Instantly share code, notes, and snippets.

View yanyaoer's full-sized avatar

yanyaoer yanyaoer

View GitHub Profile
@yanyaoer
yanyaoer / script-template.sh
Created December 16, 2020 01:19 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@yanyaoer
yanyaoer / background-page.html
Created November 30, 2011 03:25 — forked from ssokolow/background-page.html
Simple cross-domain XHR boilerplate for Chrome extensions. Modified to be more useful for POST
<!DOCTYPE html>
<html>
<head>
<script src="xhrproxy.js"></script>
<script>
setupXHRProxy();
</script>
</head>