Skip to content

Instantly share code, notes, and snippets.

View mrl22's full-sized avatar
💭
Always coding

Richard Leishman mrl22

💭
Always coding
View GitHub Profile
<?php
// Dont forget to load twitter oauth via Composer
$twitteruser = 'webfwd';
$tweetexpire = 60 * 30; // Seconds
$tweetfile = 'twitter.txt';
use Abraham\TwitterOAuth\TwitterOAuth;
if (!file_exists($tweetfile) || (time()-filemtime($tweetfile)) > $tweetexpire) {
$connection = new TwitterOAuth(
<?php
$login = 'someone@somedomain.com';
$password = 'theirpassword';
$server = '{mail.someimapserver.com:143}INBOX.Sent';
$mbox = imap_open($server, $login, $password);
$n_msgs = imap_num_msg($mbox);
@mrl22
mrl22 / hover-triangle-animation.html
Last active January 10, 2017 14:41
Scolmore Hover Animation
<div class="homepage-content-1 espHoverZoom ehzRight">
<div class="ehzSlant">
<div class="ehzContent">
HTML HERE
</div>
<div>
</div>
@mrl22
mrl22 / hpraidcheck.sh
Created January 6, 2017 15:04
If something went wrong with the HP SmartArray disks this script will send an error email
#!/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
@mrl22
mrl22 / slide-out-underline.markdown
Last active January 9, 2017 15:02
Slide out underline
@mrl22
mrl22 / index.html
Created January 20, 2017 17:53
Specific info at specific times of day EST timezone
<div class="someclass"></div>
@mrl22
mrl22 / kappa-animation.markdown
Created January 20, 2017 17:56
Kappa animation
@mrl22
mrl22 / index.html
Created March 28, 2017 18:31
My Age
<div id="age"></div>
@mrl22
mrl22 / functions.php
Created April 6, 2017 11:15 — forked from brendonexus/Wordpress current template hook
Wordpress current template hook
add_action('get_footer', 'show_template');
function show_template()
{
global $template;
if ($_SERVER['REMOTE_ADDR'] == 'ip_address') echo basename($template);
}
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=%#%',