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
function block_subs_func(){ | |
//checks for permission | |
if ( ! current_user_can( 'edit_posts' ) ){ | |
wp_redirect( site_url() ); | |
exit; | |
} | |
} add_action('admin_init', 'block_subs_func'); |
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
io.socket.get('/user', {}, function(users){ | |
console.log(users); | |
}); | |
io.socket.on('user', function(message){ | |
console.log('Got Message', message); | |
}); |
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
$.fn.formDataObject = function() | |
{ | |
if(this.is('form')){ | |
var data = {}; | |
for(var i = 0; i < this.serializeArray().length; i++){ | |
var input = this.serializeArray()[i]; | |
if(!$.isEmptyObject(input)){ |
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
/** Add Canada Map Data Points */ | |
jQuery.fn.vectorMap('addMap', 'canada_en', { | |
"width": 959, | |
"height": 593, | |
"pathes": { | |
"bc": { | |
"path": "M115.002022,492.434845C114.55525999999999,492.304596,104.467079,489.16922,96.636406,486.72699C93.93566899999999,485.884613,65.318649,475.155854,53.53839899999999,470.56906200000003C51.518176999999994,469.78247100000004,49.20412499999999,468.896973,48.39602299999999,468.60135C46.52484499999999,467.91678,46.20882799999999,467.42154000000005,46.19961899999999,465.15857C46.19448099999999,463.891328,45.87146699999999,463.051514,45.163504999999994,462.464936C42.316534999999995,460.105988,41.29464999999999,458.923493,41.29464999999999,457.98791600000004C41.29464999999999,457.422608,41.10435799999999,456.96002300000004,40.87167599999999,456.96002300000004C39.68412999999999,456.96002300000004,37.971918999999986,454.35577500000005,37.671739999999986,452.09274400000004C37.185518999999985,448.42761300000006,35.55198499999999,445.23871,32.66095199999999,44 |
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
/** | |
* Map any model attribute to another model attribute | |
* AR hasAttribute() required vs property_exist() | |
* @param $model1 | |
* @param $model2 | |
* @param $map array('id'=>'sku') The sku of the second model would map to the id of the first model | |
* @return array | |
*/ | |
function mapModelToModel($model1, $model2, $map) { | |
foreach ($map as $attr1 => $attr2) { |
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
.grid-view { | |
.summary { | |
} | |
.items { | |
thead { |
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
/** | |
Reference ONLY! Variables should be included elsewhere. | |
$small-lower:'767px'; | |
$medium-lower:'991px'; | |
$large-lower:'1199px'; | |
**/ | |
/** | |
Floats Based on BreakPoints | |
**/ |
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
/** | |
Reference ONLY! Variables should be included elsewhere. | |
$small-lower:'767px'; | |
$medium-lower:'991px'; | |
$large-lower:'1199px'; | |
**/ | |
/** | |
Build Alignment Based on Breakpoints | |
**/ |
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 | |
//View Location to auto load all .php files | |
$viewLocation = 'admin/variantRules/options'; | |
//PHP glob function will return array. If there is an error double check your path | |
foreach (glob( Yii::app()->basePath."/views/".$viewLocation."/*.php") as $filename) | |
{ | |
//Render every partial and load data | |
$this->renderPartial('//'.$viewLocation.'/'. str_replace('.php', '', array_pop( explode('/',$filename) ) ), array() ); | |
} |
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
<?=ucwords( implode(' ', preg_split('/(?=[A-Z])/',$str) ) ); ?> |