Skip to content

Instantly share code, notes, and snippets.

View arjones's full-sized avatar

Gustavo Arjones arjones

View GitHub Profile
@arjones
arjones / TowersOfHanoi.scala
Created April 3, 2012 03:23 — forked from jrudolph/TowersOfHanoi.scala
Scala-Metaprogramming: Towers of Hanoi
/*
* This is the Towers of Hanoi example from the prolog tutorial [1]
* converted into Scala, using implicits to unfold the algorithm at
* compile-time.
*
* [1] http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/2_3.html
*/
object TowersOfHanoi {
import scala.reflect.Manifest
@stonegao
stonegao / KafkaEmbedded.scala
Created May 11, 2012 03:11 — forked from mardambey/KafkaEmbedded.scala
Embedded Kafka broker / producer / simple consumer in a single process useful for testing or for persistent queues.
import java.util.Properties
import kafka.server.KafkaServer
import kafka.server.KafkaConfig
import kafka.producer.ProducerConfig
import kafka.producer.Producer
import kafka.message.Message
import kafka.producer.ProducerData
import kafka.consumer.ConsumerConfig
import kafka.consumer.Consumer
import kafka.utils.Utils
@SyntaxC4
SyntaxC4 / breakBlobLease.js
Last active December 16, 2016 19:26
This code snippet will help break Blob Leases in Windows Azure Storage.
/*
* This code snippet will help break Blob Leases in Windows Azure Storage.
*
* I did not write this code, it was found at the website below.
*
* @see http://blogs.msdn.com/b/interoperability/archive/2012/08/01/node-js-script-for-releasing-a-windows-azure-blob-lease.aspx
*/
// updated 3/3/2014 for latest version of Azure CLI
// Import required modules from Windows Azure Cross Platform Tool's library
@ibuenros
ibuenros / SparkUtils.scala
Created June 29, 2014 17:12
Spark productionizing utilities developed by Ooyala, shown in Spark Summit 2014
//==================================================================
// SPARK INSTRUMENTATION
//==================================================================
import com.codahale.metrics.{MetricRegistry, Meter, Gauge}
import org.apache.spark.{SparkEnv, Accumulator}
import org.apache.spark.metrics.source.Source
import org.joda.time.DateTime
import scala.collection.mutable