Skip to content

Instantly share code, notes, and snippets.

View justinpitts's full-sized avatar

Justin Pitts justinpitts

View GitHub Profile
@justinpitts
justinpitts / RemoteIteratorWrapper.scala
Created April 10, 2019 20:10 — forked from timvw/RemoteIteratorWrapper.scala
scala wrapper for hadoop remote iterator
case class RemoteIteratorWrapper[T](underlying: org.apache.hadoop.fs.RemoteIterator[T]) extends scala.collection.AbstractIterator[T] with scala.collection.Iterator[T] {
def hasNext = underlying.hasNext
def next() = underlying.next()
}
object Conversions {
implicit def remoteIterator2ScalaIterator[T](underlying: org.apache.hadoop.fs.RemoteIterator[T]) : scala.collection.Iterator[T] = RemoteIteratorWrapper[T](underlying)
}
@justinpitts
justinpitts / springer-free-maths-books.md
Created December 28, 2015 21:41 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@justinpitts
justinpitts / lambda-dynamo.js
Last active August 29, 2015 14:25 — forked from markusklems/lambda-dynamo
Short aws lambda sample program that puts an item into dynamodb
console.log('Loading event');
var AWS = require('aws-sdk');
var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'});
exports.handler = function(event, context) {
console.log("Event data:");
console.log(JSON.stringify(event, null, ' '));
dynamodb.listTables(function(err, data) {
console.log(JSON.stringify(data, null, ' '));
@justinpitts
justinpitts / findMissingIndexes.sql
Created March 20, 2012 14:04 — forked from AndreasLazar/findMissingIndexes.sql
lists all missing indexes of the current SQL Server
SELECT
DB_NAME(d.database_id) AS database_name
, LEFT (PARSENAME(d.statement, 1), 32) AS table_name
, ISNULL (d.equality_columns , '') AS equality_columns
, ISNULL (d.inequality_columns , '') AS inequality_columns
, ISNULL (d.included_columns , '') AS include_columns
, s.avg_total_user_cost -- This column represent the average total user cost each time when the user query was executed
, s.avg_user_impact -- This column represents the value in percentages. It informs us the amount of improvement which you can get if the index is created.
, s.unique_compiles