This example contains the bare minimum includes and markup required to run a reveal.js presentation.
21 |
22 |
23 |
24 |
No Theme
25 |
There's no theme included, so it will fall back on browser defaults.
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/slides/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## Contributing
2 |
3 | Please keep the [issue tracker](http://github.com/hakimel/reveal.js/issues) limited to **bug reports**, **feature requests** and **pull requests**.
4 |
5 |
6 | ### Personal Support
7 | If you have personal support or setup questions the best place to ask those are [StackOverflow](http://stackoverflow.com/questions/tagged/reveal.js).
8 |
9 |
10 | ### Bug Reports
11 | When reporting a bug make sure to include information about which browser and operating system you are on as well as the necessary steps to reproduce the issue. If possible please include a link to a sample presentation where the bug can be tested.
12 |
13 |
14 | ### Pull Requests
15 | - Should follow the coding style of the file you work in, most importantly:
16 | - Tabs to indent
17 | - Single-quoted strings
18 | - Should be made towards the **dev branch**
19 | - Should be submitted from a feature/topic branch (not your master)
20 |
--------------------------------------------------------------------------------
/code/tests/csv/ok.csv:
--------------------------------------------------------------------------------
1 | "Account History for Account:","Bank Account - Everyday Basics - 12345678"
2 | "10 items"
3 | "14/02/2015","VISA PURCHASE MIEL CONTAINER PREMI BRISBANE CIT 13/02 AU AUD","-$40.00","$1,684.7"
4 | "14/02/2015","ATM OPERATOR FEE WITHDRAWAL Money Machine","-$2.50","$1,724.70"
5 | "14/02/2015","ATM WITHDRAWAL Money Machine","-$20.00","$1,727.20"
6 | "14/02/2015","VISA PURCHASE TeeTurtle 13/02 AU USD","-$20.00","$1,747.26"
7 | "13/02/2015","FOREIGN CURRENCY CONVERSION FEE","-$1.29","$1,767.26"
8 | "12/02/2015","EFTPOS WDL Tenkai Sushi Restaur AU","-$38.50","$1,768.55"
9 | "11/02/2015","EFTPOS WDL LB HAIR SALOON PTY L GREENSLOPES QLD","-$79.95","$1,807.05"
10 | "10/02/2015","DIRECT CREDIT Magic Pay Place Ref 654321","$1337.00","$1,887.00"
11 | "10/02/2015","INTERNET TRANSFER CREDIT FROM 12345679 REF NO 41514802","$50.00","$550.00"
12 | "09/02/2015","INTERNET TRANSFER DEBIT TO 12345679 REFERENCE NO 13924810","-$200.00","$500.00"
13 |
--------------------------------------------------------------------------------
/code-classy/tests/csv/ok.csv:
--------------------------------------------------------------------------------
1 | "Account History for Account:","Bank Account - Everyday Basics - 12345678"
2 | "10 items"
3 | "14/02/2015","VISA PURCHASE MIEL CONTAINER PREMI BRISBANE CIT 13/02 AU AUD","-$40.00","$1,684.7"
4 | "14/02/2015","ATM OPERATOR FEE WITHDRAWAL Money Machine","-$2.50","$1,724.70"
5 | "14/02/2015","ATM WITHDRAWAL Money Machine","-$20.00","$1,727.20"
6 | "14/02/2015","VISA PURCHASE TeeTurtle 13/02 AU USD","-$20.00","$1,747.26"
7 | "13/02/2015","FOREIGN CURRENCY CONVERSION FEE","-$1.29","$1,767.26"
8 | "12/02/2015","EFTPOS WDL Tenkai Sushi Restaur AU","-$38.50","$1,768.55"
9 | "11/02/2015","EFTPOS WDL LB HAIR SALOON PTY L GREENSLOPES QLD","-$79.95","$1,807.05"
10 | "10/02/2015","DIRECT CREDIT Magic Pay Place Ref 654321","$1337.00","$1,887.00"
11 | "10/02/2015","INTERNET TRANSFER CREDIT FROM 12345679 REF NO 41514802","$50.00","$550.00"
12 | "09/02/2015","INTERNET TRANSFER DEBIT TO 12345679 REFERENCE NO 13924810","-$200.00","$500.00"
13 |
--------------------------------------------------------------------------------
/code-classy/src/Utils.hs:
--------------------------------------------------------------------------------
1 | {-# LANGUAGE NoImplicitPrelude #-}
2 | module Utils where
3 |
4 | import BasePrelude
5 |
6 | import Control.Monad.Error.Hoist ((<%!?>))
7 | import Data.Validation (AccValidation(..))
8 | import Control.Monad.Trans (MonadIO,liftIO)
9 | import Control.Monad.Except (MonadError,throwError)
10 | import Control.Monad.Trans.Either (EitherT,eitherT)
11 |
12 | throwAccValidation :: (Applicative m, MonadError e m) => (es -> e) -> AccValidation es a -> m a
13 | throwAccValidation f (AccFailure es) = throwError (f es)
14 | throwAccValidation _ (AccSuccess a) = pure a
15 |
16 | wrapException
17 | :: (Exception e, MonadError e' m,MonadIO m, Applicative m)
18 | => (e -> e')
19 | -> IO a
20 | -> m a
21 | wrapException f a = do
22 | liftIO (catch (fmap Right a) (pure . Left . f)) <%!?> id
23 |
24 | wrapExceptions
25 | :: (MonadError e m,MonadIO m, Applicative m)
26 | => IO a
27 | -> [Handler e]
28 | -> m a
29 | wrapExceptions a hs =
30 | liftIO (catches (fmap Right a) handlers) <%!?> id
31 | where
32 | handlers = fmap (fmap Left) hs
33 |
--------------------------------------------------------------------------------
/code/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 Ben Kolera
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included
12 | in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/slides/css/theme/source/night.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Black theme for reveal.js.
3 | *
4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
5 | */
6 |
7 |
8 | // Default mixins and settings -----------------
9 | @import "../template/mixins";
10 | @import "../template/settings";
11 | // ---------------------------------------------
12 |
13 |
14 | // Include theme-specific fonts
15 | @import url(https://fonts.googleapis.com/css?family=Montserrat:700);
16 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic);
17 |
18 |
19 | // Override theme settings (see ../template/settings.scss)
20 | $backgroundColor: #111;
21 |
22 | $mainFont: 'Open Sans', sans-serif;
23 | $linkColor: #e7ad52;
24 | $linkColorHover: lighten( $linkColor, 20% );
25 | $headingFont: 'Montserrat', Impact, sans-serif;
26 | $headingTextShadow: none;
27 | $headingLetterSpacing: -0.03em;
28 | $headingTextTransform: none;
29 | $selectionBackgroundColor: #e7ad52;
30 | $mainFontSize: 30px;
31 |
32 |
33 | // Theme template ------------------------------
34 | @import "../template/theme";
35 | // ---------------------------------------------
--------------------------------------------------------------------------------
/code-classy/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 Ben Kolera
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included
12 | in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/slides/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2015 Hakim El Hattab, http://hakim.se
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
--------------------------------------------------------------------------------
/slides/test/examples/embedded-media.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Embedded Media
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
Embedded Media Test
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
Empty Slide
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Ben Kolera
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/slides/css/theme/source/serif.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * A simple theme for reveal.js presentations, similar
3 | * to the default theme. The accent color is brown.
4 | *
5 | * This theme is Copyright (C) 2012-2013 Owen Versteeg, http://owenversteeg.com - it is MIT licensed.
6 | */
7 |
8 |
9 | // Default mixins and settings -----------------
10 | @import "../template/mixins";
11 | @import "../template/settings";
12 | // ---------------------------------------------
13 |
14 |
15 |
16 | // Override theme settings (see ../template/settings.scss)
17 | $mainFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
18 | $mainColor: #000;
19 | $headingFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
20 | $headingColor: #383D3D;
21 | $headingTextShadow: none;
22 | $headingTextTransform: none;
23 | $backgroundColor: #F0F1EB;
24 | $linkColor: #51483D;
25 | $linkColorHover: lighten( $linkColor, 20% );
26 | $selectionBackgroundColor: #26351C;
27 |
28 | .reveal a {
29 | line-height: 1.3em;
30 | }
31 |
32 |
33 | // Theme template ------------------------------
34 | @import "../template/theme";
35 | // ---------------------------------------------
36 |
--------------------------------------------------------------------------------
/slides/css/theme/template/settings.scss:
--------------------------------------------------------------------------------
1 | // Base settings for all themes that can optionally be
2 | // overridden by the super-theme
3 |
4 | // Background of the presentation
5 | $backgroundColor: #2b2b2b;
6 |
7 | // Primary/body text
8 | $mainFont: 'Lato', sans-serif;
9 | $mainFontSize: 36px;
10 | $mainColor: #eee;
11 |
12 | // Vertical spacing between blocks of text
13 | $blockMargin: 20px;
14 |
15 | // Headings
16 | $headingMargin: 0 0 $blockMargin 0;
17 | $headingFont: 'League Gothic', Impact, sans-serif;
18 | $headingColor: #eee;
19 | $headingLineHeight: 1.2;
20 | $headingLetterSpacing: normal;
21 | $headingTextTransform: uppercase;
22 | $headingTextShadow: none;
23 | $headingFontWeight: normal;
24 | $heading1TextShadow: $headingTextShadow;
25 |
26 | $heading1Size: 3.77em;
27 | $heading2Size: 2.11em;
28 | $heading3Size: 1.55em;
29 | $heading4Size: 1.00em;
30 |
31 | // Links and actions
32 | $linkColor: #13DAEC;
33 | $linkColorHover: lighten( $linkColor, 20% );
34 |
35 | // Text selection
36 | $selectionBackgroundColor: #FF5E99;
37 | $selectionColor: #fff;
38 |
39 | // Generates the presentation background, can be overridden
40 | // to return a background image or gradient
41 | @mixin bodyBackground() {
42 | background: $backgroundColor;
43 | }
--------------------------------------------------------------------------------
/slides/css/theme/source/league.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * League theme for reveal.js.
3 | *
4 | * This was the default theme pre-3.0.0.
5 | *
6 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
7 | */
8 |
9 |
10 | // Default mixins and settings -----------------
11 | @import "../template/mixins";
12 | @import "../template/settings";
13 | // ---------------------------------------------
14 |
15 |
16 |
17 | // Include theme-specific fonts
18 | @import url(../../lib/font/league-gothic/league-gothic.css);
19 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
20 |
21 | // Override theme settings (see ../template/settings.scss)
22 | $headingTextShadow: 0px 0px 6px rgba(0,0,0,0.2);
23 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15);
24 |
25 | // Background generator
26 | @mixin bodyBackground() {
27 | @include radial-gradient( rgba(28,30,32,1), rgba(85,90,95,1) );
28 | }
29 |
30 |
31 |
32 | // Theme template ------------------------------
33 | @import "../template/theme";
34 | // ---------------------------------------------
--------------------------------------------------------------------------------
/code/src/Utils.hs:
--------------------------------------------------------------------------------
1 | {-# LANGUAGE NoImplicitPrelude #-}
2 | module Utils where
3 |
4 | import BasePrelude
5 |
6 | import Data.Validation (AccValidation(..))
7 | import Control.Monad.Trans (MonadIO,liftIO)
8 | import Control.Monad.Except (MonadError,throwError)
9 | import Control.Monad.Trans.Either (EitherT,eitherT)
10 |
11 | throwEither :: (Applicative m, MonadError e m) => Either e a -> m a
12 | throwEither = either throwError pure
13 |
14 | throwEitherT :: (Applicative m, MonadError e m) => EitherT e m a -> m a
15 | throwEitherT = eitherT throwError pure
16 |
17 | throwAccValidation :: (Applicative m, MonadError e m) => (es -> e) -> AccValidation es a -> m a
18 | throwAccValidation f (AccFailure es) = throwError (f es)
19 | throwAccValidation _ (AccSuccess a) = pure a
20 |
21 | wrapException
22 | :: (Exception e, MonadError e' m,MonadIO m, Applicative m)
23 | => (e -> e')
24 | -> IO a
25 | -> m a
26 | wrapException f a = do
27 | liftIO (catch (fmap Right a) (pure . Left . f)) >>= throwEither
28 |
29 | wrapExceptions
30 | :: (MonadError e m,MonadIO m, Applicative m)
31 | => IO a
32 | -> [Handler e]
33 | -> m a
34 | wrapExceptions a hs =
35 | liftIO (catches (fmap Right a) handlers) >>= throwEither
36 | where
37 | handlers = fmap (fmap Left) hs
38 |
--------------------------------------------------------------------------------
/slides/css/theme/source/simple.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * A simple theme for reveal.js presentations, similar
3 | * to the default theme. The accent color is darkblue.
4 | *
5 | * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed.
6 | * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
7 | */
8 |
9 |
10 | // Default mixins and settings -----------------
11 | @import "../template/mixins";
12 | @import "../template/settings";
13 | // ---------------------------------------------
14 |
15 |
16 |
17 | // Include theme-specific fonts
18 | @import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700);
19 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
20 |
21 |
22 | // Override theme settings (see ../template/settings.scss)
23 | $mainFont: 'Lato', sans-serif;
24 | $mainColor: #000;
25 | $headingFont: 'News Cycle', Impact, sans-serif;
26 | $headingColor: #000;
27 | $headingTextShadow: none;
28 | $headingTextTransform: none;
29 | $backgroundColor: #fff;
30 | $linkColor: #00008B;
31 | $linkColorHover: lighten( $linkColor, 20% );
32 | $selectionBackgroundColor: rgba(0, 0, 0, 0.99);
33 |
34 |
35 |
36 | // Theme template ------------------------------
37 | @import "../template/theme";
38 | // ---------------------------------------------
--------------------------------------------------------------------------------
/slides/css/theme/source/sky.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Sky theme for reveal.js.
3 | *
4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
5 | */
6 |
7 |
8 | // Default mixins and settings -----------------
9 | @import "../template/mixins";
10 | @import "../template/settings";
11 | // ---------------------------------------------
12 |
13 |
14 |
15 | // Include theme-specific fonts
16 | @import url(https://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic);
17 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700);
18 |
19 |
20 | // Override theme settings (see ../template/settings.scss)
21 | $mainFont: 'Open Sans', sans-serif;
22 | $mainColor: #333;
23 | $headingFont: 'Quicksand', sans-serif;
24 | $headingColor: #333;
25 | $headingLetterSpacing: -0.08em;
26 | $headingTextShadow: none;
27 | $backgroundColor: #f7fbfc;
28 | $linkColor: #3b759e;
29 | $linkColorHover: lighten( $linkColor, 20% );
30 | $selectionBackgroundColor: #134674;
31 |
32 | // Fix links so they are not cut off
33 | .reveal a {
34 | line-height: 1.3em;
35 | }
36 |
37 | // Background generator
38 | @mixin bodyBackground() {
39 | @include radial-gradient( #add9e4, #f7fbfc );
40 | }
41 |
42 |
43 |
44 | // Theme template ------------------------------
45 | @import "../template/theme";
46 | // ---------------------------------------------
47 |
--------------------------------------------------------------------------------
/slides/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "reveal.js",
3 | "version": "3.0.0",
4 | "description": "The HTML Presentation Framework",
5 | "homepage": "http://lab.hakim.se/reveal-js",
6 | "subdomain": "revealjs",
7 | "scripts": {
8 | "test": "grunt test",
9 | "start": ""
10 | },
11 | "author": {
12 | "name": "Hakim El Hattab",
13 | "email": "hakim.elhattab@gmail.com",
14 | "web": "http://hakim.se"
15 | },
16 | "repository": {
17 | "type": "git",
18 | "url": "git://github.com/hakimel/reveal.js.git"
19 | },
20 | "engines": {
21 | "node": "~0.10.0"
22 | },
23 | "dependencies": {
24 | "underscore": "~1.5.1",
25 | "express": "~2.5.9",
26 | "mustache": "~0.7.2",
27 | "socket.io": "~0.9.16"
28 | },
29 | "devDependencies": {
30 | "grunt-contrib-qunit": "~0.5.2",
31 | "grunt-contrib-jshint": "~0.6.4",
32 | "grunt-contrib-cssmin": "~0.4.1",
33 | "grunt-contrib-uglify": "~0.2.4",
34 | "grunt-contrib-watch": "~0.5.3",
35 | "grunt-sass": "~0.14.0",
36 | "grunt-contrib-connect": "~0.8.0",
37 | "grunt-autoprefixer": "~1.0.1",
38 | "grunt-zip": "~0.7.0",
39 | "grunt": "~0.4.0",
40 | "node-sass": "~0.9.3"
41 | },
42 | "licenses": [
43 | {
44 | "type": "MIT",
45 | "url": "https://github.com/hakimel/reveal.js/blob/master/LICENSE"
46 | }
47 | ]
48 | }
49 |
--------------------------------------------------------------------------------
/code-classy/src/App.hs:
--------------------------------------------------------------------------------
1 | {-# LANGUAGE FlexibleContexts #-}
2 | {-# LANGUAGE GeneralizedNewtypeDeriving #-}
3 | {-# LANGUAGE MultiParamTypeClasses #-}
4 | {-# LANGUAGE NoImplicitPrelude #-}
5 | {-# LANGUAGE TemplateHaskell #-}
6 | {-# LANGUAGE ConstraintKinds #-}
7 | module App where
8 |
9 | import BasePrelude hiding (first)
10 |
11 | import Control.Lens
12 | import Control.Monad.Except (ExceptT, MonadError (..), runExceptT)
13 | import Control.Monad.Reader (MonadReader, ReaderT, runReaderT)
14 | import Control.Monad.Trans (MonadIO, liftIO)
15 | import Data.Bifunctor (first)
16 |
17 | import Csv
18 | import Db
19 | import Utils
20 |
21 | data AppEnv = AppEnv { _appEnvDb :: DbEnv }
22 | makeClassy ''AppEnv
23 | data AppError = AppCsvError CsvError | AppDbError DbError
24 | makeClassyPrisms ''AppError
25 |
26 | instance AsDbError AppError where
27 | _DbError = _AppDbError . _DbError
28 |
29 | instance AsCsvError AppError where
30 | _CsvError = _AppCsvError . _CsvError
31 |
32 | instance HasDbEnv AppEnv where
33 | dbEnv = appEnvDb . dbEnv
34 |
35 | type CanApp c e m =
36 | ( CanDb c e m
37 | , CanCsv e m
38 | , AsAppError e
39 | , HasAppEnv c
40 | )
41 |
42 | loadAndInsert :: CanApp c e m => FilePath -> m [Int]
43 | loadAndInsert p = do
44 | xacts <- readTransactions p
45 | insertTransactions xacts
46 |
--------------------------------------------------------------------------------
/talk.org:
--------------------------------------------------------------------------------
1 | Stacking your Monads - Monad Transformers for FP Error Handling & Configuration
2 |
3 | * Me
4 | ** Dev Team Manager at iseek Communications
5 | ** We build enterprise-grade networks, data centers and cloud infrastructure
6 | ** Lots of little distributed APIs, some written on top of vendor APIs
7 | ** Types and FP help keep us sane
8 | * Our Journey Tonight
9 | ** Getting rid of exceptions with IO (Either e a)
10 | ** Enter ExceptT & what it means to be a monad transformer
11 | ** ReaderT to weave configuration into our contexts
12 | ** Stacking it all together and hiding the layers
13 | ** Neat effects of the MonadReader/MonadIO/MonadError typeclasses on your code
14 | * Conclusions & Take aways
15 | ** Why Monad Transformers are useful to stack different monads into one thing.
16 | ** How the mtl classes help you not to care about the exact stack.
17 | ** Get the inklings of how you'd use this in a bigger project.
18 | * Other Things of mention
19 | ** The Errors Package: Lots of goodies to help you avoid partial functions and emit good errors.
20 | ** AccValidation: Allows you to accumulate all errors rather than terminate at the first.
21 | ** You can do this in scala, too.
22 | * Useful Resources
23 | ** RWH Ch18: Monad Transformers: http://book.realworldhaskell.org/read/monad-transformers.html
24 | ** RWH Ch19: Error Handling: http://book.realworldhaskell.org/read/error-handling.html
25 |
--------------------------------------------------------------------------------
/slides/css/theme/source/beige.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Beige theme for reveal.js.
3 | *
4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
5 | */
6 |
7 |
8 | // Default mixins and settings -----------------
9 | @import "../template/mixins";
10 | @import "../template/settings";
11 | // ---------------------------------------------
12 |
13 |
14 |
15 | // Include theme-specific fonts
16 | @import url(../../lib/font/league-gothic/league-gothic.css);
17 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
18 |
19 |
20 | // Override theme settings (see ../template/settings.scss)
21 | $mainColor: #333;
22 | $headingColor: #333;
23 | $headingTextShadow: none;
24 | $backgroundColor: #f7f3de;
25 | $linkColor: #8b743d;
26 | $linkColorHover: lighten( $linkColor, 20% );
27 | $selectionBackgroundColor: rgba(79, 64, 28, 0.99);
28 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15);
29 |
30 | // Background generator
31 | @mixin bodyBackground() {
32 | @include radial-gradient( rgba(247,242,211,1), rgba(255,255,255,1) );
33 | }
34 |
35 |
36 |
37 | // Theme template ------------------------------
38 | @import "../template/theme";
39 | // ---------------------------------------------
--------------------------------------------------------------------------------
/slides/css/theme/source/black.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Black theme for reveal.js. This is the opposite of the 'white' theme.
3 | *
4 | * Copyright (C) 2015 Hakim El Hattab, http://hakim.se
5 | */
6 |
7 |
8 | // Default mixins and settings -----------------
9 | @import "../template/mixins";
10 | @import "../template/settings";
11 | // ---------------------------------------------
12 |
13 |
14 | // Include theme-specific fonts
15 | @import url(../../lib/font/source-sans-pro/source-sans-pro.css);
16 |
17 |
18 | // Override theme settings (see ../template/settings.scss)
19 | $backgroundColor: #222;
20 |
21 | $mainColor: #fff;
22 | $headingColor: #fff;
23 |
24 | $mainFontSize: 38px;
25 | $mainFont: 'Source Sans Pro', Helvetica, sans-serif;
26 | $headingFont: 'Source Sans Pro', Helvetica, sans-serif;
27 | $headingTextShadow: none;
28 | $headingLetterSpacing: normal;
29 | $headingTextTransform: uppercase;
30 | $headingFontWeight: 600;
31 | $linkColor: #42affa;
32 | $linkColorHover: lighten( $linkColor, 15% );
33 | $selectionBackgroundColor: lighten( $linkColor, 25% );
34 |
35 | $heading1Size: 2.5em;
36 | $heading2Size: 1.6em;
37 | $heading3Size: 1.3em;
38 | $heading4Size: 1.0em;
39 |
40 | section.has-light-background {
41 | &, h1, h2, h3, h4, h5, h6 {
42 | color: #222;
43 | }
44 | }
45 |
46 |
47 | // Theme template ------------------------------
48 | @import "../template/theme";
49 | // ---------------------------------------------
--------------------------------------------------------------------------------
/slides/css/theme/source/white.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * White theme for reveal.js. This is the opposite of the 'black' theme.
3 | *
4 | * Copyright (C) 2015 Hakim El Hattab, http://hakim.se
5 | */
6 |
7 |
8 | // Default mixins and settings -----------------
9 | @import "../template/mixins";
10 | @import "../template/settings";
11 | // ---------------------------------------------
12 |
13 |
14 | // Include theme-specific fonts
15 | @import url(../../lib/font/source-sans-pro/source-sans-pro.css);
16 |
17 |
18 | // Override theme settings (see ../template/settings.scss)
19 | $backgroundColor: #fff;
20 |
21 | $mainColor: #222;
22 | $headingColor: #222;
23 |
24 | $mainFontSize: 38px;
25 | $mainFont: 'Source Sans Pro', Helvetica, sans-serif;
26 | $headingFont: 'Source Sans Pro', Helvetica, sans-serif;
27 | $headingTextShadow: none;
28 | $headingLetterSpacing: normal;
29 | $headingTextTransform: uppercase;
30 | $headingFontWeight: 600;
31 | $linkColor: #2a76dd;
32 | $linkColorHover: lighten( $linkColor, 15% );
33 | $selectionBackgroundColor: lighten( $linkColor, 25% );
34 |
35 | $heading1Size: 2.5em;
36 | $heading2Size: 1.6em;
37 | $heading3Size: 1.3em;
38 | $heading4Size: 1.0em;
39 |
40 | section.has-dark-background {
41 | &, h1, h2, h3, h4, h5, h6 {
42 | color: #fff;
43 | }
44 | }
45 |
46 |
47 | // Theme template ------------------------------
48 | @import "../template/theme";
49 | // ---------------------------------------------
--------------------------------------------------------------------------------
/slides/test/test-markdown.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test Markdown
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/slides/plugin/print-pdf/print-pdf.js:
--------------------------------------------------------------------------------
1 | /**
2 | * phantomjs script for printing presentations to PDF.
3 | *
4 | * Example:
5 | * phantomjs print-pdf.js "http://lab.hakim.se/reveal-js?print-pdf" reveal-demo.pdf
6 | *
7 | * By Manuel Bieh (https://github.com/manuelbieh)
8 | */
9 |
10 | // html2pdf.js
11 | var page = new WebPage();
12 | var system = require( 'system' );
13 |
14 | var slideWidth = system.args[3] ? system.args[3].split( 'x' )[0] : 960;
15 | var slideHeight = system.args[3] ? system.args[3].split( 'x' )[1] : 700;
16 |
17 | page.viewportSize = {
18 | width: slideWidth,
19 | height: slideHeight
20 | };
21 |
22 | // TODO
23 | // Something is wrong with these config values. An input
24 | // paper width of 1920px actually results in a 756px wide
25 | // PDF.
26 | page.paperSize = {
27 | width: Math.round( slideWidth * 2 ),
28 | height: Math.round( slideHeight * 2 ),
29 | border: 0
30 | };
31 |
32 | var inputFile = system.args[1] || 'index.html?print-pdf';
33 | var outputFile = system.args[2] || 'slides.pdf';
34 |
35 | if( outputFile.match( /\.pdf$/gi ) === null ) {
36 | outputFile += '.pdf';
37 | }
38 |
39 | console.log( 'Printing PDF (Paper size: '+ page.paperSize.width + 'x' + page.paperSize.height +')' );
40 |
41 | page.open( inputFile, function( status ) {
42 | window.setTimeout( function() {
43 | console.log( 'Printed succesfully' );
44 | page.render( outputFile );
45 | phantom.exit();
46 | }, 1000 );
47 | } );
48 |
49 |
--------------------------------------------------------------------------------
/slides/css/theme/source/moon.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Solarized Dark theme for reveal.js.
3 | * Author: Achim Staebler
4 | */
5 |
6 |
7 | // Default mixins and settings -----------------
8 | @import "../template/mixins";
9 | @import "../template/settings";
10 | // ---------------------------------------------
11 |
12 |
13 |
14 | // Include theme-specific fonts
15 | @import url(../../lib/font/league-gothic/league-gothic.css);
16 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
17 |
18 | /**
19 | * Solarized colors by Ethan Schoonover
20 | */
21 | html * {
22 | color-profile: sRGB;
23 | rendering-intent: auto;
24 | }
25 |
26 | // Solarized colors
27 | $base03: #002b36;
28 | $base02: #073642;
29 | $base01: #586e75;
30 | $base00: #657b83;
31 | $base0: #839496;
32 | $base1: #93a1a1;
33 | $base2: #eee8d5;
34 | $base3: #fdf6e3;
35 | $yellow: #b58900;
36 | $orange: #cb4b16;
37 | $red: #dc322f;
38 | $magenta: #d33682;
39 | $violet: #6c71c4;
40 | $blue: #268bd2;
41 | $cyan: #2aa198;
42 | $green: #859900;
43 |
44 | // Override theme settings (see ../template/settings.scss)
45 | $mainColor: $base1;
46 | $headingColor: $base2;
47 | $headingTextShadow: none;
48 | $backgroundColor: $base03;
49 | $linkColor: $blue;
50 | $linkColorHover: lighten( $linkColor, 20% );
51 | $selectionBackgroundColor: $magenta;
52 |
53 |
54 |
55 | // Theme template ------------------------------
56 | @import "../template/theme";
57 | // ---------------------------------------------
58 |
--------------------------------------------------------------------------------
/code/README.md:
--------------------------------------------------------------------------------
1 | Setup
2 | =====
3 |
4 | Installation
5 | ------------
6 |
7 | First you'll want to create a sandbox to install all of the deps into:
8 |
9 | cabal sandbox init
10 | cabal install --only-dependencies
11 |
12 | To run the code and tests, you'll need a locally running postgres
13 | server that will accept a passwordless login from the current user.
14 |
15 | Tests
16 | -----
17 | The test cases create a database with a random name for each test,
18 | so the current user will need to have permission to create a database
19 | (having superuser priviledges is the easiest way to achieve this).
20 |
21 | If you need another way to login to the DB (say with a password) you'll
22 | have to change the connectPostgreSQL string in the test case, sadly.
23 |
24 | Run the tests by running:
25 | cabal test
26 |
27 | Code
28 | ----
29 | To run the code, you'll need to create a database with the desired
30 | schema in it.
31 |
32 | createdb transaction_importer
33 | psql transaction_importer < schema.sql
34 |
35 | Then fill in app.cfg with a user,database (and an optional port,password and host)
36 |
37 | cabal run -- tests/csv/ok.csv
38 |
39 | What does it do?
40 | ----------------
41 | The idea is that it was supposed to parse a CSV that I get from my internet
42 | banking and insert the transactions into a database for reporting.
43 |
44 | This involves reading the files off disk and parsing them in our Csv monad.
45 |
46 | Then the get inserted into our normalised table stucture in the Db monad.
47 |
48 | For an example of the csv, look in tests/csv/ok.csv
49 |
--------------------------------------------------------------------------------
/slides/lib/js/classList.js:
--------------------------------------------------------------------------------
1 | /*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/
2 | if(typeof document!=="undefined"&&!("classList" in document.createElement("a"))){(function(j){var a="classList",f="prototype",m=(j.HTMLElement||j.Element)[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p App a -> IO (Either AppError a)
37 | runApp e = runExceptT . flip runReaderT e . unApp
38 |
39 | loadAndInsert :: FilePath -> App [Int]
40 | loadAndInsert p = do
41 | xacts <- liftCsv $ readTransactions p
42 | liftDb $ insertTransactions xacts
43 |
44 | liftCsv :: (Applicative m,MonadError AppError m,MonadIO m) => Csv a -> m a
45 | liftCsv c = do
46 | res <- liftIO $ runCsv c
47 | throwEither . first AppCsvError $ res
48 |
49 | liftDb :: (Applicative m,MonadReader AppEnv m, MonadError AppError m,MonadIO m) => Db a -> m a
50 | liftDb c = do
51 | e <- view appEnvDb
52 | res <- liftIO $ runDb e c
53 | throwEither . first AppDbError $ res
54 |
--------------------------------------------------------------------------------
/slides/css/theme/template/mixins.scss:
--------------------------------------------------------------------------------
1 | @mixin vertical-gradient( $top, $bottom ) {
2 | background: $top;
3 | background: -moz-linear-gradient( top, $top 0%, $bottom 100% );
4 | background: -webkit-gradient( linear, left top, left bottom, color-stop(0%,$top), color-stop(100%,$bottom) );
5 | background: -webkit-linear-gradient( top, $top 0%, $bottom 100% );
6 | background: -o-linear-gradient( top, $top 0%, $bottom 100% );
7 | background: -ms-linear-gradient( top, $top 0%, $bottom 100% );
8 | background: linear-gradient( top, $top 0%, $bottom 100% );
9 | }
10 |
11 | @mixin horizontal-gradient( $top, $bottom ) {
12 | background: $top;
13 | background: -moz-linear-gradient( left, $top 0%, $bottom 100% );
14 | background: -webkit-gradient( linear, left top, right top, color-stop(0%,$top), color-stop(100%,$bottom) );
15 | background: -webkit-linear-gradient( left, $top 0%, $bottom 100% );
16 | background: -o-linear-gradient( left, $top 0%, $bottom 100% );
17 | background: -ms-linear-gradient( left, $top 0%, $bottom 100% );
18 | background: linear-gradient( left, $top 0%, $bottom 100% );
19 | }
20 |
21 | @mixin radial-gradient( $outer, $inner, $type: circle ) {
22 | background: $outer;
23 | background: -moz-radial-gradient( center, $type cover, $inner 0%, $outer 100% );
24 | background: -webkit-gradient( radial, center center, 0px, center center, 100%, color-stop(0%,$inner), color-stop(100%,$outer) );
25 | background: -webkit-radial-gradient( center, $type cover, $inner 0%, $outer 100% );
26 | background: -o-radial-gradient( center, $type cover, $inner 0%, $outer 100% );
27 | background: -ms-radial-gradient( center, $type cover, $inner 0%, $outer 100% );
28 | background: radial-gradient( center, $type cover, $inner 0%, $outer 100% );
29 | }
--------------------------------------------------------------------------------
/slides/plugin/multiplex/index.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var fs = require('fs');
3 | var io = require('socket.io');
4 | var crypto = require('crypto');
5 |
6 | var app = express.createServer();
7 | var staticDir = express.static;
8 |
9 | io = io.listen(app);
10 |
11 | var opts = {
12 | port: 1948,
13 | baseDir : __dirname + '/../../'
14 | };
15 |
16 | io.sockets.on('connection', function(socket) {
17 | socket.on('slidechanged', function(slideData) {
18 | if (typeof slideData.secret == 'undefined' || slideData.secret == null || slideData.secret === '') return;
19 | if (createHash(slideData.secret) === slideData.socketId) {
20 | slideData.secret = null;
21 | socket.broadcast.emit(slideData.socketId, slideData);
22 | };
23 | });
24 | });
25 |
26 | app.configure(function() {
27 | [ 'css', 'js', 'plugin', 'lib' ].forEach(function(dir) {
28 | app.use('/' + dir, staticDir(opts.baseDir + dir));
29 | });
30 | });
31 |
32 | app.get("/", function(req, res) {
33 | res.writeHead(200, {'Content-Type': 'text/html'});
34 | fs.createReadStream(opts.baseDir + '/index.html').pipe(res);
35 | });
36 |
37 | app.get("/token", function(req,res) {
38 | var ts = new Date().getTime();
39 | var rand = Math.floor(Math.random()*9999999);
40 | var secret = ts.toString() + rand.toString();
41 | res.send({secret: secret, socketId: createHash(secret)});
42 | });
43 |
44 | var createHash = function(secret) {
45 | var cipher = crypto.createCipher('blowfish', secret);
46 | return(cipher.final('hex'));
47 | };
48 |
49 | // Actually listen
50 | app.listen(opts.port || null);
51 |
52 | var brown = '\033[33m',
53 | green = '\033[32m',
54 | reset = '\033[0m';
55 |
56 | console.log( brown + "reveal.js:" + reset + " Multiplex running on port " + green + opts.port + reset );
--------------------------------------------------------------------------------
/slides/css/theme/README.md:
--------------------------------------------------------------------------------
1 | ## Dependencies
2 |
3 | Themes are written using Sass to keep things modular and reduce the need for repeated selectors across files. Make sure that you have the reveal.js development environment including the Grunt dependencies installed before proceding: https://github.com/hakimel/reveal.js#full-setup
4 |
5 | You also need to install Ruby and then Sass (with `gem install sass`).
6 |
7 | ## Creating a Theme
8 |
9 | To create your own theme, start by duplicating any ```.scss``` file in [/css/theme/source](https://github.com/hakimel/reveal.js/blob/master/css/theme/source) and adding it to the compilation list in the [Gruntfile](https://github.com/hakimel/reveal.js/blob/master/Gruntfile.js).
10 |
11 | Each theme file does four things in the following order:
12 |
13 | 1. **Include [/css/theme/template/mixins.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/mixins.scss)**
14 | Shared utility functions.
15 |
16 | 2. **Include [/css/theme/template/settings.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/settings.scss)**
17 | Declares a set of custom variables that the template file (step 4) expects. Can be overridden in step 3.
18 |
19 | 3. **Override**
20 | This is where you override the default theme. Either by specifying variables (see [settings.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/settings.scss) for reference) or by adding full selectors with hardcoded styles.
21 |
22 | 4. **Include [/css/theme/template/theme.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/theme.scss)**
23 | The template theme file which will generate final CSS output based on the currently defined variables.
24 |
25 | When you are done, run `grunt themes` to compile the Sass file to CSS and you are ready to use your new theme.
26 |
--------------------------------------------------------------------------------
/slides/plugin/math/math.js:
--------------------------------------------------------------------------------
1 | /**
2 | * A plugin which enables rendering of math equations inside
3 | * of reveal.js slides. Essentially a thin wrapper for MathJax.
4 | *
5 | * @author Hakim El Hattab
6 | */
7 | var RevealMath = window.RevealMath || (function(){
8 |
9 | var options = Reveal.getConfig().math || {};
10 | options.mathjax = options.mathjax || 'http://cdn.mathjax.org/mathjax/latest/MathJax.js';
11 | options.config = options.config || 'TeX-AMS_HTML-full';
12 |
13 | loadScript( options.mathjax + '?config=' + options.config, function() {
14 |
15 | MathJax.Hub.Config({
16 | messageStyle: 'none',
17 | tex2jax: { inlineMath: [['$','$'],['\\(','\\)']] },
18 | skipStartupTypeset: true
19 | });
20 |
21 | // Typeset followed by an immediate reveal.js layout since
22 | // the typesetting process could affect slide height
23 | MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub ] );
24 | MathJax.Hub.Queue( Reveal.layout );
25 |
26 | // Reprocess equations in slides when they turn visible
27 | Reveal.addEventListener( 'slidechanged', function( event ) {
28 |
29 | MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub, event.currentSlide ] );
30 |
31 | } );
32 |
33 | } );
34 |
35 | function loadScript( url, callback ) {
36 |
37 | var head = document.querySelector( 'head' );
38 | var script = document.createElement( 'script' );
39 | script.type = 'text/javascript';
40 | script.src = url;
41 |
42 | // Wrapper for callback to make sure it only fires once
43 | var finish = function() {
44 | if( typeof callback === 'function' ) {
45 | callback.call();
46 | callback = null;
47 | }
48 | }
49 |
50 | script.onload = finish;
51 |
52 | // IE
53 | script.onreadystatechange = function() {
54 | if ( this.readyState === 'loaded' ) {
55 | finish();
56 | }
57 | }
58 |
59 | // Normal browsers
60 | head.appendChild( script );
61 |
62 | }
63 |
64 | })();
65 |
--------------------------------------------------------------------------------
/slides/plugin/notes-server/client.js:
--------------------------------------------------------------------------------
1 | (function() {
2 |
3 | // don't emit events from inside the previews themselves
4 | if( window.location.search.match( /receiver/gi ) ) { return; }
5 |
6 | var socket = io.connect( window.location.origin ),
7 | socketId = Math.random().toString().slice( 2 );
8 |
9 | console.log( 'View slide notes at ' + window.location.origin + '/notes/' + socketId );
10 |
11 | window.open( window.location.origin + '/notes/' + socketId, 'notes-' + socketId );
12 |
13 | /**
14 | * Posts the current slide data to the notes window
15 | */
16 | function post() {
17 |
18 | var slideElement = Reveal.getCurrentSlide(),
19 | notesElement = slideElement.querySelector( 'aside.notes' );
20 |
21 | var messageData = {
22 | notes: '',
23 | markdown: false,
24 | socketId: socketId,
25 | state: Reveal.getState()
26 | };
27 |
28 | // Look for notes defined in a slide attribute
29 | if( slideElement.hasAttribute( 'data-notes' ) ) {
30 | messageData.notes = slideElement.getAttribute( 'data-notes' );
31 | }
32 |
33 | // Look for notes defined in an aside element
34 | if( notesElement ) {
35 | messageData.notes = notesElement.innerHTML;
36 | messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string';
37 | }
38 |
39 | socket.emit( 'statechanged', messageData );
40 |
41 | }
42 |
43 | // When a new notes window connects, post our current state
44 | socket.on( 'connect', function( data ) {
45 | post();
46 | } );
47 |
48 | // Monitor events that trigger a change in state
49 | Reveal.addEventListener( 'slidechanged', post );
50 | Reveal.addEventListener( 'fragmentshown', post );
51 | Reveal.addEventListener( 'fragmenthidden', post );
52 | Reveal.addEventListener( 'overviewhidden', post );
53 | Reveal.addEventListener( 'overviewshown', post );
54 | Reveal.addEventListener( 'paused', post );
55 | Reveal.addEventListener( 'resumed', post );
56 |
57 | // Post the initial state
58 | post();
59 |
60 | }());
61 |
--------------------------------------------------------------------------------
/slides/plugin/notes-server/index.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var fs = require('fs');
3 | var io = require('socket.io');
4 | var _ = require('underscore');
5 | var Mustache = require('mustache');
6 |
7 | var app = express.createServer();
8 | var staticDir = express.static;
9 |
10 | io = io.listen(app);
11 |
12 | var opts = {
13 | port : 1947,
14 | baseDir : __dirname + '/../../'
15 | };
16 |
17 | io.sockets.on( 'connection', function( socket ) {
18 |
19 | socket.on( 'connect', function( data ) {
20 | socket.broadcast.emit( 'connect', data );
21 | });
22 |
23 | socket.on( 'statechanged', function( data ) {
24 | socket.broadcast.emit( 'statechanged', data );
25 | });
26 |
27 | });
28 |
29 | app.configure( function() {
30 |
31 | [ 'css', 'js', 'images', 'plugin', 'lib' ].forEach( function( dir ) {
32 | app.use( '/' + dir, staticDir( opts.baseDir + dir ) );
33 | });
34 |
35 | });
36 |
37 | app.get('/', function( req, res ) {
38 |
39 | res.writeHead( 200, { 'Content-Type': 'text/html' } );
40 | fs.createReadStream( opts.baseDir + '/index.html' ).pipe( res );
41 |
42 | });
43 |
44 | app.get( '/notes/:socketId', function( req, res ) {
45 |
46 | fs.readFile( opts.baseDir + 'plugin/notes-server/notes.html', function( err, data ) {
47 | res.send( Mustache.to_html( data.toString(), {
48 | socketId : req.params.socketId
49 | }));
50 | });
51 |
52 | });
53 |
54 | // Actually listen
55 | app.listen( opts.port || null );
56 |
57 | var brown = '\033[33m',
58 | green = '\033[32m',
59 | reset = '\033[0m';
60 |
61 | var slidesLocation = 'http://localhost' + ( opts.port ? ( ':' + opts.port ) : '' );
62 |
63 | console.log( brown + 'reveal.js - Speaker Notes' + reset );
64 | console.log( '1. Open the slides at ' + green + slidesLocation + reset );
65 | console.log( '2. Click on the link your JS console to go to the notes page' );
66 | console.log( '3. Advance through your slides and your notes will advance automatically' );
67 |
--------------------------------------------------------------------------------
/slides/test/test-pdf.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Test PDF exports
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
1
25 |
26 |
27 |
28 |
29 |
30 |
2.1
31 |
32 |
33 |
2.2
34 |
35 |
36 |
2.3
37 |
38 |
39 |
40 |
41 |
42 |
3.1
43 |
44 |
4.1
45 |
4.2
46 |
4.3
47 |
48 |
49 |
50 |
51 |
3.2
52 |
53 |
4.1
54 |
4.2
55 |
56 |
57 |
58 |
59 |
3.3
60 |
61 |
3.3.1
62 |
3.3.2
63 |
3.3.3
64 |
65 |
66 |
67 |
68 |
69 |
4
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/code/tests/DbTests/Internal.hs:
--------------------------------------------------------------------------------
1 | {-# LANGUAGE NoImplicitPrelude #-}
2 | {-# LANGUAGE OverloadedStrings #-}
3 | module DbTests.Internal where
4 |
5 | import BasePrelude
6 |
7 | import Control.Monad.Random
8 | import qualified Data.ByteString as B
9 | import qualified Data.ByteString.Char8 as B8
10 | import Database.PostgreSQL.Simple
11 | import Database.PostgreSQL.Simple.Types
12 | import Test.Tasty.HUnit
13 |
14 | import Db
15 |
16 | rnd :: (RandomGen g) => Rand g Char
17 | rnd = getRandomR ('a','z')
18 |
19 | dbName :: IO String
20 | dbName = ("transactions_test_" <>) <$> evalRandIO (sequence (replicate 10 rnd))
21 |
22 | assertDbResult :: Either DbError a -> (a -> Assertion) -> Assertion
23 | assertDbResult e f = either (error . ("DB Failed: " <>) . show) f e
24 |
25 | roundTripTest
26 | :: (Eq a, Show a)
27 | => String
28 | -> (n -> Db i)
29 | -> (i -> Db (Maybe a))
30 | -> (n -> i -> a)
31 | -> n
32 | -> Assertion
33 | roundTripTest testName insertN queryA newToExisting new =
34 | withDb testName $ \ e -> do
35 | res <- runDb e $ do
36 | i <- insertN new
37 | a <- queryA i
38 | pure (i,a)
39 | assertDbResult res $ \ (i,a) -> Just (newToExisting new i) @=? a
40 |
41 | withDb :: String -> (DbEnv -> Assertion) -> Assertion
42 | withDb testName f = do
43 | pc <- connectPostgreSQL "dbname=postgres"
44 | n <- dbName
45 | let nb = B8.pack n
46 | bracket
47 | (setup pc nb)
48 | (cleanup pc nb)
49 | f
50 |
51 | where
52 | setup pc nb = do
53 | void . execute_ pc . Query $ "CREATE DATABASE " <> nb
54 | tc <- connectPostgreSQL ("dbname=" <> nb)
55 | schemaSql <- B.readFile "schema.sql"
56 | void . execute_ tc . Query $ schemaSql
57 | dataSql <- B.readFile $ "tests/sql/" <> testName <> ".sql"
58 | void . execute_ tc . Query $ dataSql
59 | pure (DbEnv tc)
60 |
61 | cleanup pc nb tc = do
62 | closeDbEnv tc
63 | void . execute_ pc . Query $ "DROP DATABASE " <> nb
64 |
--------------------------------------------------------------------------------
/slides/test/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Tests
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |