To install stuff needed to run chef in a solo mode (Small one or two server configuration):
gem install knife-solo
To setup chef after it has been installed:
(defmacro def-curry-fn [name args & body] | |
{:pre [(not-any? #{'&} args)]} | |
(if (empty? args) | |
`(defn ~name ~args ~@body) | |
(let [rec-funcs (reduce (fn [l v] | |
`(letfn [(helper# | |
([] helper#) | |
([x#] (let [~v x#] ~l)) | |
([x# & rest#] (let [~v x#] | |
(apply (helper# x#) rest#))))] |
#!/bin/sh | |
# | |
# NAME | |
# dirwatch - run command on file modification | |
# | |
# SYNOPSIS | |
# dirwatch [-m marker] command dir ... | |
# | |
# DESCRIPTION | |
# dirwatch uses a touch file to track whether files |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Network.Wai | |
import Network.Wai.Handler.Warp | |
import Network.HTTP.Types | |
import qualified Data.Text as T | |
import Data.Time.Clock | |
import Data.Time.Format |
Hello scala, my old friend | |
I've come to take you home again | |
Because a feature slowly creeping | |
left me plagued with doubts and weeping | |
and the version that was tagged in the repo | |
just has to go | |
it lacks the signs of soundness | |
On sleepless nights I hacked alone | |
applying ant and other tools of stone |
Welcome to Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> val x: Option[Nothing] = None | |
x: Option[Nothing] = None | |
scala> x match { | |
| case Some(a) => a | |
| case None => None |
package vsxmpp | |
import scalaz.EitherT | |
import scalaz._ | |
import Scalaz._ | |
case class ABC(s:String) | |
object ABC { | |
case class Utf8String(value: String) | |
object Utf8String { | |
implicit val ArbitraryUtf8String: Arbitrary[Utf8String] = | |
Arbitrary(arbitrary[String] map (k => | |
Utf8String(k filter (c => c < '\ud800' || c > '\udfff')))) | |
} |
// This character generator is similar to the default one from ScalaCheck, but it filters out: | |
// 1. Unprintable control characters. These cause problems in Mongo queries, and should not able | |
// to get into our database since they will not be present in inputs parsed from HTTP text. | |
// 2. Characters that do not exist in the default platform encoding. We can exclude a big range | |
// of these right away (which ScalaCheck does) because they're in the range used for two- | |
// character UTF-16 sequences, but others are only detected by checking Character.isDefined(_). | |
// The symptom of using a bad character in a string is that when you encode it to UTF-8 and | |
// back again, you get a different string, so any of our web and database tests that check the | |
// input against the output may fail-- and you'll see a question mark somewhere in the data, | |
// since that's how bad characters are displayed. |