This file contains hidden or 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 bash | |
UPDATE_ELB_POLICY=${UPDATE_ELB_POLICY:-0}; | |
TMPFILE=`mktemp -t example.XXXXXXXXXX` && { | |
printf "Region|Status|Current security policy|Expected security policy|ELB|Action\n" >> "${TMPFILE}"; | |
aws ec2 describe-regions |awk -F'"' '/RegionName/ {print $4}' | while read region; do | |
LATEST_PREDEFINED_SECURITY_GROUP=$(aws --region=$region elb describe-load-balancer-policies | grep -i PolicyName | awk -F '"' '{print $4}' | head -n1 | sed 's/[ \r\n]//g'); |
This file contains hidden or 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
# This is a short collection of tools that are useful for managing your | |
# known_hosts file. In this case, I'm using the '-f' flag to specify the | |
# global known_hosts file because I'll be adding many deploy users on this | |
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts | |
# Add entry for host | |
ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts | |
# Add IP-based entry for current IP | |
ip=$(dig +short github.com A) |
This file contains hidden or 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
try { | |
if (komodo.view.scintilla) { komodo.view.scintilla.focus(); } | |
var currentPos = komodo.editor.currentPos; | |
var ke = komodo.editor; | |
var file = komodo.interpolate('%F'); | |
var php = komodo.interpolate('%(php)'); | |
var script = "/usr/local/zend/bin/php_beautifier"//this can be changed to the path of php_beautifier, install using PEAR | |
var cmd = script+" --filters='ArrayNested()' "+file; // add options dialog? | |
StatusBar_AddMessage("Beautifying "+file,"editor",5000,true); |
This file contains hidden or 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 'rubygems' | |
require 'railsless-deploy' | |
load 'config/deploy' |
This file contains hidden or 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 | |
/** | |
* Performs a search | |
* | |
* This class is used to perform search functions in a MySQL database | |
* | |
* @version 1.0 | |
* @author John Morris <[email protected]> | |
*/ | |
class search { |
This file contains hidden or 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 React_YOLO { | |
public function __construct() { | |
add_action( 'admin_menu', array( $this, 'admin_menu' ) ); | |
} | |
public function admin_menu() { | |
add_menu_page( 'React', 'React', 'edit_posts', 'react', array( $this, 'page' ) ); | |
} |
This file contains hidden or 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 | |
/* | |
Usage: | |
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL | |
if ( !$frag->output() ) { // NOTE, testing for a return of false | |
functions_that_do_stuff_live(); | |
these_should_echo(); | |
// IMPORTANT | |
$frag->store(); | |
// YOU CANNOT FORGET THIS. If you do, the site will break. |
This file contains hidden or 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
''' | |
This is a module that defines some helper classes and functions for | |
expiring groups of related keys at the same time. | |
Written July 1-2, 2013 by Josiah Carlson | |
Released into the public domain | |
''' | |
import time |
This file contains hidden or 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 | |
/** | |
* Send debug code to the Javascript console | |
*/ | |
function debug_to_console($data) { | |
if(is_array($data) || is_object($data)) | |
{ | |
echo("<script>console.log('PHP: ".json_encode($data)."');</script>"); | |
} else { | |
echo("<script>console.log('PHP: ".$data."');</script>"); |