<?php
$db = new Turnpike\Db($dsn, DB_USER, DB_PASS);
$viewEngine = new Turnpike\PhpViewEngine(TEMPLATE_ROOT);
$router = new Turnpike\Router;
// Middleware
$router->Run(function (Turnpike\Request $req, Turnpike\Response $res) {
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
| module Log = | |
| open System | |
| open System.IO | |
| let private logDir = "logs" | |
| let private log kind fmt = | |
| Printf.kprintf (fun s -> | |
| let now = DateTime.Now | |
| let msg = sprintf "[%s] [%s] %s" (now.ToString("s")) kind s |
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
| module Http = | |
| open System | |
| open System.Net | |
| open System.Net.Http | |
| type RequestFailure = | |
| { Url : Uri | |
| StatusCode : HttpStatusCode option | |
| Message : string } |
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
| open System | |
| open System.Data | |
| open System.Data.Common | |
| open Donald | |
| // | |
| // Logging | |
| type LogError = | |
| { Error : exn | |
| Message : string } |
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
| open System | |
| open System.Text | |
| [<AbstractClass; Sealed>] | |
| type StringBuilderCache private () = | |
| // The value 360 was chosen in discussion with performance experts as a compromise between using | |
| // as litle memory (per thread) as possible and still covering a large part of short-lived | |
| // StringBuilder creations on the startup path of VS designers. | |
| [<Literal>] | |
| static let _maxBuilderSize = 360 |
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
| --DROP TABLE IF EXISTS calendar; | |
| --CREATE TABLE calendar AS | |
| WITH RECURSIVE dates_cte (dt) AS ( | |
| VALUES('1970-01-01') -- Choose a start date | |
| UNION ALL | |
| SELECT date(dt, '+1 day') | |
| FROM dates_cte | |
| WHERE dt < '2050-12-31' -- Choose an end date | |
| ), | |
| calendar_cte AS ( |
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
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory = $true, HelpMessage = "The path to the project")] | |
| [String] | |
| $Project, | |
| [Parameter(Mandatory = $true, HelpMessage = "The .NET Runtime Identifier")] | |
| [ValidateSet("win-x64")] | |
| [String] | |
| $Rid, |
OlderNewer