A Pen by Richard Leishman on CodePen.
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
#!/bin/bash | |
### | |
#If something went wrong with the HP SmartArray disks this script will send an error email | |
### | |
if [ `/usr/sbin/hpacucli controller slot=2 physicaldrive all show | grep -E '(Failed|Rebuilding)'| wc -l` -gt 0 ] | |
then | |
msg="RAID Controller Errors" | |
#echo $msg | |
/usr/sbin/hpacucli controller slot=2 ld all show detail > /tmp/hpacucli.log | |
mail -s "$HOSTNAME [ERROR] - $msg" "some-email@addrss.com" < /tmp/hpacucli.log |
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
<div class="homepage-content-1 espHoverZoom ehzRight"> | |
<div class="ehzSlant"> | |
<div class="ehzContent"> | |
HTML HERE | |
</div> | |
<div> | |
</div> |
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
<div class="someclass"></div> |
A Pen by Richard Leishman on CodePen.
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
<div id="age"></div> |
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_action('get_footer', 'show_template'); | |
function show_template() | |
{ | |
global $template; | |
if ($_SERVER['REMOTE_ADDR'] == 'ip_address') echo basename($template); | |
} |
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 your_custom_pagination() { | |
global $wp_query; | |
$total = $wp_query->max_num_pages; | |
if ( $total > 1 ) { | |
if ( !$current_page = get_query_var('paged') ) { | |
$current_page = 1; | |
} | |
echo paginate_links(array( | |
'base' => get_pagenum_link(1) . '%_%', | |
'format' => '?paged=%#%', |
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
$clientid = '{0000-0000-0000-0000}'; | |
function letmc_call($action, $xml) { | |
$headers = array( | |
"Content-type: text/xml;charset=\"utf-8\"", | |
"Accept: text/xml", | |
"Cache-Control: no-cache", | |
"Pragma: no-cache", |
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 curl2json($url, $header_opts=array(), $cache_life=300) { | |
$cache_file = md5($url.json_encode($header_opts)).'.txt'; | |
if (!file_exists($cache_file) || (time() - filemtime($cache_file)) >= $cache_life) { | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_SSL_VERIFYPEER => FALSE, | |
CURLOPT_FOLLOWLOCATION => FALSE, | |
CURLOPT_RETURNTRANSFER => 1, |