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
// Add to the body_class function | |
function condensed_body_class($classes) { | |
global $post; | |
// add a class for the name of the page - later might want to remove the auto generated pageid class which isn't very useful | |
if( is_page()) { | |
$pn = $post->post_name; | |
$classes[] = "page-".$pn; | |
} |
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
/** | |
* Javascript function to load the corresponding image based on window resolution. | |
* | |
* Usage: | |
* <div id='story' data-adaptive-bg='{ | |
* "desktop": "/static/img/banners/press/press-1920x1080.jpg", | |
* "tablet": "/static/img/banners/press/press-992x500.jpg", | |
* "mobile": "/static/img/banners/press/press-768x400.jpg" | |
* }'> | |
* </div> |
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
/** Angular JS datepicker fix for mssql dates | |
* | |
*/ | |
app.directive('datepickerLocaldate', ['$parse', function ($parse) { | |
var directive = { | |
restrict: 'A', | |
require: ['ngModel'], | |
link: link | |
}; |
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 1: | |
-- Change DB_CHARSET from utf-8 to latin1 in wp-config.php | |
-- define('DB_CHARSET', 'latin1'); | |
-- Try 2: | |
-- Clean up post_content | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '“', '“'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, 'â€', '”'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '’', '’'); |
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
/** | |
* Usage <year-select range=10 offset=0 /> | |
* | |
* | |
*/ | |
app.directive('monthSelect',function(){ | |
return { |
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
/** | |
* Usage: <year-select offset=0 range=10 /> | |
* | |
*/ | |
app.directive('yearSelect',function(){ | |
var currentYear = new Date().getFullYear(); | |
return { | |
restrict: 'AE', | |
replace: 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
<?php | |
/** | |
* It recursively includes all the files in the specified directory $dir and skips the ones in $skipFiles array | |
* Usage: | |
* include_files(dirname(__FILE__)."/models", $skipFiles); | |
* | |
* @return void | |
* @author Mohsin Rasool | |
* |
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
/** | |
* Post multi-dimensional array to a URL using PHP Curl. | |
* Usage: | |
* $req = new MultiDimArrayPost(); | |
* $req->postToURL('http://xyz.com/post',$_POST); | |
* | |
* @package default | |
* @author Mohsin Rasool | |
* | |
**/ |
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
/** | |
* Displays Assigned Cleverness todos in WP Full Calendar | |
* | |
* @return $items | |
* @author Mohsin Rasool | |
**/ | |
add_filter( 'wpfc_events', 'wpfc_add_tasks' ); | |
add_filter( 'wpfc_ajax', 'wpfc_add_tasks' ); |
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 | |
/** | |
* This script deletes all the provided files from FTP server. | |
* | |
* Application: This script helps when server is being compromised and several malicious files has detected. Some common spams are | |
* | |
* HG.PHP.Shell.25968.UNOFFICIAL | |
* JCDEF.Obfus.CreateFunc.BackDoorEval-23 | |
* JCDEF.Obfus.CreateFunc.BackDoorEval-26 | |
* JCDEF.Obfus.CreateFunc.BackDoorEval-21 |