Skip to content

Instantly share code, notes, and snippets.

ryanfitton / index.html
Created Jul 29, 2015
PHP Function: Get a file's last modification timestamp - FInal HTML -
View index.html
<link rel="stylesheet" href="css/styles.cssstyles.css?v=1438124400">
ryanfitton / function.php
Last active Aug 29, 2015
PHP Function: Get a file's last modification timestamp - PHP Function -
View function.php
//Get the file's last modified timestamp
function lastModTimestamp($filename, $filepath = NULL, $displayV = false) {
//Combine filepath and filename
$file = $filepath . $filename;
//If this file exists
if (file_exists($file)) {
//Get the filename's last modified date
$lastModDate = date("Y-m-d", filemtime($file));
View index.html
<link rel="stylesheet" href="css/styles.css<?php echo lastModTimestamp("styles.css", "css/", true)); ?>">
ryanfitton / .htacess
Last active Aug 29, 2015
This snippet is great to use if you have recently switched your Wordpress website over to HTTPS only. Paste this snippet into your .htaccess and overwrite the standard Wordpress code at the top of the file.
View .htacess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
ryanfitton / function.php
Created Jul 22, 2015
Convert Reserved XML charecters to Entities
View function.php
Convert Reserved XML charecters to Entities
function xml_convert($str, $protect_all = FALSE) {
$temp = '__TEMP_AMPERSANDS__';
// Replace entities to temporary markers so that

Keybase proof

I hereby claim:

  • I am ryanfitton on github.
  • I am ryanfitton ( on keybase.
  • I have a public key whose fingerprint is 25A2 D449 12AB E7E2 F37E A263 1FA8 09C4 CF42 7FE6

To claim this, I am signing this object:

ryanfitton / command
Created Sep 26, 2014
Ubuntu Bash 'Shell Shock' vulnerability patch for Debian/Ubuntu systems
View command
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
apt-get update && apt-get install -y bash
ryanfitton / functions.php
Created Sep 15, 2014
functions.php - Custom login
View functions.php
* Created September 2014
* @author Ryan Fitton
* @copyright Copyright (c) 2014, Ryan Fitton
//Customer WordPress login styling
function custom_login_css() {
ryanfitton / custom-login.css
Last active Aug 29, 2015
View custom-login.css
* Description: WordPress Custom Login
* Author: Ryan Fitton
* Author URI:
* Version: 2014
body.login {
background: #ad473b!important;
color: #484848!important;
ryanfitton / navigationMarkup.html
Created Aug 24, 2014 Navigation Menu Markup
View navigationMarkup.html
<nav class="navbar navbar-default" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-links">
<span class="sr-only">Toggle navigation</span>
<i class="fa fa-bars"></i>
<a class="navbar-brand" href=""><img src="logo.png" alt="Ryan Fitton logo" /></a>