Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8" ?>
<NotFoundHandlers>
<notFound assembly="umbraco" type="SearchForAlias" />
<notFound assembly="umbraco" type="SearchForTemplate"/>
<notFound assembly="umbraco" type="SearchForProfile"/>
<notFound assembly="CatchAllRouteHandler" namespace="Our" type="CatchAll"/>
<notFound assembly="umbraco" type="handle404"/>
</NotFoundHandlers>
@nlinker
nlinker / build.sbt
Created October 31, 2013 17:33 — forked from seratch/build.sbt
organization := "net.seratch"
name := "sandbox"
version := "0.1"
scalaVersion := "2.9.1"
libraryDependencies ++= Seq(
"junit" % "junit" % "4.9" withSources(),
@nlinker
nlinker / Goblins.scala
Last active December 27, 2015 07:49
Play 2.1 JSON combinators with Either type (generalized format for Either)
package com.tapad.dfe
import play.api.libs.json._
import play.api.libs.functional.syntax._
import play.api.libs.json.JsSuccess
import play.api.libs.json.JsString
import play.api.libs.json.JsBoolean
import play.api.data.validation.ValidationError
import play.api.libs.json.JsNumber
package controllers
import play.api._
import libs.ws.WS
import play.api.mvc._
import com.micronautics.paypal.{TransactionProcessor, PaypalTransactions}
import java.net.URLEncoder
import concurrent.{Await, ExecutionContext}
import concurrent.duration.Duration
import java.util.concurrent.TimeUnit
  • schedule = a job every 10 minutes

  • jobtype.time = the time moment between scheduled era and not scheduled yet

  • current time = when the scheduler runs

current time current jobtype.time actions made by scheduler new jobtype.time value
09:50 10:00 no action
10:05 10:00 jobs: 10:00, 10:10, 10:20, 10:30, 10:40, 10:50 jobtype.time = 11:00
@nlinker
nlinker / gist:7696815
Created November 28, 2013 19:06
My update for scalaz.Validation example out there
package com.tapad.dfe
import scalaz._
import java.lang.String
import collection.immutable.List
import collection.Traversable
import scala.None
import scalaz.syntax.{IdOps, ToValidationOps}
/**
* Part Zero : 10:15 Saturday Night
*
* (In which we will see how to let the type system help you handle failure)...
*
* First let's define a domain. (All the following requires scala 2.9.x and scalaz 6.0) */
import scalaz._
import Scalaz._
object Sobriety extends Enumeration {
//
// An attempt to workaround SI-2712, foiled by SI-3346
//
trait TC[M[_]]
type EitherInt[A] = Either[Int, A]
implicit object EitherTC extends TC[EitherInt]
@nlinker
nlinker / gist:7790033
Last active December 30, 2015 06:29
Scalaz Validations attempt for Resolvers
/**
* The function merges job template and job type and
* adds source and destination to the resolved object
*/
def resolve(jobType: JobType,
jobTemplate: JobTemplate,
dataSource: DataSource,
dataDestination: DataDestination): Try[JobTypeResolved] = {
// include needed imports here to reduce lookup
import scalaz._
@nlinker
nlinker / sbt.xml
Created February 7, 2014 12:32 — forked from ambantis/sbt.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ScalaSbtSettings">
<option name="linkedExternalProjectsSettings">
<SbtProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="useAutoImport" value="true" />
</SbtProjectSettings>
</option>
</component>