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
milad.bourhani:~/projects/free$ cat Free.hs | |
module Free where | |
data Free f r = Free (f (Free f r)) | Pure r | |
instance (Functor f) => Functor (Free f) where | |
fmap f (Pure a) = Pure (f a) | |
fmap f (Free x) = Free $ fmap (fmap f) x | |
instance (Functor f) => Applicative (Free f) 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
docker run -dit --name foo -e FOO=$(pwd)/foo.txt -v $(pwd)/foo.txt:/tmp/foo.txt httpd:2.4 |
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
$ echo "foobar" | openssl enc -aes-256-cbc -e -a -salt -k foobar | |
U2FsdGVkX1+CaU92AZ1/LHNEe3rdU0EV3/AImqzYmWg= | |
$ echo U2FsdGVkX1+CaU92AZ1/LHNEe3rdU0EV3/AImqzYmWg= | openssl enc -aes-256-cbc -d -a -k foobar | |
foobar |
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
import qualified Prelude | |
import Prelude hiding(readFile) | |
import Control.Monad.State | |
class Monad m => FSMonad m where | |
readF :: FilePath -> m String | |
numCharactersInFile :: FSMonad m => FilePath -> m Int | |
numCharactersInFile fileName = do | |
contents <- readF fileName |
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 Free where | |
data Free f r = Free (f (Free f r)) | Pure r | |
instance (Functor f) => Functor (Free f) where | |
fmap = undefined | |
instance (Functor f) => Applicative (Free f) where | |
pure = Pure | |
(<*>) = undefined |
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
db.createUser({"user" : "my_user","pwd" : "my_user", "roles" : [{"role" : "dbOwner", "db" : "my_db"}]}) |
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 BinTrees where | |
data BinTree a = | |
Node a (BinTree a) (BinTree a) | |
| Nil | |
deriving (Show, Eq) | |
leaf :: a -> BinTree a | |
leaf a = Node a Nil Nil |
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 org.miladhub.rsa; | |
import org.apache.commons.codec.binary.Base64; | |
import javax.crypto.Cipher; | |
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.io.UnsupportedEncodingException; | |
import java.security.*; |