Skip to content

Instantly share code, notes, and snippets.

View philgyford's full-sized avatar

Phil Gyford philgyford

View GitHub Profile
@philgyford
philgyford / .block
Last active December 12, 2017 04:14
D3.js v4 Ladder Graph
license: cc-by-sa-4.0
height: 570
scrolling: no
border: yes
{{#post}}
{{#get "posts" limit="1" order="published_at desc" filter=“tag:getting-started+published_at:<{{published_at}}"}}
{{#foreach posts}}
<a href="{{url}}">{{title}}</a>
{{/foreach}}
{{/get}}
{{/post}}
@philgyford
philgyford / apple-cinema-display.md
Created May 4, 2016 09:25
Apple Cinema Display
@philgyford
philgyford / config.json
Last active January 3, 2016 21:39
Twitter Bootstrap config for LP site.
{
"vars": {
"@body-bg": "#f3f0e9",
"@text-color": "#333",
"@link-color": "#ff6600",
"@font-family-sans-serif": "'Source Sans Pro', Helvetica, Arial, sans-serif-bg",
"@font-size-base": "17px",
"@line-height-base": "1.470588235",
"@font-size-h1": "27px",
"@font-size-h2": "20px",
@philgyford
philgyford / chart.html
Last active December 18, 2015 11:19
An adaptation of this example <http://bost.ocks.org/mike/chart/> of drawing multiple d3 charts on one page. I've altered it so that each chart can include more than one dataset.
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<title>d3 - multiple charts with multiple lines</title>
<!--
Based on this example of drawing multiple d3 charts on one page:
http://bost.ocks.org/mike/chart/
With pointers from Lars Kotthof on Stack Overflow:
# (create oauth2 tokens from Google Console)
client_id = ""
client_secret = ""
# (paste the scope of the service you want here)
# e.g.: https://www.googleapis.com/auth/gan
scope = ""
@philgyford
philgyford / artists_map_photos.html
Last active October 15, 2015 14:31
Quick demo of using APIs from The Echo Nest, Google Maps, and Flickr photos.
<!--
A form for a place.
When submitted, displays a list of music artists from that place.
And looks up the location with Google Geocoder and displays a map.
And displays Flickr photos from within that location.
REQUIRES:
* Echo Nest API Key.
* Google API Key (with access to JavaScript API and Geocoding API)
* Flickr API key
-->
@philgyford
philgyford / combine_feeds.php
Created October 7, 2015 06:47
PHP file to combine RSS feeds etc, used on gyford.com. Requires many other files to work...
<?php
/**
* @package Phil
* Combine recent photos, writing, links, etc into one feed and one HTML/PHP include.
*
* NOTE: Required the dom.so extension to be enabled in php.ini
* (It wasn't, by default, on Textdrive, 2013-03-14.)
*
* v1.4 2015-09-04
*
@philgyford
philgyford / gist:1596128
Created January 11, 2012 18:44
homebrew untracked files
phil@phils-mb:/usr/local$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# Library/Aliases/mikmod
# Library/Aliases/sshfs
# Library/Contributions/examples/brew-audit.rb
# Library/Contributions/examples/brew-fetch.rb
# Library/Contributions/examples/brew-options.rb
@philgyford
philgyford / test.html
Created November 24, 2014 12:16
jasmine-jquery SlideUp() test
<html>
<head>
<title>Test</title>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script>
$( document ).ready(function() {
$('a.link-1').on('click', function (ev) {
ev.preventDefault();