Skip to content

Instantly share code, notes, and snippets.

@ymasory
ymasory / hetzner-email
Created June 6, 2013 18:55
Hetzner security email
Dear Client
At the end of last week, Hetzner technicians discovered a "backdoor" in one
of our internal monitoring systems (Nagios).
An investigation was launched immediately and showed that the administration
interface for dedicated root servers (Robot) had also been affected. Current
findings would suggest that fragments of our client database had been copied
externally.
@ymasory
ymasory / MyAppConfig.scala
Last active December 14, 2015 01:58
Fail fast with Typesafe Config
import com.typesafe.config.{ Config, ConfigFactory, ConfigException }
import scala.util.control.Exception._
/* At the beginning of app execution load essential configurations and assign
* them to vals. */
object MyAppConfig {
private[this] val conf: Config = trapConfig {
ConfigFactory.load() getConfig "myapp"
@ymasory
ymasory / build.sbt
Last active December 12, 2015 07:18
Dealing with SIP-18 (language imports) in the presence of cross-compilation in build.sbt
scalaVersion := "2.10.0"
// Let's support all "modern" Scala versions.
crossScalaVersions := Seq(
"2.9.3-RC1",
"2.9.2",
"2.9.1", "2.9.1-1",
"2.9.0", "2.9.0-1",
"2.8.0", "2.8.1", "2.8.2"
)
yuvi@curry ⮀ ~desk/my-scalatra-web-app ⮀ ./sbt
Detected sbt version 0.12.2
Starting sbt: invoke with -help for other options
Downloading sbt launcher 0.12.2:
From http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.12.2/sbt-launch.jar
To ./.lib/0.12.2/sbt-launch.jar
Using /Users/yuvi/.sbt/0.12.2 as sbt dir, -sbt-dir to override.
[info] Loading project definition from /Users/yuvi/Desktop/my-scalatra-web-app/project
[info] Updating {file:/Users/yuvi/Desktop/my-scalatra-web-app/project/}default-4fb257...
[info] Resolving org.scala-sbt#precompiled-2_10_0;0.12.2 ...
@ymasory
ymasory / bay-scala-jobs
Last active February 18, 2020 20:48
Companies hiring Scala developers in the Bay Area.
Companies hiring Scala developers in the Bay Area.
Created in response to a thread on scala-base.
My favorites:
- CloudPhysics
- Wordnik
Unbiased list:
- 10Gen
- Audax Health
@ymasory
ymasory / scala-irc
Last active August 30, 2017 21:16
List of all Scala-related IRC channels.
Please help compile a list of all Scala-related IRC rooms.
All of these channels are on Freenode.
#akka | concurrency & distribution framework
#argonaut | json library
#fp-in-scala | the book Functional Programming in Scala
#geotrellis | geoprocessing library
#indyscala | regional scala group
#json4s | json library
@ymasory
ymasory / validation-matchers.scala
Created December 1, 2012 00:16
specs2 matchers for scalaz 6's Validation typeclass
package org.specs2
package matcher
import text.Quote._
import execute.{ Failure => SpecsFailure, Result }
import scalaz.{ Failure, Success, Validation }
/** scalaz 6 Validation matchers created by exact analogy to specs2's
* built-in Either/Left/Right matchers.
* You can't change the package of this file from org.specs2.matcher or
@ymasory
ymasory / gist:3909209
Created October 18, 2012 00:38
(1) using scala.None in Java, and (2) converting com.google.common.base.Optional to scala.Option
import com.google.common.base.Optional;
import scala.None$;
import scala.Option;
public class ScalaLang {
public static <T> Option<T> none() {
return (Option<T>) None$.MODULE$;
}
@ymasory
ymasory / emacs-whitespace-long-lines.md
Created September 27, 2012 15:44
configuring emacs to show whitespace and long line problems

Configuring emacs for long line & whitespace detection

Goals

For a few years now I've been trying to get emacs to alert me, somehow, to:

  • lines longer than 80 characters
  • literal tabs (\t)
  • carriage returns (\r)
  • trailing whitespace at the end of a line ([ ]+$)

I've tried many strategies, but usually the result was something I found a little too intrusive, or difficult to manage.

@ymasory
ymasory / gist:3782247
Created September 25, 2012 14:24
Build Your Website in Scala in a Day

Build Your Website in Scala in a Day

This is a proposed event to be held in Philly. Comments welcome.

  • Theme is "Build Your Website in Scala in a Day". The goal would be for each participant to literally create and deploy a website in a Scala web framework in one day. No spectators; everyone builds a site! It can be your personal homepage, a hobby site, a business site, or anything else, so long as you fully intend to deploy (in alpha condition) at the end of the day.
  • The event would be oriented toward developers who already have a reasonable knowledge of Scala, but have never used it to build a website.
  • The event would be held on a Friday in 6-8 weeks, in Philadelphia. Friday because I want it to be a little more professional and business-oriented than Scalathon. Employers who actually need a website can send employees, for example.
  • It would feature 2 or 3 frameworks (to be determined, based on interest/availability of core developers to attend). There would be maybe 7-10 participants p