Skip to content

Instantly share code, notes, and snippets.

View chrisparnin's full-sized avatar

Chris Parnin chrisparnin

View GitHub Profile
@chrisparnin
chrisparnin / GSR.cs
Last active April 26, 2017 14:55
Get GSR and Heart Rate in Universal App from Microsoft Band 2
using Microsoft.Band;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace App1
{
@chrisparnin
chrisparnin / gist:bc558a27256d673cf5ba
Created August 17, 2014 06:08
Export python tutor apache log to CSV
import sys
import urllib.parse
import re
import tempfile
import os
import csv
import hashlib
from subprocess import STDOUT,CalledProcessError,check_output
@chrisparnin
chrisparnin / gist:5dc44232162892088ed8
Created August 16, 2014 07:14
Execute Python Tutor Snippets
import sys
import urllib.parse
import re
import tempfile
import os
from subprocess import STDOUT,CalledProcessError,check_output
PATTERN_START = u".py?user_script="
@chrisparnin
chrisparnin / gist:6896515
Created October 9, 2013 05:11
Syntax highlighting, diff highlighting, inner diff highlighting for unified diffs. A work in progress.
<style>
del {
background-color: #fdd;
text-decoration: none;
color:#000 !important;
}
ins {
background-color: #dfd;
text-decoration: none;
@chrisparnin
chrisparnin / gist:6849751
Created October 6, 2013 05:02
Syntax highlighting for Markdown Pad.
<link href="https://cdnjs.cloudflare.com/ajax/libs/prettify/r224/prettify.css" type="text/css" rel="stylesheet" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prettify/r224/prettify.js">
</script>
<script>
$(document).ready(function()
{
$("pre").addClass("prettyprint");
prettyPrint();
@chrisparnin
chrisparnin / gist:6032323
Last active December 19, 2015 23:08
Summarize JSON
var sum = function(o, tabLevel){
for(var prop in o){
if(o.hasOwnProperty(prop)){
var val = o[prop];
var header = "";
for( var t = 0; t < tabLevel; t++ )
{
header += '\t';
}
console.log(header + prop + ":");