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 add_stylesheet_once( url ){ | |
$head = $('head'); | |
if( $head.find('link[rel="stylesheet"][href="'+url+'"]').length < 1 ) | |
$head.append('<link rel="stylesheet" href="'+ url +'" type="text/css" />'); | |
} |
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
// … find all gist scripts inside the ajax container | |
var $gists = $ajax_container.find('script[src^="https://gist.github.com/"]'); | |
// if gist embeds are found | |
if( $gists.length ){ | |
// update each gist | |
$gists.each(function(){ | |
// we need to store $this for the callback |
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 | |
add_filter( 'wp_get_attachment_url', function( $url, $id ){ | |
if( is_ssl() ) | |
$url = str_replace( 'http://', 'https://', $url ); | |
return $url; | |
}); |
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 | |
//add your server aliases here | |
$servers = array( | |
"185.14.184.234" => "mcfly.bensmann.no", | |
"185.14.184.xxx" => "another.server.com", | |
); | |
//this script is triggered by this command from the terminal or cron: | |
//echo "time=`uptime`&df=`df -h`" | curl -s -d @- http://domain.com/path/to/script.php |
NewerOlder