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 Helper.Aws | |
(listAllEmails | |
) where | |
import Control.Lens ((&), (.~)) | |
import Control.Monad.Trans.AWS (Error, runAWST, trying, _Error) | |
import Data.ByteString (ByteString) | |
import Network.AWS (Region (NorthVirginia), newEnv, runResourceT, send, within) | |
import Network.AWS.Auth (AccessKey (..), Credentials (FromKeys), SecretKey (..)) | |
import Network.AWS.SES (IdentityType (..)) |
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
body <- getRequest | |
lift $ runConduitRes $ (consumeBody body) =$ sinkFile directory | |
where | |
consumeBody :: MonadIO m => YesodRequest -> ConduitM i ByteString m () | |
consumeBody body = do | |
chunk <- liftIO $ NW.requestBody $ reqWaiRequest body | |
if (chunk == BS.empty) | |
then return () | |
else do | |
yield chunk |
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 QuasiQuotes, TypeFamilies, GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE FlexibleContexts, FlexibleInstances, TemplateHaskell, OverloadedStrings #-} | |
{-# LANGUAGE GADTs, MultiParamTypeClasses, TypeSynonymInstances #-} | |
import Data.Text (Text) | |
import Data.ByteString (ByteString) | |
import Database.Persist.Sqlite | |
import Control.Monad.Logger (runStderrLoggingT) | |
import Yesod | |
import Yesod.Auth |
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
upstream yesod { | |
server 127.0.0.1:3000; | |
keepalive 8; | |
} | |
# the nginx server instance | |
server { | |
listen 0.0.0.0:80; | |
server_name haskell-serbia.com; | |
access_log /var/log/nginx/access_yesod.log; |
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
find . -iname '*.scss' -exec git log --since=2.weeks --name-status {} + |
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
:put =range(11,15) |
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
:for i in range(1,10) | put ='array['.i.']' | endfor |
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
1,$s/\n/,/g #replace comma with new line | |
%norm A* #append * to every line | |
bufdo! %s/FIND/REPLACE/g # search all buffers |
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
<select name="new-event-start"> | |
<option value="05:00">5:00</option> | |
<option value="05:15">5:15</option> | |
<option value="05:30">5:30</option> | |
<option value="05:45">5:45</option> | |
<option value="06:00">6:00</option> | |
<option value="06:15">6:15</option> | |
<option value="06:30">6:30</option> | |
<option value="06:45">6:45</option> |
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
var traverseFolder = function(path) | |
{ | |
// Create new folder object based on path string | |
var folder = new Folder(path); | |
// Get all files in the current folder | |
var files = folder.getFiles(); | |
// Loop over the files in the files object | |
for (var i = 0; i < files.length; i++) |