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
# Tell ls to be colourful | |
export CLICOLOR=1 | |
# Tell grep to highlight matches | |
export GREP_OPTIONS='--color=auto' | |
# Solarized colors | |
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then TERM=gnome-256color; fi | |
if tput setaf 1 &> /dev/null; then | |
tput sgr0 |
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 | |
// Contains a list of script handles that Storyform wants to remove | |
// The defaults should be a list of WP core script handles that you know you don't want | |
// @see http://codex.wordpress.org/Function_Reference/wp_register_script#Handles_and_Their_Script_Paths_Registered_by_WordPress | |
$default_scripts_blacklist = array( | |
'jquery', | |
); | |
$scripts_blacklist = apply_filters( 'storyform-scripts-blacklist', $default_scripts_blacklist ); |
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 IP { | |
/** | |
* Helper method for validating the IP address. | |
* Handled IPv4 and filters out private and reserved ranges. | |
* @param $ip_address string | |
* @return $ip_address bool|string Returns false if invalid | |
*/ | |
protected function _validate_ip( $ip_address ) { | |
return filter_var( $ip_address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ); |
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 | |
function innocent_function() { | |
global $foo; | |
$foo = new Foobar($foo); | |
} | |
class Foobar { | |
public function __construct($original_value) { | |
echo 'I just did something evil.' . PHP_EOL; |
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 | |
$GLOBALS['pmc_required_plugins'] = array( | |
'debug-bar-console/debug-bar-console.php', | |
'debug-bar-cron/debug-bar-cron.php', | |
'debug-bar-extender/debug-bar-extender.php', | |
'debug-bar-super-globals/debug-bar-super-globals.php', | |
'debug-bar/debug-bar.php', | |
'developer/developer.php', | |
'jetpack/jetpack.php', | |
'log-deprecated-notices/log-deprecated-notices.php', |
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 | |
ETHERNET="en0" | |
WIRELESS="en1" | |
NGINX_CONFIGS_PATH="" | |
VRDEPORT=3389 | |
VRDEAUTHTYPE="external" | |
VRDEENABLED="off" | |
if [ -z $2 ]; then | |
VMNAME="dev-local" |
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 | |
MYSQL="/opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper" | |
NGINX="/opt/local/sbin/nginx" | |
PHPFPM="/opt/local/sbin/php-fpm" | |
PIDPATH="/opt/local/var/run" | |
MEMCACHED="/opt/local/bin/memcached -m 24 -P /opt/local/var/run/memcached.pid -u root" | |
if [ $1 = "start" ]; then | |
sudo $MYSQL start | |
echo "Starting php-fpm ..." |
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 | |
$server_url = 'http://example.com/endpoint/?ts=' . time(); | |
$shared_secret = 'random string of text'; // This is the same in server and client | |
$public_key = 'hello world'; // Each client has its own allowed key, this key is the same in the server and client | |
$headers = array( | |
'x-pmc-key: ' . $public_key, | |
'x-pmc-signature: ' . md5( $public_key . $shared_secret ), | |
); |
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
jQuery(':button, :submit, #post-preview, .submitdelete', '#submitpost').each(function(){ | |
var t = jQuery(this); | |
if ( t.hasClass('button-primary') ) | |
t.addClass('button-primary-disabled'); | |
else | |
t.addClass('button-disabled'); | |
t.prop('disabled', true); | |
t.on('click', function() { |
NewerOlder