Skip to content

Instantly share code, notes, and snippets.

View ivanistheone's full-sized avatar

Ivan Savov ivanistheone

View GitHub Profile
@ivanistheone
ivanistheone / heart_beat_diagram.js
Created July 22, 2013 16:40
I would like to make a ECG-like hear-beat diagram, but the default x-sampling rate shows a gap in the graph. Paste this into http://graphie-to-png.khanacademy.org/ to see the results. Any suggestions are welcome.
// X and Y ranges of the graph
var X_RANGE = [-2, 10];
var Y_RANGE = [-35, 100];
// Width of the graph in pixels
// Let's use 400 for "normal" graphs and 170 for "small" graphs
var SIZE = 400;
var xScale;
var yScale;
@ivanistheone
ivanistheone / gist:4249678
Created December 10, 2012 09:57
Semi-finished version of visitor script
#!/usr/bin/env python
from collections import defaultdict, namedtuple
import datetime
from operator import itemgetter
import re
import requests
import json
@ivanistheone
ivanistheone / gist:4249353
Created December 10, 2012 08:35
Parsing access log and collecting sessions
#!/usr/bin/env python
import re
from collections import defaultdict, namedtuple
import datetime
f = open("access.log")
logfiles_list = [ f.readlines() ]