View this code at http://livecoding.io/5162494
Useful for understanding the relationship between data and the graphic representation in d3.
http://mbostock.github.com/d3/tutorial/circle.html
This seems to be the key to working with d3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hash_to_ostruct(object) | |
return case object | |
when Hash | |
object = object.clone | |
object.each do |key, value| | |
object[key] = hash_to_ostruct(value) | |
end | |
OpenStruct.new(object) | |
when Array | |
object = object.clone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:if(document.createElement && document.childNodes){var bm = document.createElement('script');var head = document.getElementsByTagName('head')[0];head.appendChild(bm);bm.setAttribute('src', 'https://raw.github.com/gist/1594792/grid.js');}else{alert('Sorry, your browser cannot do this')} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Logging = (function () { | |
function create(source) { | |
function F() {} | |
F.prototype = source; | |
return new F(); | |
}; | |
var LoggerBase = function (opts) { | |
var opts = opts || {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From: http://www.mcqn.com/cgi-bin/weeknotecalc | |
def weeknote_week(this_week) | |
registration_date = Date.civil(2010,3,29) | |
# Get the start of the week for each of those dates | |
if registration_date.wday == 0 | |
# wday of 0 is Sunday, and we want our weeks to start on Monday | |
registration_date = registration_date - 6 | |
else | |
registration_date = registration_date - (registration_date.wday - 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://piwik.org/features/ | |
http://www.openwebanalytics.com/ | |
iStats? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:if(document.createElement && document.childNodes){var bm = document.createElement('script');var head = document.getElementsByTagName('head')[0];head.appendChild(bm);bm.setAttribute('src', 'https://raw.github.com/gist/1217428/grid.js');}else{alert('Sorry, your browser cannot do this')} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setCacheMaxAge($ageInSecs) | |
{ | |
$this->blq->setContentMaxAge($ageInSecs); | |
$this->blq->setIsUK(true); | |
$this->blq->setShowAdverts(false); | |
$this->blq->setCountry('uk'); | |
$this->blq->setContentCacheability('public'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~$ traceroute 192.168.192.10 | |
traceroute to 192.168.192.10 (192.168.192.10), 64 hops max, 52 byte packets | |
1 * * * | |
traceroute: sendto: No route to host | |
2 traceroute: wrote 192.168.192.10 52 chars, ret=-1 | |
*traceroute: sendto: Host is down | |
traceroute: wrote 192.168.192.10 52 chars, ret=-1 | |
*traceroute: sendto: Host is down | |
traceroute: wrote 192.168.192.10 52 chars, ret=-1 | |
* |