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
node_modules/ | |
*.sw* |
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
# MySQL. Versions 4.1 and 5.0 are recommended. | |
# | |
# Install the MySQL driver: | |
# gem install mysql2 | |
# | |
# And be sure to use new-style password hashing: | |
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
development: | |
adapter: mysql2 | |
encoding: utf8 |
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
{-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving, TemplateHaskell, DeriveDataTypeable #-} | |
module Server where | |
import Control.Monad | |
import Control.Monad.Trans | |
import Control.Monad.Reader | |
import Control.Monad.Error | |
import Happstack.Server | |
import Happstack.Server.Error | |
import Happstack.Server.ClientSession |
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
{-# LANGUAGE OverloadedStrings #-} | |
module Auth where | |
import Control.Monad.Trans (liftIO) | |
import Control.Exception (bracket) | |
import Happstack.Server | |
import Server | |
import Web.Authenticate.BrowserId (checkAssertion) | |
import Network.HTTP.Conduit (newManager, closeManager, def) | |
import Data.Text (Text) |
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
main :: IO () | |
main = simpleHTTP nullConf $ do | |
_ <- compressedResponseFilter | |
msum | |
[ dir "" $ do | |
nullDir | |
ok . toResponse $ object ["status" .= ("ok" :: Text)] | |
, serveDirectory DisableBrowsing [] "./public/" | |
, notFound . toResponse $ object ["error" .= ("not found" :: Text)] | |
] |
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
{-# LANGUAGE Arrows #-} | |
module Main where | |
import Prelude hiding ((.), id) | |
import Control.Applicative | |
import Control.Arrow | |
import Control.Wire | |
import Control.Exception | |
import Control.Monad.Loops | |
import qualified Control.Monad as M (when) |
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
between = hold (pure down . keyDown <|> pure up . keyUp) |
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
playerPos :: (Float, Float) -> SF (Float, Float) (Float, Float) | |
playerPos p0 = proc speed -> do | |
rec | |
p' <- (^+^ p0) ^<< integral -< speed | |
pos <- arr clampPos -< (p', pos) | |
returnA -< pos | |
where clampPos ((x,y), (ox, oy)) = (clamp x ox 40 720, clamp y oy 40 520) | |
clamp a v mi ma | a > mi && a < ma = a | |
| otherwise = v |
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
{-# LANGUAGE Arrows, NoMonomorphismRestriction #-} | |
module Main where | |
import Prelude hiding ((.), id) | |
import Control.Applicative | |
import Control.Arrow | |
import Control.Wire | |
import qualified Control.Monad as M (when) | |
import Control.Monad.Loops | |
import Control.Exception |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
function check() { | |
var day = parseInt(document.getElementById("iDay").value); | |
var month = parseInt(document.getElementById("iMonth").value) - 1; | |
var year = parseInt(document.getElementById("iYear").value); | |
console.log([day,month,year]); |