Skip to content

Instantly share code, notes, and snippets.

View ryanfitton's full-sized avatar

Ryan Fitton ryanfitton

View GitHub Profile
@ryanfitton
ryanfitton / navigationToggleIcon.js
Created August 24, 2014 20:31
Toggle Class for Bootstrap navigation buttons
$('.navbar-toggle').click(function () {
$('.navbar-toggle i').toggleClass('fa-bars fa-times');
});
@ryanfitton
ryanfitton / WordPress 3.8 Custom Post Type Register Font Icon
Last active August 29, 2015 13:59
WordPress 3.8 Custom Post Type Register function using a Font Icon
// WordPress Custom Post Type Register for Portfolio
register_post_type('portfolio', array(
'public' => true,
'menu_icon' => 'dashicons-portfolio',
'label' => __( 'Portfolio', 'local' ),
);
@ryanfitton
ryanfitton / main.cf
Created December 31, 2013 12:47
Example main.cf file network settings for Post fix. Found in '/etc/postfix/main.cf'.
# network settings
inet_interfaces = all
mydomain = yourdomain.co.uk
myhostname = mailer
mynetworks = all
mydestination = localhost.$mydomain, localhost
relay_domains = proxy:mysql:/etc/zpanel/configs/postfix/mysql-relay_domains_maps.cf
@ryanfitton
ryanfitton / mailer.php
Last active January 1, 2016 20:19
Example PHP Mail script
<?php
$to = "sendtoperson@domain.com";
$subject = "This is the email subject";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From:<email@domain.com>" . "\r\n";
$headers .= "Reply-To:<sendbyperson@domain.com>" . "\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();
$message = "This is the message";
mail($to, $subject, $message, $headers);
@ryanfitton
ryanfitton / echo.php
Last active December 31, 2015 09:09
Get a users Bio Description whose email address is the same for what is set in WordPress' Administration within General Settings
<p><?php echo wpAdminEmailUserBio(); ?></p>
@ryanfitton
ryanfitton / wp-config.php
Last active December 26, 2015 15:39 — forked from kloon/wp-config.php
// Auto update all 3 types of WordPress releases
define('WP_AUTO_UPDATE_CORE', true);
// Disable all 3 types of WordPress releases
define('WP_AUTO_UPDATE_CORE', false);
// Only auto update WordPress minor core changes
define('WP_AUTO_UPDATE_CORE', 'minor');
@ryanfitton
ryanfitton / crontab -e
Last active November 22, 2016 08:27
A PHP cronjob to download podcasts via a PHP script. More info here: http://ryanfitton.co.uk/blog/php-cron-job-to-download-podcasts/
5 5 * * * php /var/www/Scripts/twit-get.php
@ryanfitton
ryanfitton / css3-android-robot-arms.html
Created August 17, 2013 21:26
A revised copy of an earlier Gist found here: https://gist.github.com/ryanfitton/6196475/ The right arm of the Android bot now animated so that it simulates waving. A demo of this can be found here: http://codepen.io/ryanfitton/pen/xuikf or http://ryanfitton.co.uk/blog/animated-android-bot-created-in-css3-code-snippet/
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ryanfitton.co.uk - Android robot using CSS3</title>
<meta name="description" content="ryanfitton.co.uk - Android robot using CSS3">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'>
<style type="text/css">
body {
@ryanfitton
ryanfitton / css3-android-robot.html
Last active December 20, 2015 21:18
Android Bot using CSS3. Created: 09/08/2013. Requires a modern browser such as Google Chrome, Mozilla FireFox or Apple Safari. Tested on Google Chrome Version 28.0.1500.95 m
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ryanfitton.co.uk - Android robot using CSS3</title>
<meta name="description" content="ryanfitton.co.uk - Android robot using CSS3">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'>
<style type="text/css">
body {
/* Gmail style scrollbar */
::-webkit-scrollbar {
width: 12px
}
::-webkit-scrollbar-thumb {
border-width: 1px 1px 1px 2px
}
::-webkit-scrollbar-track {
border-width: 0
}