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
<?php | |
/** | |
* @package MyPlugin | |
*/ | |
//Before playing with this file, see the other file in the gist. Read the comments. | |
if( ! class_exists( 'MyPlugin' ) ) { | |
class MyPlugin { |
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
require "nokogiri" | |
require "open-uri" | |
doc = Nokogiri::HTML(open("http://mcclist.com/")) | |
$country_codes = { | |
"AF" => "Afghanistan", | |
"AX" => "Aland Islands", | |
"AL" => "Albania", | |
"DZ" => "Algeria", |
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
/** | |
* @file A WordPress-like hook system for JavaScript. | |
* | |
* This file demonstrates a simple hook system for JavaScript based on the hook | |
* system in WordPress. The purpose of this is to make your code extensible and | |
* allowing other developers to hook into your code with their own callbacks. | |
* | |
* There are other ways to do this, but this will feel right at home for | |
* WordPress developers. | |
* |
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 |
OlderNewer