- Http://www.statetrace.com
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 NoImplicitPrelude #-} | |
module Console where | |
import Language.Fay.FFI | |
import Language.Fay.Prelude | |
data MyData = MyData { xVar :: Int, yVar :: Int } | |
myData :: MyData |
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 NoImplicitPrelude #-} | |
module Console where | |
import Language.Fay.FFI | |
import Language.Fay.Prelude | |
data MyData = MyData { xVar :: Int, yVar :: Int } | |
instance Foreign MyData |
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 DeriveDataTypeable #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE RecordWildCards #-} | |
module Main where | |
------------------------------------------------------------------------------ |
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 TemplateHaskell #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Control.Exception (SomeException, try) | |
import Control.Arrow (second) | |
import qualified Data.Text as T | |
import System.IO |
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 SnapApp.Processing (sanatizeSourceString) where | |
import GHC | |
import Outputable | |
import HsDecls | |
import Data.List | |
import Data.Maybe | |
import Control.Monad (unless) | |
import Text.Regex.Posix |
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
from flask import Flask | |
from flask.ext.security import RoleMixin, UserMixin, MongoEngineUserDatastore, Security | |
from flask.ext.mongoengine import MongoEngine | |
from werkzeug.local import LocalProxy | |
app = Flask(__name__) | |
app.config['MONGODB_SETTINGS'] = dict( | |
db='flask_security_test', | |
host='localhost', |
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
-- | Returns the subset of an index whose key when run against the provided | |
-- function returns True. | |
filterByKey :: (Indexable a, Typeable a, Ord a, Typeable k) | |
=> (k -> Bool) -> IxSet a -> IxSet a | |
filterByKey func ixset@(IxSet indexes) = collect indexes | |
where | |
collect [] = [] -- FIXME: should be an error | |
collect (Ix index _:is) = maybe (collect is) f $ cast index | |
where | |
f index'' = insertList (concatMap Set.elems [ val | (key, val) <- (Map.toList index''), (func key)]) empty |
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, DeriveGeneric, TypeOperators #-} | |
import qualified Data.Text as T | |
import Database.MongoDB | |
import Control.Monad.Trans (liftIO, MonadIO) | |
import Control.Monad | |
import Control.Monad (forM_) | |
import qualified Data.Bson as B | |
import Data.Bson.Generic |
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
==> riak_api (get-deps) | |
Pulling riak_pb from {git,"git://github.com/basho/riak_pb.git", | |
{tag,"2.0.0.16"}} | |
Cloning into 'riak_pb'... | |
ERROR: Dependency dir /riak-build/deps/riak_pb failed application validation with reason: | |
{version_mismatch,{"/riak-build/deps/riak_pb/src/riak_pb.app.src", | |
{expected,"2.0.0.16"}, | |
{has,"2.0.0.15-15-gd10c567"}}} |
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
$ curl http://localhost:8098/buckets/test/props | |
{"props":{"allow_mult":false,"basic_quorum":false,"big_vclock":50,"chash_keyfun":{"mod":"riak_core_util","fun":"chash_std_keyfun"},"dvv_enabled":false,"dw":"quorum","last_write_wins":false,"linkfun":{"mod":"riak_kv_wm_link_walker","fun":"mapreduce_linkfun"},"n_val":3,"name":"test","notfound_ok":true,"old_vclock":86400,"postcommit":[{"mod":"riak_DNE","fun":"postcommit_send_DNE"}],"pr":0,"precommit":[],"pw":0,"r":"quorum","rw":"quorum","small_vclock":50,"w":"quorum","young_vclock":20}} |
OlderNewer