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 | |
if [ "$(whoami)" != "root" ] | |
then | |
echo "Sorry, you are not root." | |
exit 1 | |
fi | |
echo "Downloading the latest PhpStorm to /tmp" | |
cd /tmp |
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 | |
/* | |
* Plugin name: Test Rewrite Plugin | |
* Source: https://jeremyfelt.com/2015/07/17/flushing-rewrite-rules-in-wordpress-multisite-for-fun-and-profit/ | |
* */ | |
add_action( 'admin_bar_menu', 'toolbar_link_to_mypage', 999 ); | |
function toolbar_link_to_mypage( $wp_admin_bar ) { |
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
#Spider Websites with Wget – 20 Practical Examples | |
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute. | |
1. Download a single file from the Internet | |
wget http://example.com/file.iso | |
2. Download a file but save it locally under a different name | |
wget ‐‐output-document=filename.html example.com |
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 | |
/** | |
* Plugin Name: RT Autoautoptimize | |
* Plugin URI: http://www.this-play.nl | |
* Description: Automatically configures default settings for the Autoptimize plugin across a WordPress network | |
* Version: 0.9 | |
* Author: Roy Tanck | |
* Author URI: http://www.this-play.nl | |
* License: GPL2 | |
*/ |
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
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
# add a trailing slash to /wp-admin | |
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] | |
RewriteCond %{REQUEST_FILENAME} -f [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^ - [L] |
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 sh | |
# Install the Beta Tester plugin and set it to "Bleeding Edge" releases. | |
# Note: after installing plugin and setting the option, you may need to visit | |
# the site once before updating core version. | |
wp-beta() { | |
wp plugin install wordpress-beta-tester --activate | |
wp option set wp_beta_tester_stream unstable | |
wp core update |
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 | |
# This bash script works JUST with WP-CLI | |
# You can get it from here: | |
# http://wp-cli.org/ | |
# | |
# If you don't know what to do with this file: | |
# | |
# 1) Install wp-cli on your workspace | |
# 2) Create a file call wpinstall.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
<?php | |
require_once 'bar.php'; | |
require_once 'foo.php'; | |
$foo = new Foo; | |
$bar = new Bar( $foo ); | |
$foo->set_foo( 123.4 ); | |
$foo->set_bar( 123.4 ); |