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
node_modules |
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
/** | |
* Error Object Utility | |
* | |
* The ErrorTypes object defines the arbitrary custom error objects. | |
* | |
* Definitions: | |
* - Each object's key defines the property name in the export | |
* - Each object can have a 'constructor' property that is executed | |
* within the constructor of the Error object | |
* - All other properties of the object are extended onto the prototype |
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
{ | |
"cmd": ["bin/run_dev_debug.sh", "/usr/local/bin/node", "bootstrap.js"], | |
"selector": "source.js", | |
"working_dir": "/Users/Julian/Work/boomerang", | |
"path": "/usr/local/bin/" | |
} |
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
var fs = require("fs"); | |
var logPath = "C:\\wamp\\www\\sandbox\\node\\gigya\\log"; | |
var dates = {}; | |
fs.readdir(logPath, function(err, files) { | |
files.forEach(function(i) { | |
var m = i.match(/([0-9]+)/gi); | |
if (typeof dates[m[0]] == "undefined") dates[m[0]] = []; | |
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 | |
function register_price() { | |
$direction = "DESC"; //Default direction | |
if (isset($_GET["order_dir"]) && $_GET["order_dir"] == "ASC") { | |
$direction = "ASC"; | |
} | |
register_custom_queryable_field("price", array("dataType" => "numeric", "order" => $direction)); | |
} | |
?> |
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
The plain text icon used can be downloaded from: | |
http://www.iconfinder.com/icondetails/9091/128/plain_text_icon | |
I used the 16x16 version of the above. |
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 | |
/**** ADD FB IMAGES***/ | |
//Adding the Open Graph in the Language Attributes | |
function add_opengraph_doctype( $output ) { | |
return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"'; | |
} | |
add_filter('language_attributes', 'add_opengraph_doctype'); | |
//Lets add Open Graph Meta Info |
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 // answer to wpquestions.com #2235 by Julian Lannigan (julianlannigan.com) | |
function coauthor_add_to_wardrobe_link() { | |
$currentUrl = "http".(($_SERVER["HTTPS"] == "on") ? "s" : "")."://".$_SERVER["SERVER_NAME"].(($_SERVER["SERVER_PORT"] != "80") ? ":".$_SERVER["SERVER_PORT"] : "").$_SERVER["REQUEST_URI"]; //Gets current page url | |
if (defined('COAUTHORS_PLUS_VERSION')) { | |
global $current_user; | |
if (is_user_logged_in()) { | |
//Check if they have requested to be an author | |
if (isset($_REQUEST['addToWardrobe']) && is_numeric($_REQUEST['addToWardrobe']) && $_REQUEST['addToWardrobe'] > 0) { | |
if (!is_coauthor_for_post($current_user->user_login, $_REQUEST['addToWardrobe'])) { | |
$cAuthors = array(); |
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 // answer to wpquestions.com #2245 by Julian Lannigan (julianlannigan.com) | |
// GET THE DATA | |
$customFieldName = 'event_date'; | |
$outputData = array(); | |
$currentDate = time(); | |
$queryArgs = array( | |
'posts_per_page' => -1, | |
'meta_query' => array( |
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 // answer to wpquestions.com #2143 by Julian Lannigan (julianlannigan.com) | |
function override_logout_form() { | |
wp_logout(); | |
$logoutDestination = '/'; | |
$redirect_to = !empty($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : $logoutDestination; | |
wp_safe_redirect($redirect_to); | |
exit(); | |
} | |
add_action('login_form_logout', 'override_logout_form'); |