Skip to content

Instantly share code, notes, and snippets.

View nathanhornby's full-sized avatar

Nathan Hornby nathanhornby

View GitHub Profile
@nathanhornby
nathanhornby / XML Country List
Last active September 11, 2024 21:11
XML Country list, with country code, ISO number, continent, handle and alternative spelling attributes.
<?xml version='1.0' encoding='UTF-8'?>
<countries>
<country code='af' handle='afghanistan' continent='asia' iso='4'>Afghanistan</country>
<country code='al' handle='albania' continent='europe' iso='8'>Albania</country>
<country code='dz' handle='algeria' continent='africa' iso='12'>Algeria</country>
<country code='as' handle='american-samoa' continent='polynesia' iso='16'>American Samoa</country>
<country code='ad' handle='andorra' continent='europe' iso='20'>Andorra</country>
<country code='ao' handle='angola' continent='africa' iso='24'>Angola</country>
<country code='ai' handle='anguilla' continent='north america' iso='660'>Anguilla</country>
<country code='aq' handle='antarctica' continent='antarctica' iso='10'>Antarctica</country>
@nathanhornby
nathanhornby / master.xsl
Last active July 11, 2022 20:06
An HTML5 master utility template for SymphonyCMS (XSLT).
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<xsl:text disable-output-escaping="yes">&lt;</xsl:text>!DOCTYPE html<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
<xsl:text disable-output-escaping="yes"><![CDATA[
<!--[if lt IE 7 ]> <html lang="en" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js lt-ie9 lt-ie8"> <![endif]-->
@nathanhornby
nathanhornby / typeform-velocity.js
Created December 4, 2015 11:37
Scroll to active field in form (typeform style animation) using velocity.js
// Insert into some kind of 'focus' action
var parent = $(this).parent().parent('.fieldWrap'); // Target a wrapper
// Reset active state
$('.fieldWrap').removeClass('active');
// Add active state to current field
parent.addClass('active');
@nathanhornby
nathanhornby / pagination.php
Created April 14, 2014 15:00
CodeIgniter table pagination
<?php
$order_by = ''; // URL segment 2
$sort = 'desc'; // URL segment 3
$page = '1'; // URL segment 4
$data_total = ''; // Total number of entries
$number_of_rows = 10; // Number of table rows per page
$page_limit = 10; // Max pages shown in pagination at a time
if($this->uri->segment(2)){
$order_by = $this->uri->segment(2);
@nathanhornby
nathanhornby / Preferences.sublime-settings.JSON
Last active August 30, 2018 16:08
My Sublime Text 3 user preferences
{
"bold_folder_labels": true,
"caret_style": "wide",
"color_scheme": "Packages/Alchemist/Alchemist.tmTheme",
"draw_white_space": "selection",
"enable_tab_scrolling": false,
"ensure_newline_at_eof_on_save": true,
"font_face": "DejaVu Sans Mono",
"font_size": 12.5,
"highlight_line": true,
@nathanhornby
nathanhornby / twitter_cards.html
Last active April 13, 2018 18:49
Twitter Cards
<!-- Summary card https://dev.twitter.com/cards/types/summary -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@thisisduo" />
<meta name="twitter:title" content="Utilising Twitter Cards for better social engagement" />
<meta name="twitter:description" content="Twitter card reference guide." />
<meta name="twitter:image" content="http://shot.li/cage/300/300/" />
<meta name="twitter:url" content="http://duo.agency/blog/post/Q9GZ6/" />
<!-- Summary card with large image https://dev.twitter.com/cards/types/summary-large-image -->
<meta name="twitter:card" content="summary_large_image" />
@nathanhornby
nathanhornby / brunch-config.js
Last active March 31, 2018 10:50
Adding Jeet to Brunch - After
// Configure your plugins
plugins: {
stylus: {
plugins: ['jeet']
},
babel: {
// Do not use ES6 compiler in vendor code
ignore: [/vendor/]
}
},
@nathanhornby
nathanhornby / brunch-config.js
Last active March 31, 2018 10:49
Adding Jeet to Brunch - Before
// Configure your plugins
plugins: {
babel: {
// Do not use ES6 compiler in vendor code
ignore: [/vendor/]
}
},
@nathanhornby
nathanhornby / master.html
Last active February 7, 2017 11:57
HTML5 Master
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#222222" />
<!-- Meta -->
<title>Title</title>
@nathanhornby
nathanhornby / main.styl
Last active October 13, 2016 13:54
Full main.styl
// Includes
@import 'jeet'
@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,700italic,400italic')
// Base
@import '_000-reset'
@import '_001-colors'
@import '_002-typography'
@import '_003-global'