Skip to content

Instantly share code, notes, and snippets.

@frosforever
frosforever / Cleanly.scala
Created April 1, 2015 16:09
Open, use, and clean up resource safely
def cleanly[T, V](create: => T)(cleanup: T => Unit)(f: T => V): Try[V] =
Try {
val t = create
try {
f(t)
} finally {
cleanup(t)
}
}
scalacOptions ++= Seq(
// "-Xprint:typer", // Turn this on if WartRemover acts up, to see full syntax tree
"-deprecation",
"-encoding", "UTF-8", // yes, this is 2 args
"-feature",
"-unchecked",
"-Xfatal-warnings", // Treat Warnings as Errors
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code", // N.B. doesn't work well with the ??? hole
@frosforever
frosforever / MSSQL_ObjectEncryptionCracker.sql
Created February 17, 2015 02:09
Stored Proc to decrypt MS SQL stored procs
/*
Used to decrypt MS SQL stored procs and functions.
Stolen from http://sqlity.net/en/1617/decrypting-encrypted-database-objects/
Must be run as DAC (admin in front of server name eg. ADMIN:localhost)
*/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
@frosforever
frosforever / ReleaseChecker.md
Last active August 29, 2015 14:12
Idea to check if commit is included in a release

Issues might be resolved and refrence a commit that has been merged, but without checking out the repo and then running git tag --contains <sha> theres no easy to tell if the commit is in a release.