Skip to content

Instantly share code, notes, and snippets.

View TCotton's full-sized avatar
🏠
Working from home

Andrew Walpole TCotton

🏠
Working from home
View GitHub Profile
@TCotton
TCotton / goldanratio.scss
Created March 11, 2014 05:56
creating golden ratio grid with sass - fixed with
// creating golden ratio grid with sass - fixed with
$container_width: 970;
$column_width: 70;
$column_margins: 10;
$columns: 12;
div[class*="cols_"] {
display: inline;
float: left;
@TCotton
TCotton / jsonp.js
Last active August 29, 2015 14:05
jsonp.js
/**
* @function _jsonpCall
* @description function for JSONP
* Uses JSONP, adds content to page, adds the image error event and a click event that is used
* to record the product ID when the user clicks on the link
* @param categoryIdentifier {string}
* @param dssid {string}
* @private
*
*/
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
</head>
<body>
unique id = 25712513758137523
<tr>
<#import "/spring.ftl" as spring />
<#if dataModel?has_content>
<#list dataModel as campaign>
<#assign access = "" />
<#if campaign.createdBy != genericModel.userEmail>
<#assign access = "disabled" />
</#if>
<#assign status = "">
<#if campaign.status = "ACTIVE_LIVE">
@TCotton
TCotton / logerrors.php
Last active August 29, 2015 14:05
Log JavaScript errors server-side with this simple PHP script
<?php
if (isset($_GET) && count($_GET) > 0) {
function logErrors($fh, array $fields, $delimiter = ',', $enclosure = '"', $mysql_null = false) {
if (is_writable($fh)) {
$filename = $fh;
if (!$handle = fopen($fh, 'a+')) {
@TCotton
TCotton / Animated-form-checkboxes.markdown
Last active August 29, 2015 14:06
A Pen by Andy Walpole.
@TCotton
TCotton / Styling-a-dropdown-select-list.markdown
Last active August 29, 2015 14:06
A Pen by Andy Walpole.
@TCotton
TCotton / page_load.js
Last active August 29, 2015 14:10
Template page load script
/**
* Original Size: 855 bytes gzipped (2.33KB uncompressed)
* Compiled Size: 493 bytes gzipped (837 bytes uncompressed)
* */
// non-minified
(function(window, document) {
if (window.Promise) {
var testFlexBox = function textFlexBox() {
var flexElement = document.createElement('detect');
if (!Object.is(flexElement.style.webkitFlexWrap, 'undefined') ||
!Object.is(flexElement.style.msFlexWrap, 'undefined') ||
!Object.is(flexElement.style.flexWrap, 'undefined')
) {
return true;
}
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<link rel="import" href="/compiled/assets/js/admin/templates/common/head-import.html">
<script>
(function(document){
var link, template, clone;