This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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*) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;;###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)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; use uniquify | |
| (require 'uniquify) | |
| (setq | |
| uniquify-buffer-name-style 'post-forward | |
| uniquify-separator ":") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Hello from the command line |