Skip to content

Instantly share code, notes, and snippets.

@bhudgeons
bhudgeons / gist:3855170
Created October 8, 2012 21:39
Casbah 3.0 MongoDBList Strangeness
scala> import com.mongodb.casbah._
import com.mongodb.casbah._
scala> val dbl = MongoDBList()
16:23:48.222 [Thread-35] DEBUG c.m.c.c.c.s.package$RegisterConversionHelpers$ - Registering Scala Conversions.
16:23:48.225 [Thread-35] DEBUG c.m.c.c.c.s.package$RegisterConversionHelpers$ - Deserializers for Scala Conversions registering
16:23:48.226 [Thread-35] DEBUG c.m.c.c.c.s.package$RegisterConversionHelpers$ - Serializers for Scala Conversions registering
16:23:48.227 [Thread-35] DEBUG c.m.c.c.c.s.package$RegisterConversionHelpers$ - Setting up OptionSerializer
16:23:48.232 [Thread-35] DEBUG c.m.c.c.c.s.package$RegisterConversionHelpers$ - Setting up ScalaJCollectionSerializer
16:23:48.238 [Thread-35] DEBUG c.m.c.c.c.s.package$RegisterConversionHelpers$ - Setting up ScalaRegexSerializers
@bhudgeons
bhudgeons / Evernote Folder Action.scpt
Created August 22, 2012 05:12
AppleScript that creates an Evernote "drop box" for files.
(*
Works in Evernote v.3.3.0.
(Note: I've read of people having problems with
AppleScript with the AppStore version of Evernote.
If you're having trouble, you might want to sync,
then delete the appstore version and download the
mac app directly from Evernote.)
Based on:
@bhudgeons
bhudgeons / gist:3101404
Created July 12, 2012 22:06
Wunderground Weather API Integration with Databinder-Dispatch
import dispatch._
import dispatch.liftjson.Js._
import net.liftweb.json.JsonAST.JString
final val APIKEY = "XXXXXXXXX" // get a free key at http://www.wunderground.com/weather/api/
def getTemp(city: String, state: String) = {
val http = new Http
val url = :/("api.wunderground.com") / "api" / APIKEY / "geolookup" / "conditions" / "q" / state / (city + ".json")
http(url ># { json =>
@bhudgeons
bhudgeons / AggregationFrameworkTest.scala
Created February 21, 2012 16:24
MongoDB Aggregation Framework Via Casbah
import com.mongodb.casbah.Imports._
/*
* Simple test of the MongoDB Aggregation Framework via Casbah
*
* [Note: only works on MongoDB 2.1+]
*
* The "students" collection consists of student test score records that [simplified] look like this:
*
{