Find it here: https://github.com/bitemyapp/learnhaskell
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
| namespace ConsoleApplication1 | |
| { | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Net; | |
| using System.Security.Principal; | |
| using Microsoft.Owin.Hosting; | |
| using Nancy; | |
| using Owin; |
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
| /* | |
| Overview | |
| -------- | |
| To run a query using anorm you need to do three things: | |
| 1. Connect to the database (with or without a transaction) | |
| 2. Create an instance of `anorm.SqlQuery` using the `SQL` string interpolator | |
| 3. Call one of the methods on `SqlQuery` to actually run the query |
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
| @echo off | |
| REM Install Ghostscript 64bit from http://www.ghostscript.com/download/gsdnld.html | |
| REM Shrink all pdfs files in the current directory where this script is run and output to the | |
| REM compressed sub-folder | |
| setlocal | |
| set GS_BIN=C:\Program Files\gs\gs9.15\bin\gswin64c.exe | |
| set GS_OUTPUT_DIR=compressed | |
| mkdir %GS_OUTPUT_DIR% | |
| for %%i in (*.pdf) do "%GS_BIN%" -dNOPAUSE -dBATCH -dSAFER -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -sDEVICE=pdfwrite -sOutputFile="%GS_OUTPUT_DIR%\%%i" "%%i" |
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 shapeless._ | |
| import scalaz._ | |
| import Scalaz._ | |
| object console extends App { | |
| trait Foo[A] { | |
| type B | |
| def value: B |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
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 scala.annotation.{StaticAnnotation, compileTimeOnly} | |
| import scala.language.experimental.macros | |
| import scala.reflect.macros.whitebox.Context | |
| @compileTimeOnly("use macro paradise") | |
| class Extends[T](defaults: Any*) extends StaticAnnotation { | |
| def macroTransform(annottees: Any*): Any = macro Extends.impl | |
| } | |
| object Extends { |
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
| object FinanceDSL extends App { | |
| trait PrettyPrint[A] { | |
| def prettify(a: A): String | |
| class Ops(a: A) { | |
| def pretty: String = prettify(a) | |
| } | |
| } | |
| object PrettyPrint { |