Skip to content

Instantly share code, notes, and snippets.

@RicSwirrl
RicSwirrl / map-manager.js
Created September 28, 2011 12:42
getBoundaryData
// private functions
// ...
var getBoundaryData = function(tiles) {
var noOfTiles = tiles.length;
// nothing to do.
if(noOfTiles == 0) {
@RicSwirrl
RicSwirrl / map-manager.js
Created September 28, 2011 12:26
Map Manager refresh function
// public api.
MapManager.prototype = {
refresh: function() {
$(this).trigger('started');
var tiles = getTiles();
getBoundaryData(tiles);
}
}
@RicSwirrl
RicSwirrl / head.html
Created September 28, 2011 11:18
head (in progress)
<head>
<!-- other stuff here ... -->
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="javascripts/raphael.js"></script>
<script src="javascripts/swirrl.js"></script>
<script src="javascripts/swirrl/map-manager.js"></script>
</head>
@RicSwirrl
RicSwirrl / map-manager.js
Created September 19, 2011 16:10
IMD Map Explorer initial map-manager
(function() {
// the constructor.
var MapManager = function(googleMap, initialScoreDomain) {
self = this;
map = googleMap;
scoreDomain = initialScoreDomain;
};
// public API
@RicSwirrl
RicSwirrl / google-map.js
Created September 19, 2011 15:52
IMD Map Explorer map instance
var map = new google.maps.Map(document.getElementById("map_canvas"), {
zoom: 14,
center: new google.maps.LatLng(53.48, -2.245), // Manchester
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl: false
});
@RicSwirrl
RicSwirrl / swirrl.js
Created September 19, 2011 15:47
IMD Map Explorer swirrl namespace
// just set up the namespace, and a logger wrapper
window.swirrl = {
log: function(){
if(window.console){
window.console.log( Array.prototype.slice.call(arguments) );
}
}
};
@RicSwirrl
RicSwirrl / main-closure.html
Created September 19, 2011 15:38
IMD Map Explorer HTML page closure
<script type="text/javascript">
(function(){
})();
</script>
@RicSwirrl
RicSwirrl / map.html
Created September 19, 2011 15:09
IMD Map Explorer Page Structure
<!doctype html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<title>IMD Map Explorer</title>
<link rel="stylesheet" type="text/css" href="stylesheets/map.css" />
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&region=GB"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="javascripts/raphael.js"></script>
</head>
testStartAndStopEvent: function(test) {
browser.get('/events/start/1', function(res, $) {
res.should.have.status(200);
console.log(res.body); // => undefined
browser.get('/events/stop/1', function(res2, $) {
res2.should.have.status(200);
test.done();
});
});
}
@RicSwirrl
RicSwirrl / gist:657914
Created November 1, 2010 09:54
Notes on Amy Hoy's and Kelly Parkinson's Infoproducts show and tell.

Disclaimer: some of this stuff wasn’t explicitly said, it’s my interpretation of it (plus own ideas)

  • Could just write blog articles and just collect/expand them into an ebook.
  • people wouldn’t want to pay lots of times for each chapter, but it’s good to release early. Ways to get round this:
    - have a season ‘pass’ like peepcode where people can pay upfront for the whole thing or just buy one edition if that’s all they want.
    OR:
    - release book early with only one or two chapters for a cheap price, but increase the price as you add more content. Early buyers can get updates for free as they come out.
  • Make something that makes people feel better about themselves or relieves pain.