Skip to content

Instantly share code, notes, and snippets.

View chrisparnin's full-sized avatar

Chris Parnin chrisparnin

View GitHub Profile
@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 + ":");
@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: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: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: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 / 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 / cal-heat-map.js
Created July 9, 2016 00:47
Demo Calendar Heat map
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Focus sessions</title>
<meta name="description" content="pomodoro">
<meta name="author" content="Chris Parnin">
@Test
public void postMessage()
{
driver.get("https://csc510-fall16.slack.com/");
// Wait until page loads and we can see a sign in button.
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("signin_btn")));
// Find email and password fields.
@chrisparnin
chrisparnin / baker.yml
Created August 31, 2018 00:34
Brain-jupyter
name: brain-jupyter
vm:
ip: 192.168.88.11
ports: 8888
lang:
- python2
tools:
- jupyter
commands:
serve: jupyter notebook --no-browser --NotebookApp.token=''
@chrisparnin
chrisparnin / baker.yml
Created August 31, 2018 01:29
Hibernate-spring example
name: hibernate-spring
vm:
ip: 192.168.8.8
ports: 8080
vars:
- mysql_password:
prompt: Type your password for mysql server
tools:
- maven
services: