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
\documentclass{article} | |
\title{LaTeX is now Sublime} | |
\author{Gabriele Petronella} | |
\begin{document} | |
\maketitle | |
\section{My first section} |
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
\documentclass{article} | |
\title{A long document} | |
\author{Gabriele Petronella} | |
\date{\today} | |
\begin{document} | |
\maketitle |
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
data UnionFindElement valueType = | |
RootElement valueType | | |
ElementWithParent valueType (UnionFindElement valueType) | |
deriving (Eq, Show) |
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
var money = | |
"@people: luca gio dani gabro claudio jaja mike paolo\n"+ | |
"@group: luca gio dani gabro claudio jaja\n"+ | |
"@date: debiti e payback\n"+ | |
"~Debiti (Dani 52.13 Luca 356.37 Gabro 13.18) claudio 309.88 gio 28.98 jaja 17.25 mike 64.51\n"+ | |
"15 gio -> dani\n"+ | |
"400 claudio -> gabro\n"+ | |
"10 dani -> jaja\n"+ |
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
var userSchema = new Schema( | |
fb_id : String, | |
firstName : String, | |
lastName : String, | |
messages : [{ | |
content : String, | |
positive : Boolean, | |
author : User, | |
created_at : {type : Date, default : Date.now}, | |
updated_at : {type : Date, default : Date.now} |
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
#!/bin/bash | |
FILES=`git ls-tree --name-only HEAD .` | |
MAXLEN=0 | |
IFS=$(echo -en "\n\b") | |
for f in $FILES; do | |
if [ ${#f} -gt $MAXLEN ]; then | |
MAXLEN=${#f} | |
fi | |
done |
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 buildo | |
import anorm._ | |
import shapeless._ | |
import shapeless.ops.hlist._ | |
import shapeless.record._ | |
import shapeless.syntax.std.traversable._ | |
import shapeless.syntax.singleton._ |
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 editResult(testId: LabOnlineId[Test], worklistId: LabOnlineId[Worklist], result: TestResult): Future[ActionResult] = | |
for { | |
test <- ensureExists(testId)(testData.findOne(_)) | |
sample <- ensureExists(test._sampleId)(sampleData.findOneWithWorklist(_, worklistId)) | |
} yield { | |
(ensureNotClosed(sample, worklistId) |@| | |
ensureNotClosed(test, worklistId))((_,_)) match { | |
case Failure(errors) => ActionResult.UserError(errors.toList: _*) | |
case Success(_) => /* run a stored procedure */ ActionResult.Ok | |
} |
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 gen(n: Int, limit: Int, k: Int = 1): Iterator[List[Int]] = { | |
val range = (k until limit).iterator | |
n match { | |
case _ if n > 0 => for { | |
x <- range | |
y <- gen(n - 2, limit, x) | |
} yield x :: y | |
case _ => range.map(List(_)) | |
} | |
} |
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 example | |
import scala.language.existentials | |
import shapeless._; import record._; import ops.record._; import ops.hlist._ | |
import spray.routing.SimpleRoutingApp | |
trait AutoGetParametersModule { self: SimpleRoutingApp => | |
import spray.routing.{ Directive, Directive1, Directive0, HListDeserializer } |
OlderNewer