Skip to content

Instantly share code, notes, and snippets.

View mattclements's full-sized avatar

Matt Clements mattclements

View GitHub Profile
<?php
//MODIFIED HEADER DATE
##################################################################################
function set_headerdate() {
$format = "%a, %d %b %Y %H:%M:%S %z";
// First check if there is a blog post date
if (function_exists('perch_blog_post_field') && function_exists('perch_get') && perch_blog_post_field(perch_get('s'), 'postDateTime', true)) {
$result = perch_blog_post_field(perch_get('s'), 'postDateTime', true);
header("Last-Modified: ".strftime($format, strtotime($result)));
<section class="section // section--base // section--fixed">
<div class="container">
<?php
//Array (Feature Title, Feature Description, Icon Class);
$adverts = array (
array('No Call Out Charge','Free quotation for all jobs','no-callout'),
array('Qualified Plumbers','Qualified Gas Safe Engineers','tick'),
array('Free Quotations','No obligation free quotations','contract'),
@mattclements
mattclements / gist:8163509
Created December 28, 2013 20:01 — forked from mwaterfall/gist:953657
Runtime iOS Version Checking
/*
* System Versioning Preprocessor Macros
*/
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
@mattclements
mattclements / README.md
Created August 5, 2012 11:49 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@mattclements
mattclements / CLAlert.h
Created April 14, 2012 05:42 — forked from 0xced/CLAlert.h
CLAlert
/*
* CLAlert is a drop-in replacement for NSAlert
*
* A CLAlert is exactly the same as a NSAlert, except for the alert style behavior
*
* - An alert with the informational style (NSInformationalAlertStyle) will always display a "Note icon" (kAlertNoteIcon)
* - An alert with the warning style (NSWarningAlertStyle) will always display a "Caution icon" (kAlertCautionIcon)
* - An alert with the critical style (NSCriticalAlertStyle) will always display a "Stop icon" (kAlertStopIcon)
*
* Tested on Mac OS X 10.5.8 and 10.6.1