Skip to content

Instantly share code, notes, and snippets.

View colinfwren's full-sized avatar

Colin Wren colinfwren

View GitHub Profile
@colinfwren
colinfwren / 4sq-tutorial skeleton HTML
Created April 20, 2011 22:56
A skeleton HTML template for my foursquare tutorial
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Awesome Foursquare app</title>
<style>
body{
background-color: white;
font-size: 100%;
font-family: helvetica, arial, sans-serif;
}
@colinfwren
colinfwren / flot labels
Created June 14, 2011 22:10
Code for flot labelling project
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>How to add labels to a flot graph</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<style>
body{
padding: 1em;
@colinfwren
colinfwren / WP_nav.php
Created June 26, 2011 18:29
Code to add all parent pages
<?php
if(!$post->post_parent){
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0&depth=1");
}else{
if($post->ancestors){
$ancestors = array_reverse($post->ancestors, true);
foreach($ancestors as $ancestor){
$ancestor = wp_list_pages("title_li=&child_of=".$ancestor."&echo=0&depth=1");
echo "<ul>";
echo $ancestor;
@colinfwren
colinfwren / gctmark.html
Created June 27, 2011 19:54
Google Chart Tools example Gauge visualisation markup
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {packages:['gauge']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Label');
data.addColumn('number', 'Value');
@colinfwren
colinfwren / jsgmark.html
Created June 27, 2011 20:03
jsgauge example markup (based on the Google Chart Tools example)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Gauge demo</title>
@colinfwren
colinfwren / index
Created July 21, 2011 22:21
Index page for making your own foursquare app
<?php
/*
* index.php
*
* Copyright 2011 Colin Wren <colin@gimpneek.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@colinfwren
colinfwren / callback part one
Created July 21, 2011 22:28
Part one Callback page for tutorial on making your own foursquare app
<?php
/*
* callback.php
*
* Copyright 2011 Colin Wren <colin@gimpneek.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@colinfwren
colinfwren / web.config no cache
Created April 11, 2012 20:30
web.config to ensure no caching of files
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<outboundRules>
<rule name="Compression header">
<match serverVariable="RESPONSE_Cache-Control" pattern="(.*)" />
<action type="Rewrite" value="no-transform" />
</rule>
</outboundRules>
@colinfwren
colinfwren / htaccess no cache
Created April 11, 2012 20:47
.htacccess to ensure no caching of files
# stops mobile phone service providers from caching content
Header set Cache-Control "no-transform"
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;