Skip to content

Commit

Permalink
Initial commit of bay area meetup presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ldionne committed Apr 23, 2017
0 parents commit 46a55d2
Show file tree
Hide file tree
Showing 113 changed files with 18,798 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DS_Store
.svn
log/*.log
tmp/**
node_modules/
.sass-cache
css/reveal.min.css
js/reveal.min.js
/build/
134 changes: 134 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Copyright Louis Dionne 2016
# Distributed under the Boost Software License, Version 1.0.

cmake_minimum_required(VERSION 3.0)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})

#=============================================================================
# Setup required packages
#=============================================================================
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})

include(ExternalProject)
ExternalProject_Add(install-Hana EXCLUDE_FROM_ALL 1
URL https://github.com/boostorg/hana/archive/develop.zip
TIMEOUT 120
PREFIX "${CMAKE_CURRENT_BINARY_DIR}/dependencies/hana"
CONFIGURE_COMMAND "" # Disable configure step
BUILD_COMMAND "" # Disable build step
INSTALL_COMMAND "" # Disable install step
TEST_COMMAND "" # Disable test step
UPDATE_COMMAND "" # Disable source work-tree update
)
ExternalProject_Get_Property(install-Hana SOURCE_DIR)
include_directories(${SOURCE_DIR}/include)

include(ExternalProject)
ExternalProject_Add(install-Brigand EXCLUDE_FROM_ALL 1
URL https://github.com/edouarda/brigand/archive/master.zip
TIMEOUT 120
PREFIX "${CMAKE_CURRENT_BINARY_DIR}/dependencies/brigand"
CONFIGURE_COMMAND "" # Disable configure step
BUILD_COMMAND "" # Disable build step
INSTALL_COMMAND "" # Disable install step
TEST_COMMAND "" # Disable test step
UPDATE_COMMAND "" # Disable source work-tree update
)
ExternalProject_Get_Property(install-Brigand SOURCE_DIR)
include_directories(${SOURCE_DIR})

include(ExternalProject)
ExternalProject_Add(install-Metal EXCLUDE_FROM_ALL 1
URL https://github.com/brunocodutra/metal/archive/master.zip
TIMEOUT 120
PREFIX "${CMAKE_CURRENT_BINARY_DIR}/dependencies/metal"
CONFIGURE_COMMAND "" # Disable configure step
BUILD_COMMAND "" # Disable build step
INSTALL_COMMAND "" # Disable install step
TEST_COMMAND "" # Disable test step
UPDATE_COMMAND "" # Disable source work-tree update
)
ExternalProject_Get_Property(install-Metal SOURCE_DIR)
include_directories(${SOURCE_DIR}/include)

add_custom_target(install-dependencies DEPENDS install-Hana install-Brigand install-Metal)


#=============================================================================
# Setup compiler flags
#=============================================================================
include(CheckCXXCompilerFlag)
macro(append_cxx_flag testname flag)
check_cxx_compiler_flag(${flag} ${testname})
if (${testname})
add_compile_options(${flag})
endif()
endmacro()

append_cxx_flag(HAS_W_FLAG -W)
append_cxx_flag(HAS_WALL_FLAG -Wall)
append_cxx_flag(HAS_WEXTRA_FLAG -Wextra)
append_cxx_flag(HAS_WNO_LONG_LONG_FLAG -Wno-long-long)
append_cxx_flag(HAS_WNO_UNUSED_LOCAL_TYPEDEFS_FLAG -Wno-unused-local-typedefs)
append_cxx_flag(HAS_WNO_UNUSED_PARAMETER_FLAG -Wno-unused-parameter)
append_cxx_flag(HAS_WWRITE_STRINGS_FLAG -Wwrite-strings)
append_cxx_flag(HAS_STDCXX1Y_FLAG -std=c++1z)
append_cxx_flag(HAS_PEDANTIC_FLAG -pedantic)
append_cxx_flag(HAS_WNO_GNU_STRING_UDL -Wno-gnu-string-literal-operator-template)
append_cxx_flag(HAS_WNO_UNUSED_VARIABLE -Wno-unused-variable)


#=============================================================================
# Setup code samples
#=============================================================================
enable_testing()
add_custom_target(samples)

file(GLOB CODE_SAMPLES code/*.cpp)
foreach(_file IN LISTS CODE_SAMPLES)
file(RELATIVE_PATH _target ${CMAKE_CURRENT_SOURCE_DIR}/code ${_file})
string(REPLACE ".cpp" "" _target "${_target}")
add_executable(sample.${_target} "${_file}")
target_compile_options(sample.${_target} PRIVATE -O3)
add_dependencies(samples sample.${_target})
add_test(sample.${_target} sample.${_target})
endforeach()

add_custom_target(check ALL
COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure
DEPENDS samples
COMMENT "Build all the samples and then run them.")


#=============================================================================
# Setup benchmarks
#=============================================================================
include(metabench)
add_custom_target(benchmarks)

foreach(target hana hana.runtime std.function std.unordered_map)
metabench_add_dataset(benchmark.callbacks.${target}
benchmark/callbacks.${target}.cpp.erb
"[1, 2, 4, 6, 8, 10]"
NAME ${target}
ENV "{maxn: 10, iterations: 10_000_000}")
target_compile_options(benchmark.callbacks.${target} PRIVATE -O3 -flto)
endforeach()

metabench_add_chart(benchmark.callbacks
DATASETS benchmark.callbacks.hana
benchmark.callbacks.std.function
benchmark.callbacks.std.unordered_map
ASPECT EXECUTION_TIME
XLABEL "Number of events triggered (x 10M)"
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/benchmark/callbacks.html)

metabench_add_chart(benchmark.callbacks.runtime
DATASETS benchmark.callbacks.hana.runtime
benchmark.callbacks.std.unordered_map
ASPECT EXECUTION_TIME
XLABEL "Number of events triggered (x 10M)"
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/benchmark/callbacks.runtime.html)

add_dependencies(benchmarks benchmark.callbacks benchmark.callbacks.runtime)
176 changes: 176 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
/* global module:false */
module.exports = function(grunt) {
var port = grunt.option('port') || 8000;
var base = grunt.option('base') || '.';

// Project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner:
'/*!\n' +
' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
' * http://lab.hakim.se/reveal-js\n' +
' * MIT licensed\n' +
' *\n' +
' * Copyright (C) 2016 Hakim El Hattab, http://hakim.se\n' +
' */'
},

qunit: {
files: [ 'test/*.html' ]
},

uglify: {
options: {
banner: '<%= meta.banner %>\n'
},
build: {
src: 'js/reveal.js',
dest: 'js/reveal.min.js'
}
},

sass: {
core: {
files: {
'css/reveal.css': 'css/reveal.scss',
}
},
themes: {
files: [
{
expand: true,
cwd: 'css/theme/source',
src: ['*.scss'],
dest: 'css/theme',
ext: '.css'
}
]
}
},

autoprefixer: {
dist: {
src: 'css/reveal.css'
}
},

cssmin: {
compress: {
files: {
'css/reveal.min.css': [ 'css/reveal.css' ]
}
}
},

jshint: {
options: {
curly: false,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
eqnull: true,
browser: true,
expr: true,
globals: {
head: false,
module: false,
console: false,
unescape: false,
define: false,
exports: false
}
},
files: [ 'Gruntfile.js', 'js/reveal.js' ]
},

connect: {
server: {
options: {
port: port,
base: base,
livereload: true,
open: true
}
}
},

zip: {
'reveal-js-presentation.zip': [
'index.html',
'css/**',
'js/**',
'lib/**',
'images/**',
'plugin/**',
'**.md'
]
},

watch: {
js: {
files: [ 'Gruntfile.js', 'js/reveal.js' ],
tasks: 'js'
},
theme: {
files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ],
tasks: 'css-themes'
},
css: {
files: [ 'css/reveal.scss' ],
tasks: 'css-core'
},
html: {
files: [ '*.html']
},
markdown: {
files: [ '*.md' ]
},
options: {
livereload: true
}
}

});

// Dependencies
grunt.loadNpmTasks( 'grunt-contrib-qunit' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-sass' );
grunt.loadNpmTasks( 'grunt-contrib-connect' );
grunt.loadNpmTasks( 'grunt-autoprefixer' );
grunt.loadNpmTasks( 'grunt-zip' );

// Default task
grunt.registerTask( 'default', [ 'css', 'js' ] );

// JS task
grunt.registerTask( 'js', [ 'jshint', 'uglify', 'qunit' ] );

// Theme CSS
grunt.registerTask( 'css-themes', [ 'sass:themes' ] );

// Core framework CSS
grunt.registerTask( 'css-core', [ 'sass:core', 'autoprefixer', 'cssmin' ] );

// All CSS
grunt.registerTask( 'css', [ 'sass', 'autoprefixer', 'cssmin' ] );

// Package presentation to archive
grunt.registerTask( 'package', [ 'default', 'zip' ] );

// Serve presentation locally
grunt.registerTask( 'serve', [ 'connect', 'watch' ] );

// Run tests
grunt.registerTask( 'test', [ 'jshint', 'qunit' ] );

};
53 changes: 53 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
The content of the presentation itself, which is not part of the reveal.js
framework, is licensed as follows:
------------------------------------------------------------------------------
Copyright 2017 Louis Dionne

Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.



All code constituting the reveal.js framework is licensed with the original
license used by reveal.js:
------------------------------------------------------------------------------
Copyright (C) 2015 Hakim El Hattab, http://hakim.se

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading

0 comments on commit 46a55d2

Please sign in to comment.