Skip to content

Instantly share code, notes, and snippets.

package examples
import org.specs2.mutable.Specification
import org.specs2.specification.{Before, Scope}
class BeforeWeirdnessSpec extends Specification {
"Before" should {
"execute before the example with a object" in context1 {
1 must_== 1
}
trait Functor[F[_]] {
def fmap[A,B](f: A => B): F[A] => F[B]
}
sealed trait Fruit
class Apple extends Fruit
class Orange extends Fruit
case class Basket[T](items: T*)
;;;###autoload
(defun gist-region-or-buffer (&optional private)
"Post either the current region, or if mark is not set, the current buffer as a new paste at gist.github.com
Copies the URL into the kill ring.
With a prefix argument, makes a private paste."
(interactive "P")
(condition-case nil
(gist-region (point) (mark) private)
(mark-inactive (gist-buffer private))))
import Control.OldException(catchDyn,try)
import DBus
import DBus.Connection
import DBus.Message
import XMonad
import XMonad.Config.Gnome
import XMonad.Util.EZConfig
import XMonad.Hooks.DynamicLog
import Control.OldException(catchDyn,try)
import DBus
import DBus.Connection
import DBus.Message
import XMonad
import XMonad.Config.Gnome
import XMonad.Util.EZConfig
import XMonad.Hooks.DynamicLog
package eg
import com.typesafe.config.ConfigFactory
import akka.actor.{ ActorRef, Props, Deploy, Actor, ActorSystem, Address, AddressFromURIString }
import akka.remote.RemoteScope
class HelloActor extends Actor {
def receive = {
case _ => println("hello")
}
}
require 'chef/resource/deploy'
require 'chef/provider/deploy/revision'
class Chef
class Resource
class Deploy
def before_rollback(arg=nil, &block)
arg ||= block
set_or_return(:before_rollback, arg, :kind_of => [Proc, String])
implicit val arbitraryDate: Arbitrary[DateTime] = Arbitrary {
val gmt = DateTimeZone.UTC
for {
year <- Gen.choose(1970, 2050)
month <- Gen.choose(1, 12)
day <- Gen.choose(1, 28) // TODO: there is a better way to get the number of days in a month -- see: http://www.exampledepot.com/egs/java.util/GetDaysInMonth.html
hour <- Gen.choose(0, 23)
minute <- Gen.choose(0, 59)
second <- Gen.choose(0, 59)
millis <- Gen.choose(0, 999)
;; use uniquify
(require 'uniquify)
(setq
uniquify-buffer-name-style 'post-forward
uniquify-separator ":")
@lamdor
lamdor / -
Created September 1, 2013 17:15
Hello from the command line