Skip to content

Instantly share code, notes, and snippets.

@jbarrus
jbarrus / gulpfile.js
Last active August 7, 2017 10:12
protractor coverage support with gulp and istanbul (not tested, this is just extracted from larger files to demonstrate how to get protractor coverage working)
var istanbul = require('istanbul'),
gulp = require('gulp'),
istanbul = require('gulp-istanbul');
gulp.task('js', function() {
return gulp.src('js')
.pipe(istanbul({
includeUntested: true,
coverageVariable: '__coverage__'
}))
@jbarrus
jbarrus / WordCountJob.scala
Last active December 25, 2015 17:39
scalding wordcount - top 25 words
package com.twitter.scalding.examples
import com.twitter.scalding._
class WordCountJob(args : Args) extends Job(args) {
TextLine( args("input") )
.flatMap('line -> 'word) { line : String => tokenize(line) }
.groupBy('word){ _.size }
.groupAll { _.sortedReverseTake[(Long, String)](( 'size, 'word) -> 'top, 25) }
.flattenTo[(Long, String)]('top -> ('size, 'word))