View wp-proxy.sh
This file contains 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 | |
# Requirements | |
if ! command -v docker &> /dev/null; then | |
echo 'Please install docker: https://docs.docker.com/engine/install/' | |
exit 1 | |
fi | |
if ! command -v ngrok &> /dev/null; then | |
echo 'Please install ngrok: https://ngrok.com/download' |
View user-stylesheet.css
This file contains 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
.tri-layout-container .tri-layout-middle { | |
padding-top: 0 !important; | |
} | |
.content-wrap.card { | |
padding: 4px 16px !important; | |
} | |
.content-wrap.card h2 { | |
font-size: 1.25rem !important; | |
} | |
.tri-layout-left-contents, .tri-layout-right-contents { |
View stamped-data.php
This file contains 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
<?php | |
// mock get_option / update_option using global state | |
require_once( 'mock.php' ); | |
/** | |
* Timestamp a value. | |
* update_option( $name, stamp( $value ) ); | |
* | |
* @param int|null $timestamp now, or provided time() compatible timestamp. | |
* |
View git-sw.sh
This file contains 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 | |
# filename: ~/bin/git-sw | |
# example: git sw 930 | |
# example: git sw origin/JIRA-2 | |
# | |
# Fuzzy switch | |
# TODO: Does not handle remotes other than origin. | |
# Check branch locally | |
BRANCH=$(git branch | grep $1 | head -n1 | xargs) |
View clone-gists.py
This file contains 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 python3 | |
import json | |
import os | |
import re | |
import requests | |
import subprocess | |
import unicodedata | |
View system-update.sh
This file contains 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 | |
update_apt() { | |
if ! command -v apt-get &> /dev/null | |
then | |
return | |
fi | |
echo; | |
echo ">>> Updating apt-get packages..." |
View switch-or-start.sh
This file contains 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 | |
# Switch to the window associated by the command, or start it | |
#{{{ Bash settings | |
# abort on nonzero exitstatus | |
set -o errexit | |
# abort on unbound variable | |
set -o nounset | |
# don't hide errors within pipes |
View gist:823a4a6dd2b87bba40c67612202b1575
This file contains 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
These gists are in the process of being moved to https://brain.vandragt.com/books/code-snippets |
View folderactions.sh
This file contains 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 | |
#{{{ Bash settings | |
# abort on nonzero exitstatus | |
set -o errexit | |
# abort on unbound variable | |
set -o nounset | |
# don't hide errors within pipes | |
set -o pipefail | |
#}}} |
View composer-require-git.sh
This file contains 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 | |
#{{{ Bash settings | |
# abort on nonzero exitstatus | |
set -o errexit | |
# abort on unbound variable | |
set -o nounset | |
# don't hide errors within pipes | |
set -o pipefail | |
#}}} |
NewerOlder