Skip to content

Instantly share code, notes, and snippets.

@olivertappin
olivertappin / update-phpstorm.sh
Created July 20, 2017 07:58
Download and install the latest version of PhpStorm for Ubunti
#!/bin/bash
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root."
exit 1
fi
echo "Downloading the latest PhpStorm to /tmp"
cd /tmp
@raynov
raynov / nav-menu-exporter-importer.php
Last active August 30, 2017 13:39 — forked from hissy/nav-menu-exporter-importer.php
[WordPress Plugin] Nav Menu Exporter and Importer / Export and Import nav menus. Requires WordPress Importer plugin.
<?php
/*
Plugin Name: Nav Menu Exporter and Importer
Description: Export and Import nav menus. Requires WordPress Importer plugin
Author: hissy, megumi themes
Version: 0.1
Text Domain: nav-menu-exporter-importer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
<?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 ) {
@bueckl
bueckl / wget
Last active October 11, 2023 08:05
Wget examples
#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
@roytanck
roytanck / autoautoptimize.php
Last active January 25, 2023 06:45
Auto-configure Autoptimize across a WordPress network
<?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
*/
@jubstuff
jubstuff / .htaccess
Last active August 29, 2015 14:08
wp-cli.yaml for single wordpress install
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]
@morganestes
morganestes / wp-beta-setup.sh
Last active May 15, 2017 07:56
Set up a WordPress site for beta testing with wp-cli.
#!/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
@teledirigido
teledirigido / wpinstall.sh
Last active March 26, 2024 10:23
Download and Install Wordpress via WP-CLI
#!/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
@lloc
lloc / _example.php
Last active December 22, 2017 10:42
Generic Decorator in PHP
<?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 );