Skip to content

Instantly share code, notes, and snippets.

View rorygibson's full-sized avatar

Rory Gibson rorygibson

  • Many and various
  • London mostly
View GitHub Profile
@rorygibson
rorygibson / README.md
Created October 30, 2012 12:47
Simple Clojure webapp with database

Install Leiningen (https://github.com/technomancy/leiningen)

Create project like so:

rgibson@thingy:~$ lein new compojure hello-world

rgibson@thingy:~$ mysql -u <username> helloworld << EOF
> create database helloworld;
> [Ctrl-D]
@rorygibson
rorygibson / highcharts-usage.js
Last active December 18, 2015 02:29
Demonstrate some of the usage of Highcharts
var apiKey = 'd9c2b94b63634dbf8ce94420608ca5af';
function drawChart(element, theData) {
$(element).highcharts({
title: {
text: "Stats over time"
},
chart: {
zoomType: 'x',
@rorygibson
rorygibson / draw-logo.js
Created August 13, 2013 19:31
Draw the BrightNorth logo (as at 13-8-2013)
/*
Canvas setup
*/
var body = d3.select('body');
var w = 842;
var h = 596;
var svg = d3.select("body")
.append("svg")
@rorygibson
rorygibson / paths-excerpt.js
Created August 13, 2013 19:36
Excerpt from paths.js, demonstrating rendering function map
var logo = {
'single':function() {
linearGradient(svg, 'singleCircleGradient', "254.5531", "340.0544", "283.5381", "322.4521")
logoGroup.append("circle").attr('fill','url(#singleCircleGradient)').attr('cx','253.376').attr('cy','340.769').attr('r','16.952');
},
'double':function() {
linearGradient(svg, 'doubleBlobGradient', "189.4633", "270.2707", "270.4365", "270.2707");
@rorygibson
rorygibson / draw-logo-excerpt.js
Created August 13, 2013 19:38
Example of iterating and running the rendering functions in paths.js
// Draw logo (blobs)
var startDelay = 100;
var logoGroup = svg.append('g');
var logoKeys = Object.keys(logo);
for (i=0;i<logoKeys.length;i++) {
var fn = logo[logoKeys[i]];
setTimeout(fn, startDelay + (i*delay));
}