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
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU | |
# Author: Rheinard Korf | |
# Usage: | |
# * Create a new bundle (or add to existing bundle). | |
# * Create a new command (e.g. KeyValue Alignment) and set a shortcut key (e.g. Ctrl+Cmd+Option+] ) | |
# * Paste the code in the command editor and save the bundle (Cmd+S) | |
# | |
# Now select a set of key/value pairs (not the whole array) and try out the new command. |
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 ruby | |
# Author: Rheinard Korf | |
# Usage: | |
# Needs to be added to a TextMate bundle as a new 'Command' | |
# Set command's input to 'None' and output to 'Show in Tool Tip' | |
# What it does: | |
# - Adds whitespace inside parentheses. |
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 ruby | |
# Author: Rheinard Korf | |
# Usage: | |
# Run from command line by passing the path as an argument (add a trailing slash). | |
# If path is not set it will use the current directory. (Not recommended) | |
# Examples: | |
# ruby wp-cleanup.rb /my/project/path/ | |
# (OR set as executable "chmod +x wp-cleanup.rb") |
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 | |
# A script I use daily to quickly zip up a git repo. | |
# Note you will need: https://github.com/Kentzo/git-archive-all | |
# | |
# Adaptation of: https://gist.github.com/uglyrobot/e872d1a9efc122b6bae2 | |
if [[ $# -eq 0 ]] ; then | |
echo "Please enter a version number:" | |
read VERSION |
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: VVV Host Update | |
Plugin URI: http://rheinardkorf.com | |
Description: Updates the vvv-hosts file for multisite configs with subdomain enabled. | |
Author: Rheinard Korf | |
Author URI: http://rheinardkorf.com | |
Version: 1.0 | |
Network: True |
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 ruby | |
declared_properties = [] | |
properties = [] | |
implicit_properties = [] | |
if ARGV[0].to_s.strip.length == 0 | |
puts 'No filename specified.' | |
exit | |
end |
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 | |
// --------------------------------------------- | |
// Remove this line and up if you're adding it to an existing PHP file | |
// Add this to a theme's functions.php file or a custom plugin. | |
// This will precent the ads from showing on certain pages on your site | |
function 20151102_remove_ads_on_page ( $setting, $default ) { | |
// Option 1 -- Filter by page IDS specified as array |
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 | |
/* | |
* Auto-login script to save having to manually login when developing a WP site. | |
* | |
* Place in wp-content/mu-plugins and remember to add to .gitignore for safety | |
* | |
* Add the DEV_GET_PARAMETER to the url to activate the script and login for you | |
* e.g. http://localhost:8080/?dev | |
*/ | |
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 | |
class MyPlugin { | |
/** | |
* Add this at top of your plugin class constructor or whichever method in your class you use to bootstrap your plugin. | |
* e.g. public static function bootstrap() | |
*/ | |
public static function bootstrap() { | |
if ( version_compare( '5.3', phpversion(), '>' ) ) { |
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
Verifying that +rheinardkorf is my blockchain ID. https://onename.com/rheinardkorf |
OlderNewer