View 0_reuse_code.js
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
View fallback-test.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 | |
if ( false !== strpos( phpversion(), 'hhvm' ) ) { | |
header( 'HTTP/1.1 502 Bad Gateway', true, 502 ); | |
echo 'Artificial Error'; | |
exit; | |
} | |
echo 'PHP Fallback'; |
View gist:2282981
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
/* | |
* Removes inner padding and search cancel button in S5, Chrome on OS X | |
*/ | |
input[type="text"], input[type="email"], input[type="password"], | |
input[type="search"]::-webkit-search-decoration, | |
input[type="search"]::-webkit-search-cancel-button { | |
-webkit-appearance: none; | |
} |
View wp-ms-cron-ping.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
#!/bin/bash | |
WP_PATH="/path/to/wp" | |
for SITE_URL in $(wp site list --fields=url --archived=0 --deleted=0 --format=csv --path="$WP_PATH" | sed 1d) | |
do | |
/usr/bin/curl -L -s -o /dev/null "${SITE_URL}wp-cron.php" | |
done |
View wp-ms-cron-run.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
#!/bin/bash | |
WP_PATH="/path/to/wp" | |
for SITE_URL in $(wp site list --fields=url --archived=0 --deleted=0 --format=csv --path="$WP_PATH" | sed 1d) | |
do | |
for EVENT_HOOK in $(wp cron event list --format=csv --fields=hook,next_run_relative --url="$SITE_URL" --path="$WP_PATH" | grep now$ | awk -F ',' '{print $1}') | |
do | |
wp cron event run "$EVENT_HOOK" --url="$SITE_URL" --path="$WP_PATH" --quiet | |
done | |
done |
View etc inid.d php7-fpm
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: php-fpm php7-fpm | |
# Required-Start: $remote_fs $network | |
# Required-Stop: $remote_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts php7-fpm | |
# Description: Starts The PHP FastCGI Process Manager Daemon | |
### END INIT INFO |
View cloudproxy-whitelist-ip.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 | |
/** | |
* Whitelist the remote IP in CloudProxy when the user logs into WordPress | |
* | |
* @param string $user_login The provided $user->user_login | |
* @param WP_User $user The WP_User object | |
*/ | |
function whitelist_ip_in_cloudproxy( $user_login, $user ) { |
View le-renew.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
#!/bin/bash | |
#================================================================ | |
# Let's Encrypt renewal script for Nginx based on the script | |
# by Erika Heidi for Apache on Ubuntu/Debian | |
# @author Erika Heidi<erika@do.co> | |
# @author Bjørn Johansen <post@bjornjohansen.no> | |
# Usage: ./le-renew.sh [base-domain-name] [path-to-webroot] | |
#================================================================ | |
domain=$1 | |
webroot=$2 |
View etc init php7-fpm
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
# php7-fpm - The PHP FastCGI Process Manager | |
# Original script by Ondřej Surý. Adapted to php7-fpm by @bjornjohansen | |
description "The PHP FastCGI Process Manager" | |
author "Ondřej Surý <ondrej@debian.org>" | |
start on runlevel [2345] | |
stop on runlevel [016] | |
# Precise upstart does not support reload signal, and thus rejects the |
View moderate_comments.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
#!/bin/bash | |
# Copyright © 2016 Bjørn Johansen | |
# This work is free. You can redistribute it and/or modify it under the | |
# terms of the Do What The Fuck You Want To Public License, Version 2, | |
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. | |
# Check if WP-CLI is available | |
if ! hash wp 2>/dev/null; then | |
echo "WP-CLI is not available" | |
exit |
OlderNewer