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
#!/usr/bin/python | |
# MAPPER | |
# ref: http://open.blogs.nytimes.com/2014/07/10/emr-streaming-in-go/ | |
import sys | |
import simplejson as json | |
def main(): | |
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
import io | |
from IPython.nbformat import current | |
def execute_notebook(nbfile): | |
with io.open(nbfile) as f: | |
nb = current.read(f, 'json') | |
ip = get_ipython() | |
for cell in nb.worksheets[0].cells: | |
if cell.cell_type != 'code': | |
continue |
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
// Get, Parse and Transform JSONStreams on the fly before delivering to the browser | |
// ref: http://nodestreams.com/ | |
var express = require('express'), | |
server = express(); | |
var fs = require("fs"), | |
JSONStream = require("JSONStream"), | |
es = require('event-stream'); |
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
// 1*new Date() is a cross browser version of Date.now() | |
var d = 1*new Date() |
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
Examples: | |
JSCover report, ref: http://tntim96.github.io/JSCover/manual/manual.xml | |
String json = selenium.getEval("selenium.browserbot.getUserWindow().jscoverage_serializeCoverageToJSON();"); | |
Via SeleniumJQuery, ref: https://github.com/Nthalk/SeleniumJQuery/blob/master/example/com/anteambulo/SeleniumJQuery/example/Example.java | |
jq.query("[name=q]").val("SeleniumJQuery").parents("form:first").submit(); | |
String results = jq.queryUntil("#resultStats:contains(results)").text(); |
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
#macro(POJOListToJSON $list ) | |
#set($myList = $list ) | |
{ | |
#foreach($key in $myList.keySet()) | |
#set($x = $myList.get($key)) | |
"$key": #POJOToJSON($x) ## | |
#if($velocityCount != $myList.keySet().size()) | |
, | |
#end | |
#end |
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
# pretty git log | |
# ref: http://coderwall.com/p/euwpig?i=3&p=1&t=git | |
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -- |
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
# Git Shortlog format for nice lists of different files between SVN branches retaining git-svn-id's | |
git shortlog --format="%h %b %s" <branch>..master |
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
<!-- compile JS files to Java byte code in Ant --> | |
<java classname="org.mozilla.javascript.tools.jsc.Main" classpathref="rhino.class.path" fork="yes"> | |
<arg value="-debug"/> | |
<arg value="${basedir}/file/1.js"/> | |
<arg value="${basedir}/file/2.js"/> | |
</java> |
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
# Relax NG compact schema for Ant created JUnit XML files | |
start = testsuite | testsuites | |
property = element property { | |
attribute name {text}, | |
attribute value {text} | |
} | |
properties = element properties { |