Skip to content

Instantly share code, notes, and snippets.

@tfayyaz
tfayyaz / chelsea-vs-spurs-24032012.js
Created March 24, 2012 12:16
Chelsea vs Spurs score prediction.
//My predictions for today's score in javascript format ready for the browser console.
//Just a quick practise after reading the tutorial at http://www.itnewb.com/tutorial/Introduction-to-JSON-and-PHP
var fbScores = {date: '24-03-2012', kickoff: '12.45', game_results: [{team: 'Chelsea FC', score: 3},{team: 'Spurs', score: 1}]}
console.log(fbScores.game_results[0].team + " - " + fbScores.game_results[0].score)
console.log(fbScores.game_results[1].team + " - " + fbScores.game_results[1].score)
@tfayyaz
tfayyaz / dabblet.css
Created April 12, 2012 21:05
Untitled
h1 {
}
#wrapper {
width: 800px;
height:auto;
border: 0px solid black;
}
#first {
@tfayyaz
tfayyaz / testgist.md
Last active October 4, 2015 11:18
Test gist

hello world

<script>
var hello = 'goodbye';
</script>
@tfayyaz
tfayyaz / gist:3519554
Created August 29, 2012 22:12
Check and list extra parameters listed on a page using underscore.js
// Check and list extra parameters listed on a page; using underscore.js
taken via
var tmParam = {page_name : '/default.aspx',
currency_code : 'GBP',
product_price : '',
product_quantity : '',
lid_code : 'XXX',
product_sku : '',
product_category : '',
@tfayyaz
tfayyaz / gist:3520306
Created August 29, 2012 23:26
Examine HAR files using underscore cli
created using https://github.com/ddopson/underscore-cli
C:\>type techcrunch.har | underscore select .url > techcrunchurls.txt
C:\>type techcrunch.har | underscore select .url --outfmt text > techcrunchurls2.txt
C:\>type techcrunch.har | underscore select .url --outfmt text | grep mydomain > techcrunchurls2.txt
'grep' is not recognized as an internal or external command,
operable program or batch file.

In[140]:

%pylab inline
Populating the interactive namespace from numpy and matplotlib

This example shows how it is possible to use a D3 sunburst visualization (partition layout) with data that describes sequences of events.

A good use case is to summarize navigation paths through a web site, as in the sample synthetic data file (visit_sequences.csv). The visualization makes it easy to understand visits that start directly on a product page (e.g. after landing there from a search engine), compared to visits where users arrive on the site's home page and navigate from there. Where a funnel lets you understand a single pre-selected path, this allows you to see all possible paths.

Features:

  • works with data that is in a CSV format (you don't need to pre-generate a hierarchical JSON file, unless your data file is very large)
  • interactive breadcrumb trail helps to emphasize the sequence, so that it is easy for a first-time user to understand what they are seeing
  • percentages are shown explicitly, to help overcome the distortion of the data that occurs wh
@tfayyaz
tfayyaz / README.md
Last active August 29, 2015 13:59 — forked from mbostock/.block