This file contains 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
"use strict"; | |
define({ | |
session: function() { | |
return { | |
status: '', | |
user: '', | |
baseUrl: '', | |
login: function(baseUrl, username, password, doneCallback, failCallback) { | |
var ses = this; | |
ses.baseUrl = baseUrl; |
This file contains 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
safeRead :: forall a. Read a => Text -> Maybe a | |
safeRead s = case (reads $ T.unpack s) of | |
[(v,_)] -> Just v | |
_ -> Nothing | |
instance PathPiece Int32 where | |
fromPathPiece s = | |
case Data.Text.Read.decimal s of | |
Right (i, _) -> Just i | |
Left _ -> Nothing |
This file contains 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 RankNTypes #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE TupleSections #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
module Api.Database where |
This file contains 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 PackageImports #-} | |
module AES (encryptFile, decrypt) where | |
import Data.ByteString (ByteString) | |
import qualified Data.ByteString as B | |
import Data.Maybe | |
import qualified "cryptonite" Crypto.Cipher.AES as C | |
import qualified "cryptonite" Crypto.Cipher.Types as C | |
import qualified "cryptonite" Crypto.Error as C | |
import qualified Crypto.Nonce as N |
This file contains 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
import xs from 'xstream'; | |
import isolate from '@cycle/isolate'; | |
import {div, button, input} from '@cycle/dom'; | |
function intent(domSource, httpSource) { | |
const errorObj = { httpError: true } | |
const username$ = domSource.select('.username').events('input') | |
.map(ev => ev.target.value).startWith('') | |
const password$ = domSource.select('.password').events('input') | |
.map(ev => ev.target.value).startWith('') |
This file contains 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 RankNTypes #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE TupleSections #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
module Api.Database where |
This file contains 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 TypeFamilies #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
module Api.User where | |
import Servant | |
import Models | |
import Enums | |
import Config |
This file contains 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 #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE RecordWildCards #-} | |
module OnlySecure where |
This file contains 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
#include "opencv2/objdetect.hpp" | |
#include "opencv2/imgcodecs.hpp" | |
#include "opencv2/videoio.hpp" | |
#include "opencv2/highgui.hpp" | |
#include "opencv2/face.hpp" | |
#include "opencv2/imgproc.hpp" | |
#include "opencv2/core/utility.hpp" | |
#include "opencv2/core/core_c.h" | |
#include "opencv2/videoio/videoio_c.h" | |
#include "opencv2/highgui/highgui_c.h" |
This file contains 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
CREATE FUNCTION has_role (userId BIGINT, userGroupId BIGINT, role TEXT) | |
RETURNS BOOLEAN | |
AS | |
$$ | |
SELECT EXISTS ( | |
SELECT 1 | |
FROM role | |
WHERE user_id = $1 | |
AND user_group_id = $2 | |
AND role = $3 |
OlderNewer