This file contains 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
(def charvals (apply vector "ABCDEFGHJKMNPQRSTUVWXYZ23456789")) ; some characters weren't allowed in the codes | |
(defn rand-char [] (charvals (rand-int (count charvals)))) | |
(apply str (take 10 (repeatedly rand-char))) |
This file contains 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 '(org.joda.time LocalDate)) | |
(defn today [] (LocalDate.)) | |
;; basic functions to increment or decrement a date | |
(defn inc-date [#^LocalDate ds] (.plusDays ds 1)) | |
(defn dec-date [#^LocalDate ds] (.minusDays ds 1)) | |
;; generate infinite streams of LocalDate objects starting with start-ds | |
(defn inc-date-stream [#^LocalDate start-ds] (iterate inc-date start-ds)) |
This file contains 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
(ns nadsack.utils.queue | |
(:import (java.util.concurrent BlockingQueue LinkedBlockingQueue))) | |
(defn- generic-worker [worker-function #^BlockingQueue queue switch] | |
(future | |
(let [worker-id (.toString (java.util.UUID/randomUUID))] | |
(while (not (realized? switch)) | |
(let [work-item (.take queue)] | |
(cond |
This file contains 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
<?xml version="1.0"?> | |
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> | |
<!-- =============================================================== --> | |
<!-- Configure the Jetty Server --> | |
<!-- --> | |
<!-- Documentation of this file format can be found at: --> | |
<!-- http://wiki.eclipse.org/Jetty/Reference/jetty.xml_syntax --> | |
<!-- --> | |
<!-- Additional configuration files are available in $JETTY_HOME/etc --> |
This file contains 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
#################### | |
# Akka Config File # | |
#################### | |
# This is the Akka config template to be used for spray SERVLET CONTAINER deployments | |
akka { | |
version = "1.1.3" # Akka version, checked against the runtime version of Akka. | |
# spray requires nothing but akka-actors, which are implicitly enabled |
This file contains 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 com.biesnecker.scalajetty | |
import cc.spray._ | |
import org.eclipse.jetty.server.Server | |
import org.eclipse.jetty.xml.XmlConfiguration | |
import org.eclipse.jetty.webapp.WebAppContext | |
import java.io.File | |
object ScalaJetty { |
NewerOlder