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/sh -e | |
# A Simple Script to Create systemd-nspawn Alpine Container | |
# https://wildwolf.name/a-simple-script-to-create-systemd-nspawn-alpine-container/ | |
MIRROR="http://dl-cdn.alpinelinux.org/alpine" | |
#VERSION="latest-stable" | |
VERSION="edge" | |
[ "$(id -u)" -ne "0" ] && echo "You need to be root" >&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 -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
# Zig Update; Check and download the latest zig master branch build | |
# Inspired by: https://gist.github.com/MasterQ32/1f27081d8a7dd109fc290bd6729d97a8 | |
ROOT_DIR=/usr/local/bin | |
TMP_DIR=/tmp/zig-up | |
REPO_URL=https://ziglang.org/download/index.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
// XXX: Use '/cdn-cgi/trace' if the site is on cloudflare to avoid CORS issues | |
// otherwise can use 'https://www.cloudflare.com/cdn-cgi/trace' | |
const trace = await fetch('https://www.cloudflare.com/cdn-cgi/trace') | |
.then(x=>x.text()) | |
.then(x=>new URLSearchParams(x.replace(/\n/g, '&'))); | |
console.log(trace.get('ip')) | |
// ------------------------------------------------------------ |
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
-- Reasonably efficient pagination without OFFSET | |
-- SQLite version (Adapted from MS SQL syntax) | |
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6 | |
SELECT foo, bar, baz, quux FROM table | |
WHERE oid NOT IN ( SELECT oid FROM table | |
ORDER BY title ASC LIMIT 50 ) | |
ORDER BY title ASC LIMIT 10 |
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
#!/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...] |
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
! https://gist.github.com/maxmilton/8f352d731a40e6deacda043ec84b8be3 | |
! https://help.eyeo.com/adblockplus/how-to-write-filters | |
! Unwanted or bandwidth draining resources | |
$font | |
$media | |
$object | |
$other | |
$ping | |
$subdocument |
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 webpack = require('webpack'); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
const config = require('sapper/webpack/config.js'); | |
const { svelteMinifyHtml, sveltePostcss } = require('./utils.js'); | |
const mode = process.env.NODE_ENV; | |
const isDev = mode === 'development'; | |
module.exports = { | |
entry: config.client.entry(), |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Asynchronous Sentry JavaScript Error Tracking</title> | |
<!-- putting your CSS near the top is always a good idea --> | |
<link rel="stylesheet" href="/app.css"></link> |