Skip to content

Instantly share code, notes, and snippets.

View lukehoersten's full-sized avatar

Luke Hoersten lukehoersten

View GitHub Profile
{-# LANGUAGE OverloadedStrings #-}
module Racemetric.Form.Datetime where
import Control.Applicative ((<$>), (<*>))
import Control.Monad (liftM2, liftM3)
import Data.Text (Text)
import Data.Time.Calendar (Day (..))
import Data.Time.Format (formatTime, parseTime)
import Data.Time.LocalTime (LocalTime (..), TimeOfDay (..),
-- Uncaught exception: 'getPromise: dereferenced empty key (id 0)'
manyWithSplices :: Monad n
=> Splice n
-- ^ Splice to be run
-> Splices (RuntimeSplice n a -> Splice n)
-- ^ Splices to be bound to each runtime data first
-> RuntimeSplice n [a]
-- ^ Runtime data needed by the above splices
ssl_certificate cert.pem;
ssl_certificate_key cert.key.pem;
ssl_trusted_certificate cert.ca.pem;
ssl_dhparam cert.dh.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers FIPS@STRENGTH:!aNULL:!eNULL;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
ssl_certificate ssl-bundle.crt;
ssl_certificate_key ssl-private.key;
ssl_session_timeout 5m;
start on startup
setuid racemetric
exec angel angel.conf
racemetric {
# -I0 = Turn off idle GC, -A4M = 4megs of initial heap, -qg1 = Parallel GC in gen 1
exec = "racemetric -p 8080 -e prod +RTS -I0 -A4M -qg1"
stdout = "log/stdout.log"
stderr = "log/stderr.log"
}

Keybase proof

I hereby claim:

  • I am lukehoersten on github.
  • I am lukehoersten (https://keybase.io/lukehoersten) on keybase.
  • I have a public key whose fingerprint is 0D06 8FE1 ADB0 DB1C ED5E C68F E729 278A A9B2 B3BC

To claim this, I am signing this object:

Verifying that +lukehoersten is my openname (Bitcoin username). 1NzRr6vUysYfsLfRr8tm5Vvj4Ro1n2UVHyhttps://onename.io/lukehoersten
test-suite test
type: exitcode-stdio-1.0
main-is: Test.hs
hs-source-dirs: test/src/
default-language: Haskell2010
ghc-options: -threaded "-with-rtsopts=-N" -fhpc
build-depends: HUnit >= 1.2 && < 1.3
, base >= 4.7 && < 4.9
, your-lib >= 0.1 && < 0.2
@lukehoersten
lukehoersten / BCryptHash.hs
Created March 8, 2016 17:38
BCrypt hash example in Haskell
import Crypto.BCrypt (hashPasswordUsingPolicy)
import Data.ByteString.Char8 (ByteString, pack)
hash :: String -> IO (Maybe ByteString)
hash = hashPasswordUsingPolicy hp . pack
where hp = HashingPolicy 12 $ pack "$2y$"