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 | |
$fp = fopen("https://cloud-messaging.bitrix24.com", "r"); | |
$stream_meta = stream_get_meta_data($fp); | |
print_r($stream_meta); | |
?> | |
Result: | |
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
var sys = require('util') | |
var exec = require('child_process').exec; | |
var child; | |
var bashos = 'unix'; | |
child = exec("echo $PATH", function (error, stdout, stderr) { | |
if( (stdout.indexOf('Windows') > -1) || (stdout.indexOf('System32') > -1) ) { | |
bashos = 'windows'; | |
} |
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
db.mailing_entries.aggregate([ | |
{ $match: { subscribed_lists: | |
{ $in: | |
[ | |
"5a325d04f0050c78698b4567", | |
"5822295cf0050c06358b4568", | |
"57acb826f0050c006f8b4567", | |
"57acbf78f0050c0e408b4567", | |
"579a1c61f0050c06528b4589", | |
"579a1c61f0050c06528b4588", |
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 duplicates = []; | |
var searchstring = ''; | |
var myCursor = db.household_entries.find().addOption(DBQuery.Option.noTimeout); | |
myCursor.forEach( function(hhDoc) { | |
searchstring = hhDoc.full_name + ' ' + hhDoc.address_line_1 + ' ' + hhDoc.post_code_5; | |
queryString = '\"' + searchstring.split(' ').join('\" \"') + '\"'; | |
var dupArr = []; | |
var agg = | |
[ | |
{ |
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_filter('upload_dir', 'cdn_upload_url'); | |
function cdn_upload_url($args) | |
{ | |
$current_user = wp_get_current_user(); | |
$current_user_id = $current_user->ID; | |
$is_id_user = ($current_user_id > 0) ? true : false; | |
switch($is_id_user) | |
{ | |
case true: | |
$admin_users = array('administrator', 'editor', 'author'); //Add roles that you don't want to CDN swap |
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_filter('upload_dir', 'cdn_upload_url'); | |
function cdn_upload_url($args) | |
{ | |
if (!is_admin()) { | |
$args['baseurl'] = 'https://your-awesome-cdn.net/wp-content/uploads'; | |
} | |
return $args; | |
} |