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
package myproject.comet | |
import net.liftweb._ | |
import actor.LiftActor | |
import common.{Full, Empty, Box} | |
import http._ | |
import js.JE._ | |
import js.JE.JsArray._ | |
import js.JE.JsRaw._ | |
import js.JsCmds._ |
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 Main where | |
import Control.Monad.Trans | |
import Network.Wai.Handler.Warp (run) | |
import Network.Wai | |
import Network.HTTP.Types (statusOK) | |
import Data.Enumerator ((>>==), ($$)) | |
import qualified Data.Enumerator as E |
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
-- | Settings are centralized, as much as possible, into this file. This | |
-- includes database connection settings, static file locations, etc. | |
-- In addition, you can configure a number of different aspects of Yesod | |
-- by overriding methods in the Yesod typeclass. That instance is | |
-- declared in the Foundation.hs file. | |
module Settings | |
( widgetFile | |
, PersistConfig | |
, staticRoot | |
, staticDir |
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
fs = require 'fs' | |
coffee = require 'coffee-script' | |
option '-f', '--folder [DIR]', 'template directory' | |
task 'build:all', 'compile all coffee files', (options) -> | |
dir = options.output or './templates' | |
console.log "Reading #{dir}" | |
fs.readdir dir, (err, files) -> | |
if err? then console.error err else |
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
#!/bin/bash | |
# | |
# -------------------------------------------------------------------------------------- | |
# http://blog.gantrithor.com/post/12535461464/carefree-coffeescript-auto-compiler-part-3 | |
# -------------------------------------------------------------------------------------- | |
DIR_ROOT="$(cd "$(dirname "$0")" && pwd)" | |
function compile_tree() { | |
find "$1" -name "*.coffee" -type f | while read PATH_COFFEE; do |
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 Main where | |
import Data.List | |
main = interact epicWin | |
epicWin :: String -> String | |
epicWin s = let x :: Integer | |
x = read (head (lines s)) | |
in (show $ div (getTotal (tail (lines s))) x) ++ "\n" |
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
til = require('util') | |
OAuth2Strategy = require('passport-oauth').OAuth2Strategy | |
class Strategy extends OAuth2Strategy | |
constructor: (options = {}, verify) -> | |
options.authorizationURL or= 'https://www.deviantart.com/oauth2/draft15/authorize' | |
options.tokenURL or= 'https://www.deviantart.com/oauth2/draft15/token' | |
OAuth2Strategy.call this, options, verify | |
@name = 'deviantart' |
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
getSid = do | |
msid <- optional $ lookCookieValue "ponysession" | |
case msid of | |
Nothing -> do | |
sid <- genSessionId | |
addCookie Session $ mkCookie "ponysession" $ B.unpack sid | |
return sid | |
Just sid -> return $ B.pack sid | |
{- |
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 BangPatterns #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE RecordWildCards #-} | |
module Snap.Snaplet.Auth.Backends.MongoDB | |
( initMongoAuth | |
) where | |
------------------------------------------------------------------------------ | |
import Control.Arrow |
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 Jade where | |
import Text.Parsec | |
import qualified Text.Parsec.Token as L | |
import Text.Parsec.Language (emptyDef) | |
import Text.Parsec.Text (Parser) | |
import Data.Text (Text) | |
import Control.Monad (mzero) | |
import Control.Applicative ((<$>)) | |
import Data.Maybe (isJust, fromMaybe) |