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
do shell script "apachectl graceful" with administrator privileges |
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
import java.io.*; | |
public class Utilities { | |
public static String Version = "1.2"; | |
/** | |
* --------------------------------------------------------- UTILITIES CLASS | |
* FOR JAVA PROGRAMMING @ LSRHS * AUTHOR: EDDIE HURTIG * SOME (c) MIKE | |
* MALONE * ------------------------------------------------------------ |
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
package { "sl": | |
ensure => "purged" | |
} |
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 | |
/** | |
* | |
* Gets the post meta for a specific post from the post indexer table | |
* | |
* @param int|post $post The ID of the Post that you want the meta for | |
* @param string $key (optional) The meta key of the data you want | |
* @param bool $single (optional) Whether to return a single Value | |
* @param int|bool $blog_id The ID of the blog that the post is located on |
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 | |
$timezone = 'America/New_York'; | |
$blogs = wp_get_sites(); | |
foreach ($blogs as $blog) { | |
switch_to_blog($blog['blog_id']); | |
echo 'Currently: ' . get_option('timezone_string') . ' for blog ' . $blog['blog_id'] . '<br />'; | |
echo (update_option('timezone_string', $timezone) ? 'Updated' : 'Did Not Update') . '<br /><br/>'; | |
restore_current_blog(); | |
} |
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 | |
/** | |
* Loops through all the blogs in the network switching blogs and calling the given function with a single site returned from wp_get_sites | |
* | |
* | |
* @param callable $lambda A function to execute for every single blog on the network | |
*/ | |
function foreach_blog( $lambda ) { | |
$blogs = wp_get_sites( array( 'limit' => false ) ); | |
foreach ( $blogs as $blog ) { |
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 | |
/** | |
* Allows you to loop through a simple posts query | |
* @example foreach_post( function () { wp_delete_post( $post->ID ); } ); | |
* | |
* @example foreach_post( 'faq', function () { echo $post->post_title . '<br />' } ); | |
* @example foreach_post( array( 'book', 'faq'), function () { echo $post->post_title; } ); | |
* @example foreach_post( 'book,faq', function () { echo $post->post_title; } ); | |
* | |
* @example foreach_post( false, false, function () { echo $post->post_title; } ); |
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
package jServe.Core; | |
/** | |
* A simple java stopwatch | |
*/ | |
public class StopWatch { | |
/** | |
* Whether the stopwatch is running | |
*/ | |
private boolean running; |
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
# Usage | |
# kitchen cloud test # Will run 'kitchen test' with 'KITCHEN_YAML=.kitchen.cloud.yml' | |
# kitchen local test # Will run 'kitchen test' with 'KITCHEN_YAML=.kitchen.local.yml' | |
# kitchen test # Will run 'kitchen test' without a KITCHEN_YAML specified | |
kitchen() { | |
if [[ 'cloud,local,dev,prod,stage' == *$1* ]]; then | |
echo "Starting kitchen with configuration file '.kitchen.$1.yml'" | |
if [[ -f ".kitchen.$1.yml" ]]; then | |
command export KITCHEN_YAML=.kitchen.cloud.yml |
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 | |
require 'aws-sdk' | |
require 'colorize' | |
AWS.config( | |
access_key_id: ENV['AWS_ACCESS_KEY_ID'], | |
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY']) | |
if ARGV.any? | |
security_group = ARGV[0] |
OlderNewer