├── .gitignore ├── LICENSE ├── README.md ├── code ├── bitarray │ ├── Readme.md │ ├── bit_array.rb │ ├── bit_array_test.rb │ ├── v1 │ │ └── bit_array_take_1.rb │ └── v2 │ │ ├── bit_array_take_2.rb │ │ └── bit_array_test_take_2.rb ├── bloom-filter │ ├── Readme.md │ ├── bloom_filter.rb │ └── bloom_filter_test.rb ├── bplustree │ ├── README.md │ ├── bplustree.rb │ └── bplustree_test.rb ├── bst │ ├── Readme.md │ ├── bst.rb │ └── bst1.rb ├── circular_buffer │ ├── Readme.md │ ├── circular_buffer.rb │ └── circular_buffer_test.rb ├── deque │ ├── Readme.md │ ├── deque.rb │ └── deque_test.rb ├── graph │ ├── Readme.md │ ├── graph.rb │ └── graph_test.rb ├── hash │ ├── Readme.md │ ├── custom_hash.rb │ └── custom_hash_test.rb ├── heap │ ├── Readme.md │ ├── heap.rb │ └── heap_test.rb ├── linked-list │ ├── Readme.md │ ├── linked_list.rb │ └── linked_list_2.rb ├── multiset │ ├── Readme.md │ ├── multiset.rb │ └── multiset_test.rb ├── queue │ ├── Readme.md │ └── queue.rb ├── set │ ├── Readme.md │ ├── custom_set.rb │ └── custom_set_test.rb ├── stack │ ├── Readme.md │ ├── stack.rb │ └── stack_test.rb └── trie │ ├── Readme.md │ ├── trie.rb │ └── trie_test.rb ├── css ├── print │ ├── paper.css │ └── pdf.css ├── reveal-ck.css ├── reveal.min.css └── theme │ ├── beige.css │ ├── blood.css │ ├── default.css │ ├── moon.css │ ├── night.css │ ├── serif.css │ ├── simple.css │ ├── sky.css │ └── solarized.css ├── images └── java-collections.png ├── index.html ├── js └── reveal.min.js ├── lib ├── css │ └── zenburn.css ├── font │ ├── league_gothic-webfont.eot │ ├── league_gothic-webfont.svg │ ├── league_gothic-webfont.ttf │ ├── league_gothic-webfont.woff │ └── league_gothic_license └── js │ ├── classList.js │ ├── head.min.js │ └── html5shiv.js ├── plugin ├── highlight │ └── highlight.js ├── leap │ └── leap.js ├── markdown │ ├── example.html │ ├── markdown.js │ └── marked.js ├── math │ └── math.js ├── multiplex │ ├── client.js │ ├── index.js │ └── master.js ├── notes-server │ ├── client.js │ ├── index.js │ └── notes.html ├── notes │ ├── notes.html │ └── notes.js ├── postmessage │ ├── example.html │ └── postmessage.js ├── print-pdf │ └── print-pdf.js ├── remotes │ └── remotes.js ├── search │ └── search.js └── zoom-js │ └── zoom.js └── presentation ├── slides.md └── slides ├── LICENSE ├── README.md ├── css ├── print │ ├── paper.css │ └── pdf.css ├── reveal-ck.css ├── reveal.min.css └── theme │ ├── beige.css │ ├── blood.css │ ├── default.css │ ├── moon.css │ ├── night.css │ ├── serif.css │ ├── simple.css │ ├── sky.css │ └── solarized.css ├── images └── java-collections.png ├── index.html ├── js └── reveal.min.js ├── lib ├── css │ └── zenburn.css ├── font │ ├── league_gothic-webfont.eot │ ├── league_gothic-webfont.svg │ ├── league_gothic-webfont.ttf │ ├── league_gothic-webfont.woff │ └── league_gothic_license └── js │ ├── classList.js │ ├── head.min.js │ └── html5shiv.js ├── package.json ├── plugin ├── highlight │ └── highlight.js ├── leap │ └── leap.js ├── markdown │ ├── example.html │ ├── markdown.js │ └── marked.js ├── math │ └── math.js ├── multiplex │ ├── client.js │ ├── index.js │ └── master.js ├── notes-server │ ├── client.js │ ├── index.js │ └── notes.html ├── notes │ ├── notes.html │ └── notes.js ├── postmessage │ ├── example.html │ └── postmessage.js ├── print-pdf │ └── print-pdf.js ├── remotes │ └── remotes.js ├── search │ └── search.js └── zoom-js │ └── zoom.js └── slides.html /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 aarti 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | data-structures-ruby 2 | ==================== 3 | 4 | Data Structures in Ruby 5 | 6 | [Slides](http://aarti.github.io/data-structures-ruby) created using [reveal-ck](https://github.com/jedcn/reveal-ck) gem. 7 | 8 | 9 | - [Set](code/set/Readme.md) 10 | - [MultiSet](code/multiset/Readme.md) 11 | - [BitArray](code/bitarray/Readme.md) 12 | - [Bloom Filter](code/bloom-filter/Readme.md) 13 | - [LinkedList](code/linked-list/Readme.md) 14 | - [Stack](code/stack/Readme.md) 15 | - [Queue](code/queue/Readme.md) 16 | - [Circular Buffer](code/circular_buffer/Readme.md) 17 | - [Binary Search Tree](code/bst/Readme.md) 18 | - [Dequeue](code/dequeue/Readme.md) 19 | 20 | 21 | ## In Progress 22 | 23 | - [B+ Tree](code/bplustree/README.md) 24 | 25 | ##Todo 26 | 27 | - [Heap](code/heap/Readme.md) 28 | - [Trie](trie/Readme.md) 29 | - [Hash](code/hash/Readme.md) 30 | - [Graph](code/graph/Readme.md) 31 | -------------------------------------------------------------------------------- /code/bitarray/Readme.md: -------------------------------------------------------------------------------- 1 | #Bitarray 2 | 3 | An array that compactly stores bits. It's useful when space efficiency is important. 4 | 5 | 6 | 1. Initialization with a size 7 | 8 | ```ruby 9 | b = BitArray.new(10) 10 | ``` 11 | 2. Operations the Bitarray must support 12 | 13 | - Set a bit location in the array 14 | - Clear a bit location in the array 15 | 16 | ```ruby 17 | b.set(5) 18 | b.clear(5) 19 | b.to_s #> "0000100000" 20 | b.set([1,2,3]) 21 | b.to_s #> "1110100000" 22 | b.count #> 4 23 | ``` 24 | ## How to implement one in Ruby 25 | 26 | The operations look simple enough to implement if we back it by an array. Why now simply use an array of booleans? Because this is not space efficient. Internally a boolean may be stored as a byte or more in ruby. 27 | 28 | The implementation is backed by an array and it is not very useful, just theoretical. Ideally you want to encode/pack the bits into an integer. 29 | 30 | Ruby 2.1 leverages GMP, The GNU Multiple Precision Arithmetic Library, So the BigNum AND Fixnum have a bit_length method 31 | 32 | ```ruby 33 | irb(main):041:0> bitarray = 2**1000 -1 34 | => 10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069375 35 | irb(main):042:0> bitarray.bit_length 36 | => 1000 37 | irb(main):119:0> a = (2**5) 38 | => 32 39 | irb(main):120:0> b = (1 << (5-3)) 40 | => 4 41 | irb(main):121:0> a | b 42 | => 36 43 | irb(main):122:0> (a | b).to_s(2) 44 | => "100100" 45 | irb(main):123:0> 46 | ``` 47 | 48 | [Ruby forum discussion on using BitArray] [5] 49 | [Java bitset performance][4] 50 | Ruby has a [bitarray gem][1] which is written in ruby 51 | Ruby has a native [bitset gem][3] which is written in C 52 | Java has a [BitSet][2] 53 | Python [bitarray][6] has the most extensive api 54 | Bitset in [C++][8] 55 | 56 | [1]: https://github.com/peterc/bitarray 57 | [2]: http://docs.oracle.com/javase/7/docs/api/java/util/BitSet.html 58 | [3]: https://github.com/tyler/bitset 59 | [4]: http://java-performance.info/bit-sets/ 60 | [5]: https://www.ruby-forum.com/topic/4419629 61 | [6]: https://github.com/ilanschnell/bitarray 62 | [7]: https://gmplib.org/ 63 | [8]: http://www.cplusplus.com/reference/bitset/bitset/ -------------------------------------------------------------------------------- /code/bitarray/bit_array.rb: -------------------------------------------------------------------------------- 1 | # Refactored to reverse the bits, so counting from right to left 2 | # This is a dynamic bit array 3 | class BitArray 4 | include Enumerable 5 | 6 | def initialize 7 | @bits = 0 8 | end 9 | 10 | def set *positions 11 | positions.each { |position| @bits |= 2**position } 12 | self 13 | end 14 | 15 | def unset *positions 16 | positions.each { |position| @bits ^= 2**position } 17 | self 18 | end 19 | 20 | def get position 21 | (@bits >> position) & 1 22 | end 23 | 24 | def each(&block) 25 | bits = @bits 26 | until bits == 0 27 | yield bits & 1 28 | bits = bits >> 1 29 | end 30 | end 31 | 32 | def to_s 33 | @bits.to_s(2).reverse 34 | end 35 | 36 | def count 37 | inject(0, :+) 38 | end 39 | end -------------------------------------------------------------------------------- /code/bitarray/bit_array_test.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require_relative 'bit_array' 3 | 4 | class BitArrayTest < MiniTest::Unit::TestCase 5 | def test_equal 6 | assert_equal "0", BitArray.new.to_s 7 | end 8 | 9 | def test_set 10 | assert_equal "0001", BitArray.new.set(3).to_s 11 | assert_equal "1011", BitArray.new.set(0, 2, 3).to_s 12 | assert_equal "0100000000101", BitArray.new.set(1, 10, 12).to_s 13 | end 14 | 15 | def test_unset 16 | assert_equal "101", BitArray.new.set(0, 1, 2).unset(1).to_s 17 | end 18 | 19 | def test_get 20 | assert_equal 1, BitArray.new.set(1, 2).get(2) 21 | assert_equal 0, BitArray.new.set(12).get(11) 22 | assert_equal 1, BitArray.new.set(12).get(12) 23 | end 24 | 25 | def test_count 26 | assert_equal 3, BitArray.new.set(1, 2, 5).count 27 | end 28 | 29 | def test_iterate 30 | expected = [1, 1, 0, 1] 31 | BitArray.new.set(0, 1, 3).each do |bit| 32 | assert_equal expected.shift, bit 33 | end 34 | assert expected.empty? 35 | end 36 | end -------------------------------------------------------------------------------- /code/bitarray/v1/bit_array_take_1.rb: -------------------------------------------------------------------------------- 1 | class BitArray 2 | 3 | def initialize size 4 | @arr = Array.new(size) {0} 5 | end 6 | 7 | def to_s 8 | @arr.join 9 | end 10 | 11 | def count 12 | @arr.reduce(0,:+) 13 | end 14 | 15 | def set positions 16 | bits = positions 17 | bits = [positions] if positions.kind_of? Integer 18 | bits.each { |bit| @arr[bit-1] = 1 } 19 | self 20 | end 21 | 22 | def clear positions 23 | bits = positions 24 | bits = [positions] if positions.kind_of? Integer 25 | bits.each { |bit| @arr[bit-1] = 0 } 26 | self 27 | end 28 | end -------------------------------------------------------------------------------- /code/bitarray/v2/bit_array_take_2.rb: -------------------------------------------------------------------------------- 1 | # Ruby's Fixnum & Bignum can hold very large integers and automatically handle overflow. I decided to implement BitArray using an integer as storage. Please let me know what you think about code and functionality of a BitArray. 2 | # The problem here counting from left to right 3 | 4 | class BitArray 5 | include Enumerable 6 | 7 | #the first bit is not used 8 | def initialize size 9 | @size = size 10 | @field = 2**size 11 | end 12 | 13 | def set *positions 14 | positions.each do |position| 15 | raise ArgumentError if position > @size 16 | @field |= 2**position 17 | end 18 | self 19 | end 20 | 21 | def unset *positions 22 | positions.each do |position| 23 | raise ArgumentError if position > @size 24 | @field ^= 2**position 25 | end 26 | self 27 | end 28 | 29 | def get position 30 | raise ArgumentError if position > @size 31 | (@field >> position) & 1 32 | end 33 | 34 | def each(&block) 35 | @field.to_s(2)[1..-1].split("").each { |bit_string| yield(bit_string.to_i) } 36 | end 37 | 38 | def to_s 39 | @field.to_s(2)[1..-1] 40 | end 41 | 42 | def count 43 | inject(0,:+) 44 | end 45 | 46 | end 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /code/bitarray/v2/bit_array_test_take_2.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require_relative 'bit_array_take_2' 3 | 4 | class BitArrayTest < MiniTest::Unit::TestCase 5 | 6 | def test_equal 7 | assert_equal "00000", BitArray.new(5).to_s 8 | end 9 | 10 | def test_set 11 | assert_equal "01000", BitArray.new(5).set(3).to_s 12 | assert_equal "10000", BitArray.new(5).set(4).to_s 13 | assert_equal "01110", BitArray.new(5).set(1,2,3).to_s 14 | assert_equal "110000000010", BitArray.new(12).set(1,10,11).to_s 15 | end 16 | 17 | def test_unset 18 | assert_equal "00100", BitArray.new(5).set(1,2).unset(1).to_s 19 | end 20 | 21 | def test_get 22 | assert_equal 0, BitArray.new(5).set(1,2).get(3) 23 | assert_equal 0, BitArray.new(12).set(10).get(11) 24 | assert_equal 0, BitArray.new(12).set(10).get(1) 25 | assert_equal 1, BitArray.new(5).set(1).get(1) 26 | end 27 | 28 | def test_count 29 | assert_equal 2, BitArray.new(5).set(1,2).count 30 | end 31 | 32 | def test_iterate 33 | expected = [1, 1, 0] 34 | BitArray.new(3).set(1,2).each do |bit| 35 | assert_equal expected.shift, bit 36 | end 37 | assert expected.empty? # check that we looped the expected number of times end 38 | end 39 | 40 | def test_size 41 | assert_raises(ArgumentError){ BitArray.new(5).set(6) } 42 | end 43 | 44 | end -------------------------------------------------------------------------------- /code/bloom-filter/Readme.md: -------------------------------------------------------------------------------- 1 | # Bloom Filter 2 | 3 | [Wikipedia][6] describes a Bloom filter as a space-efficient probabilistic data structure that is used to test whether an element is a member of a set. It uses multiple hash functions to determine membership in a set. 4 | 5 | When an element is added to a filter, a subsequent membership test will definitely return True. However as more elements that are added to the set, the probability of false positives will increase. Elements are always added to the set, never removed. No Delete operation 6 | 7 | ## Implementations 8 | 9 | A nice [interactive tutorial][1] on the bloom filter 10 | [Java][2] implementation 11 | [Another Java][3] implementation but with less functionality 12 | [Ruby][4] implementation 13 | 14 | ## Usage 15 | 16 | 1. Performance when accessing data. Good to check if data exists before accesing physical disk, so there is less disk I/O 17 | 2. [Safe browsing chromium][5] 18 | 19 | ## How to implement one in Ruby 20 | 21 | n = Number of items in the filter 22 | p = Probability of false positives, float between 0 and 1 or a number indicating 1-in-p 23 | m = Number of bits in the filter 24 | k = Number of hash functions 25 | 26 | We need a hash function or multiple hash functions. We can use cryptographic hash md5 or sha1 from Ruby. I did not use Ruby's built-in hash because it already seeds a value and generates different hashes for each process, not that it would matter, since this experimental, but just in-case. We need a bitarray to set the values generated by the hash. The bit indices are calculated by generating the hash for ( string + i) count times. The hash is probably not a random distribution but still manages to set k bits. 27 | 28 | The fp_rate is $$(1 - (1 - \frac{1}{f})^{n})^{k}$$. I simply calculate and don't use it much. 29 | 30 | 31 | [1]: http://billmill.org/bloomfilter-tutorial/ 32 | [2]: https://github.com/magnuss/java-bloomfilter 33 | [3]: http://blog.locut.us/2008/01/12/a-decent-stand-alone-java-bloom-filter-implementation/ 34 | [4]: https://github.com/igrigorik/bloomfilter-rb 35 | [5]: https://github.com/chromium/chromium/tree/c4625eefca763df86471d798ee5a4a054b4716ae/chrome/browser/safe_browsing 36 | [6]: http://en.wikipedia.org/wiki/Bloom_filter 37 | -------------------------------------------------------------------------------- /code/bloom-filter/bloom_filter.rb: -------------------------------------------------------------------------------- 1 | # n = Number of items in the filter 2 | # p = Probability of false positives, float between 0 and 1 or a number indicating 1-in-p 3 | # m = Number of bits in the filter 4 | # k = Number of hash functions 5 | 6 | require_relative '../bitarray/bit_array' 7 | require 'digest' 8 | 9 | class BloomFilter 10 | 11 | def initialize k: 1, m: 10 12 | raise RangeError, "k must be smaller than m" if k >= m 13 | raise ArgumentError, "k and m must be positive integers" if k < 1 || m < 1 14 | @k = k 15 | @m = m 16 | @n = 0 17 | @b = BitArray.new 18 | end 19 | 20 | # Probability of a false positive based on formula in wikipedia 21 | def false_positive_rate 22 | fp_rate = (1-(1-1/@m.to_f)**(@k.to_f*@n.to_f))**@k.to_f 23 | fp_rate 24 | end 25 | 26 | ## Simplistic Hash, manages to set k bits but not a random distribution 27 | def insert item 28 | @n += 1 29 | @k.times do |n| 30 | hash_val = digest item,n 31 | position = hash_val % @m 32 | @b.set position 33 | end 34 | self 35 | end 36 | 37 | def include? item 38 | item_included = false 39 | @k.times do |n| 40 | hash_val = digest item,n 41 | position = hash_val % @m 42 | return false if @b.get(position).zero? 43 | end 44 | true 45 | end 46 | 47 | private 48 | def digest item, n 49 | Digest::MD5.hexdigest( "#{item}#{n}" ).to_i(16) 50 | end 51 | 52 | 53 | end 54 | -------------------------------------------------------------------------------- /code/bloom-filter/bloom_filter_test.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require_relative 'bloom_filter' 3 | 4 | class BloomFilterTest < MiniTest::Unit::TestCase 5 | 6 | # Verified probability formula and tests from http://hur.st/bloomfilter?n=1&p=0.01 7 | def test_stats 8 | assert_equal 0.01, BloomFilter.new(k: 7, m: 10).insert("a").false_positive_rate.round(2) 9 | b = BloomFilter.new(k: 2, m: 29) 10 | 10.times { |n| b.insert(n) } 11 | assert_equal 0.25, b.false_positive_rate.round(2) 12 | end 13 | 14 | def test_k_smaller_then_m 15 | assert_raises(RangeError) { BloomFilter.new(k: 10, m: 7) } 16 | assert_raises(RangeError) { BloomFilter.new(k: 20, m: 19) } 17 | end 18 | 19 | def test_k_m_positive_integers 20 | assert_raises(ArgumentError) { BloomFilter.new(k: 0, m: 7) } 21 | assert_raises(ArgumentError) { BloomFilter.new(k: -2, m: 19) } 22 | assert_raises(ArgumentError) { BloomFilter.new(k: -3, m: -2) } 23 | end 24 | 25 | def test_include 26 | b = BloomFilter.new(k: 2, m: 100) 27 | b.insert "The Trumpet of the Swan" 28 | assert b.include?("The Trumpet of the Swan") 29 | refute b.include?("E. B. White") 30 | end 31 | 32 | def test_include 33 | b = BloomFilter.new(k: 2, m: 100) 34 | b.insert 1 35 | b.insert 2 36 | b.insert 3 37 | b.insert 4 38 | assert b.include? 1 39 | assert b.include? 2 40 | assert b.include? 3 41 | assert b.include? 4 42 | refute b.include? 0 43 | end 44 | 45 | 46 | end -------------------------------------------------------------------------------- /code/bplustree/README.md: -------------------------------------------------------------------------------- 1 | # B+ Tree 2 | 3 | A B+Tree is a tree data structure that allows efficient lookup of ordered keys. It stores keys in blocks at each node on multiple levels. Only leaf nodes can have data. Every node that is not a leaf has the amount of keys it stores+ 1 children. 4 | 5 | There are 3 types of children 6 | - Data or Record 7 | - Leaf Node 8 | - Internal Node 9 | 10 | Each node has two parallel structures of two arrays 11 | The first array is b-1 and the second b. 12 | 13 | 14 | # Implementation 15 | 16 | Assumption that keys are numbers 17 | 18 | - Step 1: Initialize 19 | 20 | - Step 2: split/insert 21 | 22 | 23 | # Resources 24 | 25 | Nice instructions for B+tree for MIT DB course assignment 26 | http://mll.csie.ntu.edu.tw/course/database_f04/assignment/assignment6.pdf 27 | 28 | http://blog.jcole.us/2013/01/10/btree-index-structures-in-innodb/ 29 | 30 | http://www.quora.com/B+-Trees 31 | 32 | http://stackoverflow.com/questions/870218/b-trees-b-trees-difference 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /code/bplustree/bplustree.rb: -------------------------------------------------------------------------------- 1 | class Node 2 | attr_accessor :key_array, :bplusarray, :is_leaf 3 | 4 | def initialize(bfactor) 5 | @key_array = Array.new(bfactor-1) 6 | @bplusarray = Array.new(bfactor) 7 | end 8 | 9 | def get key 10 | key_array.each_with_index do |k, i| 11 | return bplusarray[i] if key == k 12 | end 13 | end 14 | 15 | # def insert data 16 | # key_array.each do |k, i| 17 | # return bplusarray[i] if key == k 18 | # end 19 | # end 20 | 21 | def to_s 22 | "key_array = #{key_array}\n bplusarray= #{bplusarray}" 23 | end 24 | 25 | end 26 | 27 | class Bplustree 28 | 29 | attr_accessor :bfactor, :root 30 | 31 | def initialize bfactor, first, second 32 | @bfactor = bfactor 33 | @root = Node.new(bfactor) 34 | # TODO: Refactor first into insert 35 | if first.first[0] < second.first[0] 36 | @root.key_array[0]= first.first[0] 37 | @root.bplusarray[0]= first.first[1] 38 | @root.key_array[1] =second.first[0] 39 | @root.bplusarray[1] =second.first[1] 40 | else 41 | @root.key_array[0] =second.first[0] 42 | @root.bplusarray[0] =second.first[1] 43 | @root.key_array[1]= first.first[0] 44 | @root.bplusarray[1]= first.first[1] 45 | end 46 | # ----- 47 | @root.is_leaf = false 48 | end 49 | 50 | def to_s 51 | "bfactor=#{bfactor},root=#{root}" 52 | end 53 | 54 | def get key 55 | root.get key 56 | end 57 | 58 | end 59 | -------------------------------------------------------------------------------- /code/bplustree/bplustree_test.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require_relative 'bplustree' 3 | 4 | class BplustreeTest < MiniTest::Unit::TestCase 5 | def test_initialize_btree 6 | branching_factor = 3 7 | first = {"1"=> "one"} 8 | second ={"2"=> "My Second Data"} 9 | b = Bplustree.new(branching_factor, first, second ) 10 | assert_equal false, b.root.is_leaf 11 | p b.root 12 | assert_equal first.first[1], b.get(first.first[0]) 13 | #assert_equal "root{[1,2][#{first},#{second}]}", b.to_s 14 | end 15 | 16 | # TODO 17 | def test_insert_some_data 18 | end 19 | 20 | 21 | end -------------------------------------------------------------------------------- /code/bst/Readme.md: -------------------------------------------------------------------------------- 1 | # Binary Search Tree 2 | 3 | It is an ordered tree data structure with two leaves per node. The ideal data structure to represent sorted data. In binary search tree, the left child contains nodes with values less than the parent node and where the right child only contains nodes with values greater than the parent node. There must be no duplicate nodes. Searching takes O(log n). In a BST with n nodes, moving from one level to the next requires one comparison, and there are log_2(n) levels, for a total of log_2(n) comparisons. 4 | 5 | 3 ways to traverse a binary tree. Traversal requires O(n) time, since it must visit every node. 6 | 7 | 1. In Order 8 | 2. PostOrder 9 | 3. Pre Order 10 | 11 | 12 | ## Applications 13 | 14 | 1. Searching 15 | 2. Building block for most databases 16 | 3. Many specialized BST's such as RBTree and AVLTree 17 | 4. Syntax Tree used by compilers 18 | -------------------------------------------------------------------------------- /code/bst/bst.rb: -------------------------------------------------------------------------------- 1 | class Bst 2 | 3 | attr_accessor :data, :left, :right 4 | 5 | def initialize(data) 6 | self.data = data 7 | end 8 | 9 | def insert_r(data) 10 | if (self.right ) 11 | self.right.insert(data) 12 | else 13 | self.right = Bst.new(data) 14 | end 15 | end 16 | 17 | def insert_l(data) 18 | if (self.left ) 19 | self.left.insert(data) 20 | else 21 | self.left = Bst.new(data) 22 | end 23 | end 24 | 25 | def insert(data) 26 | if self.data < data 27 | return insert_r(data) 28 | elsif self.data > data 29 | return insert_l(data) 30 | else ## equal choose left then choose right 31 | if (self.right ) 32 | return insert_l(data) 33 | elsif (self.left ) 34 | return insert_r(data) 35 | end 36 | end 37 | insert_l(data) 38 | end 39 | 40 | def each(&blk) 41 | Bst.traverse(self,&blk) 42 | end 43 | 44 | def self.traverse(node, &blk) 45 | return unless node 46 | traverse(node.left,&blk) 47 | blk.call(node) 48 | traverse(node.right,&blk) 49 | end 50 | 51 | def count_unival 52 | return 0 unless self.data 53 | return 1 unless self.right && self.left 54 | c = 0 55 | c = 1 if self.left && self.right && self.left.data == self.right.data 56 | c = c + self.left.count_unival if self.left 57 | c = c + self.right.count_unival if self.right 58 | c 59 | end 60 | 61 | end 62 | 63 | 64 | #Empty Case 65 | empty_tree = Bst.new(nil) 66 | p empty_tree.count_unival == 0 67 | #=> true 68 | 69 | #No Leaves Case 70 | no_leaves = Bst.new(4) 71 | p no_leaves.count_unival == 1 72 | #=> true 73 | 74 | #With 1 Level Case and Unival 75 | one_level = Bst.new(4) 76 | one_level.insert 5 77 | one_level.insert 4 78 | p one_level.count_unival == 2 79 | #=> true 80 | 81 | #With 1Level Case and equal nodes Unival 82 | one_level = Bst.new(1) 83 | one_level.insert 1 84 | one_level.insert 1 85 | one_level.insert 1 86 | one_level.insert 1 87 | p one_level.count_unival == 5 88 | #=> true 89 | 90 | ## is unival 91 | all_data = true 92 | one_level.each { |node| all_data = all_data && node.data == one_level.data } 93 | p all_data == true 94 | #=> true -------------------------------------------------------------------------------- /code/bst/bst1.rb: -------------------------------------------------------------------------------- 1 | class Bst 2 | 3 | attr_accessor :data, :left, :right 4 | 5 | def initialize(data) 6 | self.data = data 7 | end 8 | 9 | def insert(data) 10 | if self.data < data 11 | if (self.right ) 12 | self.right.insert(data) 13 | else 14 | self.right = Bst.new(data) 15 | end 16 | else 17 | if (self.left ) 18 | self.left.insert(data) 19 | else 20 | self.left = Bst.new(data) 21 | end 22 | end 23 | end 24 | 25 | def each(&blk) 26 | Bst.traverse_preorder(self,&blk) 27 | end 28 | 29 | def self.traverse_preorder(node, &blk) 30 | return unless node 31 | traverse_preorder(node.left,&blk) 32 | blk.call(node.data) 33 | traverse_preorder(node.right,&blk) 34 | end 35 | 36 | end 37 | -------------------------------------------------------------------------------- /code/circular_buffer/Readme.md: -------------------------------------------------------------------------------- 1 | # Circular Buffer 2 | 3 | Implemented using array as internal storage 4 | 5 | -------------------------------------------------------------------------------- /code/circular_buffer/circular_buffer.rb: -------------------------------------------------------------------------------- 1 | class CircularBuffer 2 | 3 | class BufferEmptyException < StandardError; end; 4 | class BufferFullException < StandardError; end; 5 | 6 | attr_reader :size 7 | 8 | def initialize(size) 9 | @size = size.to_i 10 | @buffer = [] 11 | end 12 | 13 | def full? 14 | @buffer.size >= size 15 | end 16 | 17 | def write(data) 18 | raise CircularBuffer::BufferFullException if full? 19 | write! data if data 20 | end 21 | 22 | def write!(data) 23 | read! if full? 24 | @buffer << data 25 | end 26 | 27 | def read 28 | raise CircularBuffer::BufferEmptyException if empty? 29 | read! 30 | end 31 | 32 | def read! 33 | @buffer.shift 34 | end 35 | 36 | def clear 37 | @buffer = [] 38 | end 39 | 40 | def to_a 41 | @buffer.dup 42 | end 43 | 44 | def empty? 45 | @buffer.empty? 46 | end 47 | 48 | end -------------------------------------------------------------------------------- /code/circular_buffer/circular_buffer_test.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require_relative 'circular_buffer' 3 | 4 | class CircularBufferTest < MiniTest::Unit::TestCase 5 | 6 | def test_read_empty_buffer_throws_buffer_empty_exception 7 | buffer = CircularBuffer.new(1) 8 | assert_raises(CircularBuffer::BufferEmptyException) { buffer.read } 9 | end 10 | 11 | def test_write_and_read_back_one_item 12 | buffer = CircularBuffer.new(1) 13 | buffer.write '1' 14 | assert_equal '1', buffer.read 15 | assert_raises(CircularBuffer::BufferEmptyException) { buffer.read } 16 | end 17 | 18 | def test_write_and_read_back_multiple_items 19 | buffer = CircularBuffer.new(2) 20 | buffer.write '1' 21 | buffer.write '2' 22 | assert_equal '1', buffer.read 23 | assert_equal '2', buffer.read 24 | assert_raises(CircularBuffer::BufferEmptyException) { buffer.read } 25 | end 26 | 27 | def test_clearing_buffer 28 | buffer = CircularBuffer.new(3) 29 | (1..3).each { |i| buffer.write String(i) } 30 | buffer.clear 31 | assert_raises(CircularBuffer::BufferEmptyException) { buffer.read } 32 | buffer.write '1' 33 | buffer.write '2' 34 | assert_equal '1', buffer.read 35 | buffer.write '3' 36 | assert_equal '2', buffer.read 37 | end 38 | 39 | def test_alternate_write_and_read 40 | buffer = CircularBuffer.new(2) 41 | buffer.write '1' 42 | assert_equal '1', buffer.read 43 | buffer.write '2' 44 | assert_equal '2', buffer.read 45 | end 46 | 47 | def test_reads_back_oldest_item 48 | buffer = CircularBuffer.new(3) 49 | buffer.write '1' 50 | buffer.write '2' 51 | buffer.read 52 | buffer.write '3' 53 | assert_equal '2', buffer.read 54 | assert_equal '3', buffer.read 55 | end 56 | 57 | def test_writes_of_nil_should_not_occupy_buffer 58 | buffer = CircularBuffer.new(5) 59 | buffer.write nil 60 | (1..3).each { |i| buffer.write String(i) } 61 | assert_equal '1', buffer.read 62 | end 63 | 64 | def test_writing_to_a_full_buffer_throws_an_exception 65 | buffer = CircularBuffer.new(2) 66 | buffer.write '1' 67 | buffer.write '2' 68 | assert_raises(CircularBuffer::BufferFullException) { buffer.write 'A' } 69 | end 70 | 71 | def test_overwriting_oldest_item_in_a_full_buffer 72 | buffer = CircularBuffer.new(2) 73 | buffer.write '1' 74 | buffer.write '2' 75 | buffer.write! 'A' 76 | assert_equal '2', buffer.read 77 | assert_equal 'A', buffer.read 78 | assert_raises(CircularBuffer::BufferEmptyException) { buffer.read } 79 | end 80 | 81 | def test_alternate_read_and_write_into_buffer_overflow 82 | buffer = CircularBuffer.new(5) 83 | (1..3).each { |i| buffer.write String(i) } 84 | buffer.read 85 | buffer.read 86 | buffer.write '4' 87 | buffer.read 88 | (5..8).each { |i| buffer.write String(i) } 89 | buffer.write! 'A' 90 | buffer.write! 'B' 91 | (6..8).each do |i| 92 | assert_equal String(i), buffer.read 93 | end 94 | assert_equal 'A', buffer.read 95 | assert_equal 'B', buffer.read 96 | assert_raises(CircularBuffer::BufferEmptyException) { buffer.read } 97 | end 98 | 99 | end 100 | -------------------------------------------------------------------------------- /code/deque/Readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/code/deque/Readme.md -------------------------------------------------------------------------------- /code/deque/deque.rb: -------------------------------------------------------------------------------- 1 | class Deque 2 | Element = Struct.new(:datum, :next, :prev) 3 | 4 | def initialize 5 | @head = Element.new(nil, nil, nil) 6 | @head.prev = @head.next = @head 7 | end 8 | 9 | def push(datum) 10 | element = Element.new(datum, @head, @head.prev) 11 | @head.prev = @head.prev.next = element 12 | self 13 | end 14 | 15 | # Returns nil if the deque is empty 16 | def pop 17 | element = @head.prev 18 | element.prev.next = @head 19 | @head.prev = element.prev 20 | element.datum 21 | end 22 | 23 | # Returns nil if the deque is empty 24 | def last 25 | @head.prev.datum 26 | end 27 | 28 | def unshift(datum) 29 | element = Element.new(datum, @head.next, @head) 30 | @head.next = @head.next.prev = element 31 | self 32 | end 33 | 34 | # Returns nil if the deque is empty 35 | def shift 36 | element = @head.next 37 | element.next.prev = @head 38 | @head.next = element.next 39 | element.datum 40 | end 41 | 42 | # Returns nil if the deque is empty 43 | def first 44 | @head.next.datum 45 | end 46 | end -------------------------------------------------------------------------------- /code/deque/deque_test.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require_relative 'dequeue' 3 | 4 | class DequeTest < MiniTest::Unit::TestCase 5 | 6 | def test_push_pop 7 | deque = Deque.new 8 | deque.push(10) 9 | deque.push(20) 10 | assert_equal 20, deque.pop() 11 | assert_equal 10, deque.pop() 12 | end 13 | 14 | def test_push_shift 15 | deque = Deque.new 16 | deque.push(10) 17 | deque.push(20) 18 | assert_equal 10, deque.shift() 19 | assert_equal 20, deque.shift() 20 | end 21 | 22 | def test_unshift_shift 23 | deque = Deque.new 24 | deque.unshift(10) 25 | deque.unshift(20) 26 | assert_equal 20, deque.shift() 27 | assert_equal 10, deque.shift() 28 | end 29 | 30 | def test_unshift_pop 31 | deque = Deque.new 32 | deque.unshift(10) 33 | deque.unshift(20) 34 | assert_equal 10, deque.pop 35 | assert_equal 20, deque.pop() 36 | end 37 | 38 | def test_example 39 | deque = Deque.new 40 | deque.push(10) 41 | deque.push(20) 42 | assert_equal 20, deque.pop() 43 | deque.push(30) 44 | assert_equal 10, deque.shift() 45 | deque.unshift(40) 46 | deque.push(50) 47 | assert_equal 40, deque.shift() 48 | assert_equal 50, deque.pop() 49 | assert_equal 30, deque.shift() 50 | end 51 | 52 | end 53 | -------------------------------------------------------------------------------- /code/graph/Readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/code/graph/Readme.md -------------------------------------------------------------------------------- /code/graph/graph.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/code/graph/graph.rb -------------------------------------------------------------------------------- /code/graph/graph_test.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/code/graph/graph_test.rb -------------------------------------------------------------------------------- /code/hash/Readme.md: -------------------------------------------------------------------------------- 1 | # Hash 2 | 3 | ## How it works 4 | 5 | [How the Hash works in Ruby][1] 6 | 7 | ## How to implement one in Ruby 8 | 9 | [Hash implementation][2] 10 | 11 | 12 | 13 | [1]: http://www.gotealeaf.com/blog/how-the-hash-works-in-ruby 14 | [2]: http://www.confreaks.com/videos/4153-gogaruco2014-reimplementing-ruby-s-hash -------------------------------------------------------------------------------- /code/hash/custom_hash.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/code/hash/custom_hash.rb -------------------------------------------------------------------------------- /code/hash/custom_hash_test.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/code/hash/custom_hash_test.rb -------------------------------------------------------------------------------- /code/heap/Readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/code/heap/Readme.md -------------------------------------------------------------------------------- /code/heap/heap.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/code/heap/heap.rb -------------------------------------------------------------------------------- /code/heap/heap_test.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/code/heap/heap_test.rb -------------------------------------------------------------------------------- /code/linked-list/Readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/code/linked-list/Readme.md -------------------------------------------------------------------------------- /code/linked-list/linked_list.rb: -------------------------------------------------------------------------------- 1 | class Node 2 | 3 | attr_accessor :data, :next_node, :visited 4 | 5 | def initialize(data,next_node) 6 | @data =data 7 | @next_node = next_node 8 | end 9 | 10 | end 11 | 12 | 13 | 14 | 15 | class LinkedList 16 | 17 | attr_accessor :head 18 | 19 | def addfirst(node) 20 | node.next_node = @head if (@head) 21 | @head = node 22 | end 23 | 24 | def add(node) 25 | unless head 26 | @head = node 27 | return 28 | end 29 | prev_node = head 30 | curr_node = head.next_node 31 | while (curr_node) do 32 | prev_node = curr_node 33 | curr_node = curr_node.next_node 34 | end 35 | prev_node.next_node = node 36 | p @head 37 | end 38 | 39 | def delete(node) 40 | return unless @head && node 41 | prev_node = nil 42 | curr_node = @head 43 | while (curr_node) do 44 | if curr_node == node then 45 | if prev_node then 46 | prev_node.next_node = curr_node.next_node 47 | break 48 | else 49 | @head = nil 50 | end 51 | else 52 | prev_node = curr_node 53 | curr_node = curr_node.next_node 54 | p curr_node.data 55 | p "\n" 56 | end 57 | end 58 | end 59 | 60 | def traverse(node, nodes=[]) 61 | if node 62 | nodes << node 63 | curr_node = node.next_node 64 | if curr_node 65 | raise "Loop found at #{curr_node.data}" if nodes.include?(curr_node) 66 | traverse(curr_node, nodes) 67 | end 68 | end 69 | end 70 | 71 | def traverse_findloopwithhash(node, nodes={}) 72 | if node 73 | p node.data 74 | nodes[node]=node 75 | curr_node = node.next_node 76 | if curr_node 77 | raise "Loop found at #{curr_node.data}" if nodes.has_key?(curr_node) 78 | traverse_findloopwithhash(curr_node, nodes) 79 | end 80 | end 81 | end 82 | 83 | def traverse_markvsisitednodes(node) 84 | if node 85 | p node.data 86 | node.visited = true 87 | curr_node = node.next_node 88 | if curr_node 89 | raise "Loop found at #{curr_node.data}" if curr_node.visited 90 | traverse_markvsisitednodes(curr_node) 91 | end 92 | end 93 | end 94 | 95 | def traverse_floyd(node) 96 | if node 97 | slow = node 98 | fast = node 99 | while ( slow && fast && fast.next_node) 100 | slow = slow.next_node 101 | fast = fast.next_node.next_node 102 | p slow 103 | p fast 104 | raise "Loop found at #{slow.data}" if ( slow == fast ) 105 | end 106 | end 107 | end 108 | 109 | end 110 | 111 | 112 | l = LinkedList.new() 113 | l.addfirst(Node.new("2",nil)) 114 | l.add(Node.new("4",nil)) 115 | n = Node.new("1",nil) 116 | l.add(n) 117 | l.add(Node.new("3",n)) 118 | l.traverse_floyd(l.head) 119 | #l.add(Node.new("5",nil)) 120 | #l.delete(n) 121 | #l.traverse(l.head) 122 | 123 | -------------------------------------------------------------------------------- /code/linked-list/linked_list_2.rb: -------------------------------------------------------------------------------- 1 | class Element 2 | 3 | attr_accessor :datum, :next 4 | 5 | def initialize(datum,next_element) 6 | @datum = datum 7 | @next = next_element 8 | end 9 | 10 | def reverse 11 | reversed = nil 12 | original = self 13 | next_element = nil 14 | while (original) 15 | reversed = Element.new(original.datum, next_element) 16 | next_element = reversed 17 | original = original.next 18 | end 19 | reversed 20 | end 21 | 22 | def to_a 23 | Element.to_a(self) 24 | end 25 | 26 | def from_a 27 | Element.from_a(self) 28 | end 29 | 30 | def self.to_a(list) 31 | ret_arr = [] 32 | the_list = list 33 | while (the_list) 34 | ret_arr << the_list.datum 35 | the_list = the_list.next 36 | end 37 | ret_arr 38 | end 39 | 40 | def self.from_a(arr) 41 | list = nil 42 | prev_element = nil 43 | arr.each do |e| 44 | new_element = Element.new(e, nil) 45 | if prev_element 46 | prev_element.next = new_element 47 | else 48 | list = new_element 49 | end 50 | prev_element = new_element 51 | end 52 | list 53 | end 54 | 55 | end -------------------------------------------------------------------------------- /code/multiset/Readme.md: -------------------------------------------------------------------------------- 1 | # MultiSet 2 | 3 | It is a set in which members are allowed to appear more then once. The number of times an element belongs to the multiset is the multiplicity of that member. The total number of elements in a multiset, including repeated memberships, is the cardinality of the multiset. For example, in the multiset {a, a, b, b, b, c} the multiplicities of the members a, b, and c are respectively 2, 3, and 1, and the cardinality of the multiset is 6. [Source][2] 4 | 5 | 6 | 1. members allowed to appear more than once. {a, a, b} 7 | 2. the order of elements is irrelevant: The multisets {a, a, b} and {a, b, a} are equal. 8 | 3. it provides the count or multiplicity of an element in the set. `count (a) = 2` 9 | 4. it can return the distinct elements of the set. {a, b} 10 | 5. it returns the cardinality of the set, total number of elements including duplicates. `6` 11 | 12 | A multiset is not a hash but could be implemented as one, it could also be implemented as two arrays. 13 | 14 | Google's Guava library provides a great explanation of [MultiSet][3], with several different implementations backed by a Hash, a Tree and a LinkedList. It also has an implementation with concurrency support. 15 | 16 | Clojure also has a [MultiSet][4] which provides all of the functionality with _only_ 157 lines! 17 | 18 | Ruby also has a [MultiSet][5] library 19 | 20 | ## How to implement one in Ruby 21 | 22 | To create a MultiSet, we will take the TDD approach and identify what methods we need 23 | 24 | The MultiSet api must allow 25 | 26 | 1. Initialization with an array, or with a Range, or a Hash 27 | 28 | ```ruby 29 | MultiSet.new([1,2,3,3]) 30 | MultiSet.new([1..6]) 31 | MultiSet.new({"1"=>1, "2"=>1, "3"=>2}) 32 | ``` 33 | 2. Operations the multiset must support 34 | 35 | ```ruby 36 | m = MultiSet.new([1,2,3,3]) 37 | m.multiplicity(3) == 2 38 | m.multiplicity(2) == 1 39 | m.multiplicity(4) == 0 40 | m.cardinality == 4 41 | m.remove(1) 42 | m.add(2) 43 | m.include?(2) 44 | m.to_set returns a Set object 45 | m.to_a returns [1,2,3,3] 46 | m.to_h {"1"=>1, "2"=>1, "3"=>2} 47 | m1 == m2 48 | m1 | m2 (union) 49 | m1 & m2 (intersection) 50 | m1.subset? m2 (subset) 51 | m1 * m2 (cartesian) 52 | ``` 53 | 54 | 3. What the api returns is important 55 | It should not allow modification of internal data structure 56 | Union, Intersection etc should return new object instances 57 | Initializer should only allow enumerable types, or even only array or set type. 58 | 59 | 60 | ## Practical Examples of Multiset 61 | 62 | 1. Shopping Cart, with items and quantity 63 | 2. Prime Factors of a number 64 | `120 = {2, 2, 2, 3, 5}.` 65 | 66 | ## Open questions 67 | 68 | 1. What should the return type of the cartesian product be 69 | 70 | In Math it is 71 | `{1,1}*{1,2} = {(1,1),(1,1),(1,2),(1,2)}` 72 | 73 | 74 | [1]: https://github.com/maraigue/multiset 75 | [2]: http://en.wikipedia.org/wiki/Multiset 76 | [3]: https://code.google.com/p/guava-libraries/wiki/NewCollectionTypesExplained#Multiset 77 | [4]: https://github.com/achim/multiset -------------------------------------------------------------------------------- /code/multiset/multiset.rb: -------------------------------------------------------------------------------- 1 | class MultiSet 2 | include Enumerable 3 | 4 | def initialize enum=[] 5 | @members = {} 6 | raise ArgumentError, "enum must include the 'Enumerable' module" unless enum.kind_of? Enumerable 7 | enum.each do |item| 8 | add item 9 | end 10 | end 11 | 12 | def each &blk 13 | @members.each &blk 14 | end 15 | 16 | def == other 17 | @members.to_h == other.to_h 18 | end 19 | 20 | def eql? other 21 | self == other 22 | end 23 | 24 | def members 25 | @members.dup 26 | end 27 | 28 | def to_a 29 | a = [] 30 | @members.each do |key, count| 31 | count.times { a << key } 32 | end 33 | a 34 | end 35 | 36 | def to_set 37 | Set.new members.keys 38 | end 39 | 40 | def remove item 41 | if include? item 42 | @members[item] = @members[item] - 1 43 | @members.delete item if @members[item] < 1 44 | end 45 | self 46 | end 47 | 48 | def add item 49 | if include? item 50 | @members[item] += 1 51 | else 52 | @members[item] = 1 53 | end 54 | self 55 | end 56 | 57 | def clear 58 | @members.clear 59 | end 60 | 61 | def multiplicity item 62 | include?(item) ? @members[item] : 0 63 | end 64 | 65 | def include? item 66 | @members.include? item 67 | end 68 | 69 | def cardinality 70 | @members.values.reduce(0,:+) 71 | end 72 | 73 | def | other 74 | union = self.class.new(self.to_a) 75 | other.each do |key, count| 76 | count.times { union.add key } 77 | end 78 | union 79 | end 80 | 81 | def & other 82 | intersection = self.class.new 83 | @members.each do |key, count| 84 | if other.include? key 85 | max_count = [count, other.multiplicity(key)].min 86 | max_count.times { intersection.add key } 87 | end 88 | end 89 | intersection 90 | end 91 | 92 | alias_method :to_h, :members 93 | 94 | end 95 | 96 | -------------------------------------------------------------------------------- /code/multiset/multiset_test.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require_relative 'multiset' 3 | require 'set' 4 | 5 | class MultiSetTest < MiniTest::Unit::TestCase 6 | 7 | def test_equal 8 | assert_equal MultiSet.new([1, 3]), MultiSet.new([3, 1]) 9 | end 10 | 11 | def test_no_duplicates 12 | assert_equal MultiSet.new([1, 1]).to_set, Set.new([1]) 13 | end 14 | 15 | def test_remove 16 | assert_equal MultiSet.new([1,3]), MultiSet.new([3,2,1]).remove(2) 17 | assert_equal MultiSet.new([1,2,3]), MultiSet.new([3,2,1]).remove(4) 18 | assert_equal MultiSet.new([1,2,3]), MultiSet.new([3,2,1]).remove(2.0) 19 | assert_equal MultiSet.new([1,3]), MultiSet.new([3,2.0,1]).remove(2.0) 20 | end 21 | 22 | def test_empty 23 | assert_equal MultiSet.new, MultiSet.new([1,2]).clear 24 | assert_equal MultiSet.new, MultiSet.new.clear 25 | end 26 | 27 | def test_multiplicity 28 | assert_equal 2,MultiSet.new([1, 1, 2]).multiplicity(1) 29 | assert_equal 0,MultiSet.new([1, 1, 2]).multiplicity(4) 30 | assert_equal 0,MultiSet.new([1, 1, 2]).multiplicity(1.0) 31 | assert_equal 1,MultiSet.new([1, 1, 2]).multiplicity(2) 32 | end 33 | 34 | def test_membership 35 | assert MultiSet.new([1,2,3]).include?(2) 36 | assert MultiSet.new(1..3).include?(2) 37 | refute MultiSet.new(1..3).include?(2.0) 38 | refute MultiSet.new(1..3).include?(4) 39 | end 40 | 41 | def test_add 42 | assert_equal MultiSet.new([1,2,3,4]), 43 | MultiSet.new([1,2,4]).add(3) 44 | 45 | expected = {1 => 1, 2 =>1, 3 => 2} 46 | assert_equal expected, MultiSet.new([1,2,3]).add(3).to_h 47 | 48 | assert_equal MultiSet.new([1,2,3,3.0]), 49 | MultiSet.new([1,2,3]).add(3.0) 50 | end 51 | 52 | def test_to_set 53 | assert_equal Set.new, MultiSet.new.to_set 54 | assert_equal Set.new([1,2,3]), MultiSet.new([3,1,2]).to_set 55 | end 56 | 57 | def test_cardinality 58 | assert_equal 3,MultiSet.new([1, 1, 2]).cardinality 59 | assert_equal 0,MultiSet.new.cardinality 60 | end 61 | 62 | def test_union 63 | assert_equal MultiSet.new([3.0,3,2,1]), MultiSet.new([1,3]) | (MultiSet.new([2,3.0])) 64 | assert_equal MultiSet.new([3,1]), MultiSet.new([1,3]) | (MultiSet.new) 65 | assert_equal MultiSet.new([2]), MultiSet.new([2]) | (MultiSet.new) 66 | assert_equal MultiSet.new([]), MultiSet.new | (MultiSet.new) 67 | end 68 | 69 | def test_intersection 70 | assert_equal MultiSet.new([1,1]), MultiSet.new([1,1,1,3]) & (MultiSet.new([1,1,2])) 71 | assert_equal MultiSet.new([3,1]), MultiSet.new([1,3]) | (MultiSet.new) 72 | assert_equal MultiSet.new([2]), MultiSet.new([2]) | (MultiSet.new) 73 | assert_equal MultiSet.new([]), MultiSet.new | (MultiSet.new) 74 | end 75 | 76 | 77 | end 78 | -------------------------------------------------------------------------------- /code/queue/Readme.md: -------------------------------------------------------------------------------- 1 | # Queue 2 | 3 | 4 | Ruby's Array is already a queue. We can use forwardable and delegates to create one. -------------------------------------------------------------------------------- /code/queue/queue.rb: -------------------------------------------------------------------------------- 1 | # by James Edward Gray source http://www.java-samples.com/showtutorial.php?tutorialid=1125 2 | class Queue 3 | extend Forwardable 4 | 5 | def initialize 6 | @q = [ ] # prepare delegate object 7 | end 8 | 9 | # setup prefered interface, enq() and deq()... 10 | def_delegator :@q, :push, :enq 11 | def_delegator :@q, :shift, :deq 12 | 13 | # support some general Array methods that fit Queues well 14 | def_delegators :@q, :clear, :first, :push, :shift, :size 15 | end 16 | 17 | q = Queue.new 18 | q.enq 1, 2, 3, 4, 5 19 | q.push 6 20 | 21 | q.shift # => 1 22 | while q.size > 0 23 | puts q.deq 24 | end 25 | 26 | q.enq "Ruby", "Perl", "Python" 27 | puts q.first 28 | q.clear 29 | puts q.first -------------------------------------------------------------------------------- /code/set/custom_set.rb: -------------------------------------------------------------------------------- 1 | class CustomSet 2 | include Enumerable 3 | 4 | attr_reader :members 5 | 6 | # Argument value must be enumerable, which will always have a to_a method 7 | # if it's nil then it also has a to_a method 8 | def initialize(enum=[]) 9 | @members= enum.to_a.uniq.dup 10 | end 11 | 12 | def size 13 | members.size 14 | end 15 | 16 | def each(&blk) 17 | members.each(&blk) 18 | end 19 | 20 | # Since Ruby does type conversion and we need to treat 2.0 distinct from 2 21 | #[1,2.0,2,3].index(2.0) #=> 1 22 | #[1,2.0,2,3].index(2) #=> 1 23 | # We need to modify with a block 24 | def index(other) 25 | members.index { |item| item.eql?(other) } 26 | end 27 | 28 | def ==(other) 29 | return false unless other.class == self.class 30 | return false unless other.size ==self.size 31 | other.each do |item| 32 | return false unless index(item) 33 | end 34 | true 35 | end 36 | 37 | def eql?(other) 38 | self == other 39 | end 40 | 41 | def delete(item) 42 | members.delete(item) if index(item) 43 | self 44 | end 45 | 46 | def difference(other) 47 | self.class.new(members - other.to_a) 48 | end 49 | 50 | def intersection(other) 51 | self.class.new(members & other.to_a) 52 | end 53 | 54 | def union(other) 55 | self.class.new(members | other.to_a) 56 | end 57 | 58 | def disjoint?(other) 59 | union(other).size == self.size + other.size 60 | end 61 | 62 | def subset?(other) 63 | self.size >= other.size && intersection(other) == other 64 | end 65 | 66 | def member?(n) 67 | index(n) 68 | end 69 | 70 | def put(item) 71 | members << item unless member?(item) 72 | self 73 | end 74 | 75 | def empty! 76 | self.members.clear 77 | self 78 | end 79 | 80 | # you don't want to return your instance variable directly! If you do, it can then be modified externally. 81 | def to_a 82 | members.dup 83 | end 84 | 85 | def dup 86 | self.class.new(members) 87 | end 88 | 89 | 90 | alias_method :|, :union 91 | alias_method :&, :intersection 92 | alias_method :-, :difference 93 | 94 | end 95 | -------------------------------------------------------------------------------- /code/set/custom_set_test.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require_relative 'custom_set' 3 | 4 | class CustomSetTest < MiniTest::Unit::TestCase 5 | 6 | def test_no_duplicates 7 | assert_equal CustomSet.new([1, 1]), CustomSet.new([1]) 8 | end 9 | 10 | def test_equal 11 | assert_equal CustomSet.new([1, 3]), CustomSet.new([3, 1]) 12 | end 13 | 14 | def test_delete 15 | assert_equal CustomSet.new([1,3]), CustomSet.new([3,2,1]).delete(2) 16 | assert_equal CustomSet.new([1,2,3]), CustomSet.new([3,2,1]).delete(4) 17 | assert_equal CustomSet.new([1,2,3]), CustomSet.new([3,2,1]).delete(2.0) 18 | assert_equal CustomSet.new([1,3]), CustomSet.new([3,2.0,1]).delete(2.0) 19 | end 20 | 21 | def test_difference 22 | assert_equal CustomSet.new([1,3]), 23 | CustomSet.new([1,2,3]).difference(CustomSet.new([2,4])) 24 | 25 | assert_equal CustomSet.new([1,2.0,3]), 26 | CustomSet.new([1,2.0,3]) - (CustomSet.new([2,4])) 27 | end 28 | 29 | def test_disjoint? 30 | assert CustomSet.new([1,2]).disjoint?(CustomSet.new([3,4])) 31 | refute CustomSet.new([1,2]).disjoint?(CustomSet.new([2,3])) 32 | assert CustomSet.new([1.0,2.0]).disjoint?(CustomSet.new([2,3])) 33 | assert CustomSet.new.disjoint?(CustomSet.new) 34 | end 35 | 36 | def test_empty 37 | assert_equal CustomSet.new, CustomSet.new([1,2]).empty! 38 | assert_equal CustomSet.new, CustomSet.new.empty! 39 | end 40 | 41 | def test_intersection 42 | assert_equal CustomSet.new([:a, :c]), 43 | CustomSet.new([:a, :b, :c]).intersection(CustomSet.new([:a, :c, :d])) 44 | 45 | assert_equal CustomSet.new([3]), 46 | CustomSet.new([1, 2, 3]) & (CustomSet.new([1.0, 2.0, 3])) 47 | end 48 | 49 | def test_member? 50 | assert CustomSet.new([1,2,3]).member?(2) 51 | assert CustomSet.new(1..3).member?(2) 52 | refute CustomSet.new(1..3).member?(2.0) 53 | refute CustomSet.new(1..3).member?(4) 54 | end 55 | 56 | def test_put 57 | assert_equal CustomSet.new([1,2,3,4]), 58 | CustomSet.new([1,2,4]).put(3) 59 | 60 | assert_equal CustomSet.new([1,2,3]), 61 | CustomSet.new([1,2,3]).put(3) 62 | 63 | assert_equal CustomSet.new([1,2,3,3.0]), 64 | CustomSet.new([1,2,3]).put(3.0) 65 | end 66 | 67 | def test_size 68 | assert_equal 0, CustomSet.new.size 69 | assert_equal 3, CustomSet.new([1,2,3]).size 70 | assert_equal 3, CustomSet.new([1,2,3,2]).size 71 | end 72 | 73 | def test_subset? 74 | assert CustomSet.new([1,2,3]).subset?(CustomSet.new([1,2,3])) 75 | assert CustomSet.new([4,1,2,3]).subset?(CustomSet.new([1,2,3])) 76 | refute CustomSet.new([4,1,3]).subset?(CustomSet.new([1,2,3])) 77 | refute CustomSet.new([1,2,3,4]).subset?(CustomSet.new([1,2,3.0])) 78 | assert CustomSet.new([4,1,3]).subset?(CustomSet.new) 79 | assert CustomSet.new.subset?(CustomSet.new) 80 | end 81 | 82 | def test_to_a 83 | assert_equal [], CustomSet.new.to_a.sort 84 | assert_equal [1,2,3], CustomSet.new([3,1,2]).to_a.sort 85 | assert_equal [1,2,3], CustomSet.new([3,1,2,1]).to_a.sort 86 | end 87 | 88 | def test_union 89 | assert_equal CustomSet.new([3,2,1]), 90 | CustomSet.new([1,3]).union(CustomSet.new([2])) 91 | assert_equal CustomSet.new([3.0,3,2,1]), 92 | CustomSet.new([1,3]) | (CustomSet.new([2,3.0])) 93 | assert_equal CustomSet.new([3,1]), 94 | CustomSet.new([1,3]) | (CustomSet.new) 95 | assert_equal CustomSet.new([2]), 96 | CustomSet.new([2]) | (CustomSet.new) 97 | assert_equal CustomSet.new([]), 98 | CustomSet.new | (CustomSet.new) 99 | end 100 | 101 | end 102 | -------------------------------------------------------------------------------- /code/stack/Readme.md: -------------------------------------------------------------------------------- 1 | ## Stack 2 | 3 | - FIFO 4 | - Operations supported 5 | - push 6 | - pop 7 | - peek 8 | - Implementation varies 9 | - Array 10 | - LinkedList -------------------------------------------------------------------------------- /code/stack/stack.rb: -------------------------------------------------------------------------------- 1 | # Storage is array 2 | class Stack 3 | def initialize 4 | @store = Array.new 5 | end 6 | 7 | def pop 8 | @store.pop 9 | end 10 | 11 | def push(element) 12 | @store.push(element) 13 | self 14 | end 15 | 16 | def size 17 | @store.size 18 | end 19 | end 20 | 21 | s = Stack.new 22 | s.push 1 23 | s.push 2 24 | s.push 3 25 | p s 26 | 27 | s.pop 28 | p s -------------------------------------------------------------------------------- /code/stack/stack_test.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/code/stack/stack_test.rb -------------------------------------------------------------------------------- /code/trie/Readme.md: -------------------------------------------------------------------------------- 1 | # Trie 2 | 3 | -------------------------------------------------------------------------------- /code/trie/trie.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/code/trie/trie.rb -------------------------------------------------------------------------------- /code/trie/trie_test.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/code/trie/trie_test.rb -------------------------------------------------------------------------------- /css/print/paper.css: -------------------------------------------------------------------------------- 1 | /* Default Print Stylesheet Template 2 | by Rob Glazebrook of CSSnewbie.com 3 | Last Updated: June 4, 2008 4 | 5 | Feel free (nay, compelled) to edit, append, and 6 | manipulate this file as you see fit. */ 7 | 8 | 9 | /* SECTION 1: Set default width, margin, float, and 10 | background. This prevents elements from extending 11 | beyond the edge of the printed page, and prevents 12 | unnecessary background images from printing */ 13 | body { 14 | background: #fff; 15 | font-size: 13pt; 16 | width: auto; 17 | height: auto; 18 | border: 0; 19 | margin: 0 5%; 20 | padding: 0; 21 | float: none !important; 22 | overflow: visible; 23 | } 24 | html { 25 | background: #fff; 26 | width: auto; 27 | height: auto; 28 | overflow: visible; 29 | } 30 | 31 | /* SECTION 2: Remove any elements not needed in print. 32 | This would include navigation, ads, sidebars, etc. */ 33 | .nestedarrow, 34 | .controls, 35 | .reveal .progress, 36 | .reveal.overview, 37 | .fork-reveal, 38 | .share-reveal, 39 | .state-background { 40 | display: none !important; 41 | } 42 | 43 | /* SECTION 3: Set body font face, size, and color. 44 | Consider using a serif font for readability. */ 45 | body, p, td, li, div, a { 46 | font-size: 16pt!important; 47 | font-family: Georgia, "Times New Roman", Times, serif !important; 48 | color: #000; 49 | } 50 | 51 | /* SECTION 4: Set heading font face, sizes, and color. 52 | Differentiate your headings from your body text. 53 | Perhaps use a large sans-serif for distinction. */ 54 | h1,h2,h3,h4,h5,h6 { 55 | color: #000!important; 56 | height: auto; 57 | line-height: normal; 58 | font-family: Georgia, "Times New Roman", Times, serif !important; 59 | text-shadow: 0 0 0 #000 !important; 60 | text-align: left; 61 | letter-spacing: normal; 62 | } 63 | /* Need to reduce the size of the fonts for printing */ 64 | h1 { font-size: 26pt !important; } 65 | h2 { font-size: 22pt !important; } 66 | h3 { font-size: 20pt !important; } 67 | h4 { font-size: 20pt !important; font-variant: small-caps; } 68 | h5 { font-size: 19pt !important; } 69 | h6 { font-size: 18pt !important; font-style: italic; } 70 | 71 | /* SECTION 5: Make hyperlinks more usable. 72 | Ensure links are underlined, and consider appending 73 | the URL to the end of the link for usability. */ 74 | a:link, 75 | a:visited { 76 | color: #000 !important; 77 | font-weight: bold; 78 | text-decoration: underline; 79 | } 80 | /* 81 | .reveal a:link:after, 82 | .reveal a:visited:after { 83 | content: " (" attr(href) ") "; 84 | color: #222 !important; 85 | font-size: 90%; 86 | } 87 | */ 88 | 89 | 90 | /* SECTION 6: more reveal.js specific additions by @skypanther */ 91 | ul, ol, div, p { 92 | visibility: visible; 93 | position: static; 94 | width: auto; 95 | height: auto; 96 | display: block; 97 | overflow: visible; 98 | margin: auto; 99 | text-align: left !important; 100 | } 101 | .reveal .slides { 102 | position: static; 103 | width: auto; 104 | height: auto; 105 | 106 | left: auto; 107 | top: auto; 108 | margin-left: auto; 109 | margin-top: auto; 110 | padding: auto; 111 | 112 | overflow: visible; 113 | display: block; 114 | 115 | text-align: center; 116 | -webkit-perspective: none; 117 | -moz-perspective: none; 118 | -ms-perspective: none; 119 | perspective: none; 120 | 121 | -webkit-perspective-origin: 50% 50%; /* there isn't a none/auto value but 50-50 is the default */ 122 | -moz-perspective-origin: 50% 50%; 123 | -ms-perspective-origin: 50% 50%; 124 | perspective-origin: 50% 50%; 125 | } 126 | .reveal .slides>section, 127 | .reveal .slides>section>section { 128 | 129 | visibility: visible !important; 130 | position: static !important; 131 | width: 90% !important; 132 | height: auto !important; 133 | display: block !important; 134 | overflow: visible !important; 135 | 136 | left: 0% !important; 137 | top: 0% !important; 138 | margin-left: 0px !important; 139 | margin-top: 0px !important; 140 | padding: 20px 0px !important; 141 | 142 | opacity: 1 !important; 143 | 144 | -webkit-transform-style: flat !important; 145 | -moz-transform-style: flat !important; 146 | -ms-transform-style: flat !important; 147 | transform-style: flat !important; 148 | 149 | -webkit-transform: none !important; 150 | -moz-transform: none !important; 151 | -ms-transform: none !important; 152 | transform: none !important; 153 | } 154 | .reveal section { 155 | page-break-after: always !important; 156 | display: block !important; 157 | } 158 | .reveal section .fragment { 159 | opacity: 1 !important; 160 | visibility: visible !important; 161 | 162 | -webkit-transform: none !important; 163 | -moz-transform: none !important; 164 | -ms-transform: none !important; 165 | transform: none !important; 166 | } 167 | .reveal section:last-of-type { 168 | page-break-after: avoid !important; 169 | } 170 | .reveal section img { 171 | display: block; 172 | margin: 15px 0px; 173 | background: rgba(255,255,255,1); 174 | border: 1px solid #666; 175 | box-shadow: none; 176 | } -------------------------------------------------------------------------------- /css/print/pdf.css: -------------------------------------------------------------------------------- 1 | /* Default Print Stylesheet Template 2 | by Rob Glazebrook of CSSnewbie.com 3 | Last Updated: June 4, 2008 4 | 5 | Feel free (nay, compelled) to edit, append, and 6 | manipulate this file as you see fit. */ 7 | 8 | 9 | /* SECTION 1: Set default width, margin, float, and 10 | background. This prevents elements from extending 11 | beyond the edge of the printed page, and prevents 12 | unnecessary background images from printing */ 13 | 14 | * { 15 | -webkit-print-color-adjust: exact; 16 | } 17 | 18 | body { 19 | font-size: 18pt; 20 | width: 297mm; 21 | height: 229mm; 22 | margin: 0 auto !important; 23 | border: 0; 24 | padding: 0; 25 | float: none !important; 26 | overflow: visible; 27 | } 28 | 29 | html { 30 | width: 100%; 31 | height: 100%; 32 | overflow: visible; 33 | } 34 | 35 | @page { 36 | size: letter landscape; 37 | margin: 0; 38 | } 39 | 40 | /* SECTION 2: Remove any elements not needed in print. 41 | This would include navigation, ads, sidebars, etc. */ 42 | .nestedarrow, 43 | .controls, 44 | .reveal .progress, 45 | .reveal.overview, 46 | .fork-reveal, 47 | .share-reveal, 48 | .state-background { 49 | display: none !important; 50 | } 51 | 52 | /* SECTION 3: Set body font face, size, and color. 53 | Consider using a serif font for readability. */ 54 | body, p, td, li, div { 55 | font-size: 18pt; 56 | } 57 | 58 | /* SECTION 4: Set heading font face, sizes, and color. 59 | Differentiate your headings from your body text. 60 | Perhaps use a large sans-serif for distinction. */ 61 | h1,h2,h3,h4,h5,h6 { 62 | text-shadow: 0 0 0 #000 !important; 63 | } 64 | 65 | /* SECTION 5: Make hyperlinks more usable. 66 | Ensure links are underlined, and consider appending 67 | the URL to the end of the link for usability. */ 68 | a:link, 69 | a:visited { 70 | font-weight: normal; 71 | text-decoration: underline; 72 | } 73 | 74 | .reveal pre code { 75 | overflow: hidden !important; 76 | font-family: monospace !important; 77 | } 78 | 79 | 80 | /* SECTION 6: more reveal.js specific additions by @skypanther */ 81 | ul, ol, div, p { 82 | visibility: visible; 83 | position: static; 84 | width: auto; 85 | height: auto; 86 | display: block; 87 | overflow: visible; 88 | margin: auto; 89 | } 90 | .reveal { 91 | width: auto !important; 92 | height: auto !important; 93 | overflow: hidden !important; 94 | } 95 | .reveal .slides { 96 | position: static; 97 | width: 100%; 98 | height: auto; 99 | 100 | left: auto; 101 | top: auto; 102 | margin: 0 !important; 103 | padding: 0 !important; 104 | 105 | overflow: visible; 106 | display: block; 107 | 108 | text-align: center; 109 | 110 | -webkit-perspective: none; 111 | -moz-perspective: none; 112 | -ms-perspective: none; 113 | perspective: none; 114 | 115 | -webkit-perspective-origin: 50% 50%; /* there isn't a none/auto value but 50-50 is the default */ 116 | -moz-perspective-origin: 50% 50%; 117 | -ms-perspective-origin: 50% 50%; 118 | perspective-origin: 50% 50%; 119 | } 120 | .reveal .slides section { 121 | 122 | page-break-after: always !important; 123 | 124 | visibility: visible !important; 125 | position: relative !important; 126 | width: 100% !important; 127 | height: 229mm !important; 128 | min-height: 229mm !important; 129 | display: block !important; 130 | overflow: hidden !important; 131 | 132 | left: 0 !important; 133 | top: 0 !important; 134 | margin: 0 !important; 135 | padding: 2cm 2cm 0 2cm !important; 136 | box-sizing: border-box !important; 137 | 138 | opacity: 1 !important; 139 | 140 | -webkit-transform-style: flat !important; 141 | -moz-transform-style: flat !important; 142 | -ms-transform-style: flat !important; 143 | transform-style: flat !important; 144 | 145 | -webkit-transform: none !important; 146 | -moz-transform: none !important; 147 | -ms-transform: none !important; 148 | transform: none !important; 149 | } 150 | .reveal section.stack { 151 | margin: 0 !important; 152 | padding: 0 !important; 153 | page-break-after: avoid !important; 154 | height: auto !important; 155 | min-height: auto !important; 156 | } 157 | .reveal .absolute-element { 158 | margin-left: 2.2cm; 159 | margin-top: 1.8cm; 160 | } 161 | .reveal section .fragment { 162 | opacity: 1 !important; 163 | visibility: visible !important; 164 | 165 | -webkit-transform: none !important; 166 | -moz-transform: none !important; 167 | -ms-transform: none !important; 168 | transform: none !important; 169 | } 170 | .reveal section .slide-background { 171 | position: absolute; 172 | top: 0; 173 | left: 0; 174 | width: 100%; 175 | z-index: 0; 176 | } 177 | .reveal section>* { 178 | position: relative; 179 | z-index: 1; 180 | } 181 | .reveal img { 182 | box-shadow: none; 183 | } 184 | .reveal .roll { 185 | overflow: visible; 186 | line-height: 1em; 187 | } 188 | .reveal small a { 189 | font-size: 16pt !important; 190 | } 191 | -------------------------------------------------------------------------------- /css/reveal-ck.css: -------------------------------------------------------------------------------- 1 | .reveal section img.emoji { 2 | background: none; 3 | border: 0; 4 | box-shadow: none; 5 | margin: 0; 6 | } 7 | -------------------------------------------------------------------------------- /css/theme/beige.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 2 | /** 3 | * Beige theme for reveal.js. 4 | * 5 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 6 | */ 7 | @font-face { 8 | font-family: 'League Gothic'; 9 | src: url("../../lib/font/league_gothic-webfont.eot"); 10 | src: url("../../lib/font/league_gothic-webfont.eot?#iefix") format("embedded-opentype"), url("../../lib/font/league_gothic-webfont.woff") format("woff"), url("../../lib/font/league_gothic-webfont.ttf") format("truetype"), url("../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular") format("svg"); 11 | font-weight: normal; 12 | font-style: normal; } 13 | 14 | /********************************************* 15 | * GLOBAL STYLES 16 | *********************************************/ 17 | body { 18 | background: #f7f2d3; 19 | background: -moz-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); 20 | background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, white), color-stop(100%, #f7f2d3)); 21 | background: -webkit-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); 22 | background: -o-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); 23 | background: -ms-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); 24 | background: radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); 25 | background-color: #f7f3de; } 26 | 27 | .reveal { 28 | font-family: "Lato", sans-serif; 29 | font-size: 36px; 30 | font-weight: normal; 31 | letter-spacing: -0.02em; 32 | color: #333333; } 33 | 34 | ::selection { 35 | color: white; 36 | background: rgba(79, 64, 28, 0.99); 37 | text-shadow: none; } 38 | 39 | /********************************************* 40 | * HEADERS 41 | *********************************************/ 42 | .reveal h1, 43 | .reveal h2, 44 | .reveal h3, 45 | .reveal h4, 46 | .reveal h5, 47 | .reveal h6 { 48 | margin: 0 0 20px 0; 49 | color: #333333; 50 | font-family: "League Gothic", Impact, sans-serif; 51 | line-height: 0.9em; 52 | letter-spacing: 0.02em; 53 | text-transform: uppercase; 54 | text-shadow: none; } 55 | 56 | .reveal h1 { 57 | text-shadow: 0 1px 0 #cccccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbbbbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaaaaa, 0 6px 1px rgba(0, 0, 0, 0.1), 0 0 5px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.3), 0 3px 5px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.25), 0 20px 20px rgba(0, 0, 0, 0.15); } 58 | 59 | /********************************************* 60 | * LINKS 61 | *********************************************/ 62 | .reveal a:not(.image) { 63 | color: #8b743d; 64 | text-decoration: none; 65 | -webkit-transition: color .15s ease; 66 | -moz-transition: color .15s ease; 67 | -ms-transition: color .15s ease; 68 | -o-transition: color .15s ease; 69 | transition: color .15s ease; } 70 | 71 | .reveal a:not(.image):hover { 72 | color: #c0a86e; 73 | text-shadow: none; 74 | border: none; } 75 | 76 | .reveal .roll span:after { 77 | color: #fff; 78 | background: #564826; } 79 | 80 | /********************************************* 81 | * IMAGES 82 | *********************************************/ 83 | .reveal section img { 84 | margin: 15px 0px; 85 | background: rgba(255, 255, 255, 0.12); 86 | border: 4px solid #333333; 87 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 88 | -webkit-transition: all .2s linear; 89 | -moz-transition: all .2s linear; 90 | -ms-transition: all .2s linear; 91 | -o-transition: all .2s linear; 92 | transition: all .2s linear; } 93 | 94 | .reveal a:hover img { 95 | background: rgba(255, 255, 255, 0.2); 96 | border-color: #8b743d; 97 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 98 | 99 | /********************************************* 100 | * NAVIGATION CONTROLS 101 | *********************************************/ 102 | .reveal .controls div.navigate-left, 103 | .reveal .controls div.navigate-left.enabled { 104 | border-right-color: #8b743d; } 105 | 106 | .reveal .controls div.navigate-right, 107 | .reveal .controls div.navigate-right.enabled { 108 | border-left-color: #8b743d; } 109 | 110 | .reveal .controls div.navigate-up, 111 | .reveal .controls div.navigate-up.enabled { 112 | border-bottom-color: #8b743d; } 113 | 114 | .reveal .controls div.navigate-down, 115 | .reveal .controls div.navigate-down.enabled { 116 | border-top-color: #8b743d; } 117 | 118 | .reveal .controls div.navigate-left.enabled:hover { 119 | border-right-color: #c0a86e; } 120 | 121 | .reveal .controls div.navigate-right.enabled:hover { 122 | border-left-color: #c0a86e; } 123 | 124 | .reveal .controls div.navigate-up.enabled:hover { 125 | border-bottom-color: #c0a86e; } 126 | 127 | .reveal .controls div.navigate-down.enabled:hover { 128 | border-top-color: #c0a86e; } 129 | 130 | /********************************************* 131 | * PROGRESS BAR 132 | *********************************************/ 133 | .reveal .progress { 134 | background: rgba(0, 0, 0, 0.2); } 135 | 136 | .reveal .progress span { 137 | background: #8b743d; 138 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 139 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 140 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 141 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 142 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 143 | 144 | /********************************************* 145 | * SLIDE NUMBER 146 | *********************************************/ 147 | .reveal .slide-number { 148 | color: #8b743d; } 149 | -------------------------------------------------------------------------------- /css/theme/default.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 2 | /** 3 | * Default theme for reveal.js. 4 | * 5 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 6 | */ 7 | @font-face { 8 | font-family: 'League Gothic'; 9 | src: url("../../lib/font/league_gothic-webfont.eot"); 10 | src: url("../../lib/font/league_gothic-webfont.eot?#iefix") format("embedded-opentype"), url("../../lib/font/league_gothic-webfont.woff") format("woff"), url("../../lib/font/league_gothic-webfont.ttf") format("truetype"), url("../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular") format("svg"); 11 | font-weight: normal; 12 | font-style: normal; } 13 | 14 | /********************************************* 15 | * GLOBAL STYLES 16 | *********************************************/ 17 | body { 18 | background: #1c1e20; 19 | background: -moz-radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%); 20 | background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #555a5f), color-stop(100%, #1c1e20)); 21 | background: -webkit-radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%); 22 | background: -o-radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%); 23 | background: -ms-radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%); 24 | background: radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%); 25 | background-color: #2b2b2b; } 26 | 27 | .reveal { 28 | font-family: "Lato", sans-serif; 29 | font-size: 36px; 30 | font-weight: normal; 31 | letter-spacing: -0.02em; 32 | color: #eeeeee; } 33 | 34 | ::selection { 35 | color: white; 36 | background: #ff5e99; 37 | text-shadow: none; } 38 | 39 | /********************************************* 40 | * HEADERS 41 | *********************************************/ 42 | .reveal h1, 43 | .reveal h2, 44 | .reveal h3, 45 | .reveal h4, 46 | .reveal h5, 47 | .reveal h6 { 48 | margin: 0 0 20px 0; 49 | color: #eeeeee; 50 | font-family: "League Gothic", Impact, sans-serif; 51 | line-height: 0.9em; 52 | letter-spacing: 0.02em; 53 | text-transform: uppercase; 54 | text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); } 55 | 56 | .reveal h1 { 57 | text-shadow: 0 1px 0 #cccccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbbbbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaaaaa, 0 6px 1px rgba(0, 0, 0, 0.1), 0 0 5px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.3), 0 3px 5px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.25), 0 20px 20px rgba(0, 0, 0, 0.15); } 58 | 59 | /********************************************* 60 | * LINKS 61 | *********************************************/ 62 | .reveal a:not(.image) { 63 | color: #13daec; 64 | text-decoration: none; 65 | -webkit-transition: color .15s ease; 66 | -moz-transition: color .15s ease; 67 | -ms-transition: color .15s ease; 68 | -o-transition: color .15s ease; 69 | transition: color .15s ease; } 70 | 71 | .reveal a:not(.image):hover { 72 | color: #71e9f4; 73 | text-shadow: none; 74 | border: none; } 75 | 76 | .reveal .roll span:after { 77 | color: #fff; 78 | background: #0d99a5; } 79 | 80 | /********************************************* 81 | * IMAGES 82 | *********************************************/ 83 | .reveal section img { 84 | margin: 15px 0px; 85 | background: rgba(255, 255, 255, 0.12); 86 | border: 4px solid #eeeeee; 87 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 88 | -webkit-transition: all .2s linear; 89 | -moz-transition: all .2s linear; 90 | -ms-transition: all .2s linear; 91 | -o-transition: all .2s linear; 92 | transition: all .2s linear; } 93 | 94 | .reveal a:hover img { 95 | background: rgba(255, 255, 255, 0.2); 96 | border-color: #13daec; 97 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 98 | 99 | /********************************************* 100 | * NAVIGATION CONTROLS 101 | *********************************************/ 102 | .reveal .controls div.navigate-left, 103 | .reveal .controls div.navigate-left.enabled { 104 | border-right-color: #13daec; } 105 | 106 | .reveal .controls div.navigate-right, 107 | .reveal .controls div.navigate-right.enabled { 108 | border-left-color: #13daec; } 109 | 110 | .reveal .controls div.navigate-up, 111 | .reveal .controls div.navigate-up.enabled { 112 | border-bottom-color: #13daec; } 113 | 114 | .reveal .controls div.navigate-down, 115 | .reveal .controls div.navigate-down.enabled { 116 | border-top-color: #13daec; } 117 | 118 | .reveal .controls div.navigate-left.enabled:hover { 119 | border-right-color: #71e9f4; } 120 | 121 | .reveal .controls div.navigate-right.enabled:hover { 122 | border-left-color: #71e9f4; } 123 | 124 | .reveal .controls div.navigate-up.enabled:hover { 125 | border-bottom-color: #71e9f4; } 126 | 127 | .reveal .controls div.navigate-down.enabled:hover { 128 | border-top-color: #71e9f4; } 129 | 130 | /********************************************* 131 | * PROGRESS BAR 132 | *********************************************/ 133 | .reveal .progress { 134 | background: rgba(0, 0, 0, 0.2); } 135 | 136 | .reveal .progress span { 137 | background: #13daec; 138 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 139 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 140 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 141 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 142 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 143 | 144 | /********************************************* 145 | * SLIDE NUMBER 146 | *********************************************/ 147 | .reveal .slide-number { 148 | color: #13daec; } 149 | -------------------------------------------------------------------------------- /css/theme/moon.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 2 | /** 3 | * Solarized Dark theme for reveal.js. 4 | * Author: Achim Staebler 5 | */ 6 | @font-face { 7 | font-family: 'League Gothic'; 8 | src: url("../../lib/font/league_gothic-webfont.eot"); 9 | src: url("../../lib/font/league_gothic-webfont.eot?#iefix") format("embedded-opentype"), url("../../lib/font/league_gothic-webfont.woff") format("woff"), url("../../lib/font/league_gothic-webfont.ttf") format("truetype"), url("../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular") format("svg"); 10 | font-weight: normal; 11 | font-style: normal; } 12 | 13 | /** 14 | * Solarized colors by Ethan Schoonover 15 | */ 16 | html * { 17 | color-profile: sRGB; 18 | rendering-intent: auto; } 19 | 20 | /********************************************* 21 | * GLOBAL STYLES 22 | *********************************************/ 23 | body { 24 | background: #002b36; 25 | background-color: #002b36; } 26 | 27 | .reveal { 28 | font-family: "Lato", sans-serif; 29 | font-size: 36px; 30 | font-weight: normal; 31 | letter-spacing: -0.02em; 32 | color: #93a1a1; } 33 | 34 | ::selection { 35 | color: white; 36 | background: #d33682; 37 | text-shadow: none; } 38 | 39 | /********************************************* 40 | * HEADERS 41 | *********************************************/ 42 | .reveal h1, 43 | .reveal h2, 44 | .reveal h3, 45 | .reveal h4, 46 | .reveal h5, 47 | .reveal h6 { 48 | margin: 0 0 20px 0; 49 | color: #eee8d5; 50 | font-family: "League Gothic", Impact, sans-serif; 51 | line-height: 0.9em; 52 | letter-spacing: 0.02em; 53 | text-transform: uppercase; 54 | text-shadow: none; } 55 | 56 | .reveal h1 { 57 | text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); } 58 | 59 | /********************************************* 60 | * LINKS 61 | *********************************************/ 62 | .reveal a:not(.image) { 63 | color: #268bd2; 64 | text-decoration: none; 65 | -webkit-transition: color .15s ease; 66 | -moz-transition: color .15s ease; 67 | -ms-transition: color .15s ease; 68 | -o-transition: color .15s ease; 69 | transition: color .15s ease; } 70 | 71 | .reveal a:not(.image):hover { 72 | color: #78b9e6; 73 | text-shadow: none; 74 | border: none; } 75 | 76 | .reveal .roll span:after { 77 | color: #fff; 78 | background: #1a6091; } 79 | 80 | /********************************************* 81 | * IMAGES 82 | *********************************************/ 83 | .reveal section img { 84 | margin: 15px 0px; 85 | background: rgba(255, 255, 255, 0.12); 86 | border: 4px solid #93a1a1; 87 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 88 | -webkit-transition: all .2s linear; 89 | -moz-transition: all .2s linear; 90 | -ms-transition: all .2s linear; 91 | -o-transition: all .2s linear; 92 | transition: all .2s linear; } 93 | 94 | .reveal a:hover img { 95 | background: rgba(255, 255, 255, 0.2); 96 | border-color: #268bd2; 97 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 98 | 99 | /********************************************* 100 | * NAVIGATION CONTROLS 101 | *********************************************/ 102 | .reveal .controls div.navigate-left, 103 | .reveal .controls div.navigate-left.enabled { 104 | border-right-color: #268bd2; } 105 | 106 | .reveal .controls div.navigate-right, 107 | .reveal .controls div.navigate-right.enabled { 108 | border-left-color: #268bd2; } 109 | 110 | .reveal .controls div.navigate-up, 111 | .reveal .controls div.navigate-up.enabled { 112 | border-bottom-color: #268bd2; } 113 | 114 | .reveal .controls div.navigate-down, 115 | .reveal .controls div.navigate-down.enabled { 116 | border-top-color: #268bd2; } 117 | 118 | .reveal .controls div.navigate-left.enabled:hover { 119 | border-right-color: #78b9e6; } 120 | 121 | .reveal .controls div.navigate-right.enabled:hover { 122 | border-left-color: #78b9e6; } 123 | 124 | .reveal .controls div.navigate-up.enabled:hover { 125 | border-bottom-color: #78b9e6; } 126 | 127 | .reveal .controls div.navigate-down.enabled:hover { 128 | border-top-color: #78b9e6; } 129 | 130 | /********************************************* 131 | * PROGRESS BAR 132 | *********************************************/ 133 | .reveal .progress { 134 | background: rgba(0, 0, 0, 0.2); } 135 | 136 | .reveal .progress span { 137 | background: #268bd2; 138 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 139 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 140 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 141 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 142 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 143 | 144 | /********************************************* 145 | * SLIDE NUMBER 146 | *********************************************/ 147 | .reveal .slide-number { 148 | color: #268bd2; } 149 | -------------------------------------------------------------------------------- /css/theme/night.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Montserrat:700); 2 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic); 3 | /** 4 | * Black theme for reveal.js. 5 | * 6 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | /********************************************* 9 | * GLOBAL STYLES 10 | *********************************************/ 11 | body { 12 | background: #111111; 13 | background-color: #111111; } 14 | 15 | .reveal { 16 | font-family: "Open Sans", sans-serif; 17 | font-size: 30px; 18 | font-weight: normal; 19 | letter-spacing: -0.02em; 20 | color: #eeeeee; } 21 | 22 | ::selection { 23 | color: white; 24 | background: #e7ad52; 25 | text-shadow: none; } 26 | 27 | /********************************************* 28 | * HEADERS 29 | *********************************************/ 30 | .reveal h1, 31 | .reveal h2, 32 | .reveal h3, 33 | .reveal h4, 34 | .reveal h5, 35 | .reveal h6 { 36 | margin: 0 0 20px 0; 37 | color: #eeeeee; 38 | font-family: "Montserrat", Impact, sans-serif; 39 | line-height: 0.9em; 40 | letter-spacing: -0.03em; 41 | text-transform: none; 42 | text-shadow: none; } 43 | 44 | .reveal h1 { 45 | text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); } 46 | 47 | /********************************************* 48 | * LINKS 49 | *********************************************/ 50 | .reveal a:not(.image) { 51 | color: #e7ad52; 52 | text-decoration: none; 53 | -webkit-transition: color .15s ease; 54 | -moz-transition: color .15s ease; 55 | -ms-transition: color .15s ease; 56 | -o-transition: color .15s ease; 57 | transition: color .15s ease; } 58 | 59 | .reveal a:not(.image):hover { 60 | color: #f3d7ac; 61 | text-shadow: none; 62 | border: none; } 63 | 64 | .reveal .roll span:after { 65 | color: #fff; 66 | background: #d08a1d; } 67 | 68 | /********************************************* 69 | * IMAGES 70 | *********************************************/ 71 | .reveal section img { 72 | margin: 15px 0px; 73 | background: rgba(255, 255, 255, 0.12); 74 | border: 4px solid #eeeeee; 75 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 76 | -webkit-transition: all .2s linear; 77 | -moz-transition: all .2s linear; 78 | -ms-transition: all .2s linear; 79 | -o-transition: all .2s linear; 80 | transition: all .2s linear; } 81 | 82 | .reveal a:hover img { 83 | background: rgba(255, 255, 255, 0.2); 84 | border-color: #e7ad52; 85 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 86 | 87 | /********************************************* 88 | * NAVIGATION CONTROLS 89 | *********************************************/ 90 | .reveal .controls div.navigate-left, 91 | .reveal .controls div.navigate-left.enabled { 92 | border-right-color: #e7ad52; } 93 | 94 | .reveal .controls div.navigate-right, 95 | .reveal .controls div.navigate-right.enabled { 96 | border-left-color: #e7ad52; } 97 | 98 | .reveal .controls div.navigate-up, 99 | .reveal .controls div.navigate-up.enabled { 100 | border-bottom-color: #e7ad52; } 101 | 102 | .reveal .controls div.navigate-down, 103 | .reveal .controls div.navigate-down.enabled { 104 | border-top-color: #e7ad52; } 105 | 106 | .reveal .controls div.navigate-left.enabled:hover { 107 | border-right-color: #f3d7ac; } 108 | 109 | .reveal .controls div.navigate-right.enabled:hover { 110 | border-left-color: #f3d7ac; } 111 | 112 | .reveal .controls div.navigate-up.enabled:hover { 113 | border-bottom-color: #f3d7ac; } 114 | 115 | .reveal .controls div.navigate-down.enabled:hover { 116 | border-top-color: #f3d7ac; } 117 | 118 | /********************************************* 119 | * PROGRESS BAR 120 | *********************************************/ 121 | .reveal .progress { 122 | background: rgba(0, 0, 0, 0.2); } 123 | 124 | .reveal .progress span { 125 | background: #e7ad52; 126 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 127 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 128 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 129 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 130 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 131 | 132 | /********************************************* 133 | * SLIDE NUMBER 134 | *********************************************/ 135 | .reveal .slide-number { 136 | color: #e7ad52; } 137 | -------------------------------------------------------------------------------- /css/theme/serif.css: -------------------------------------------------------------------------------- 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 | .reveal a:not(.image) { 8 | line-height: 1.3em; } 9 | 10 | /********************************************* 11 | * GLOBAL STYLES 12 | *********************************************/ 13 | body { 14 | background: #f0f1eb; 15 | background-color: #f0f1eb; } 16 | 17 | .reveal { 18 | font-family: "Palatino Linotype", "Book Antiqua", Palatino, FreeSerif, serif; 19 | font-size: 36px; 20 | font-weight: normal; 21 | letter-spacing: -0.02em; 22 | color: black; } 23 | 24 | ::selection { 25 | color: white; 26 | background: #26351c; 27 | text-shadow: none; } 28 | 29 | /********************************************* 30 | * HEADERS 31 | *********************************************/ 32 | .reveal h1, 33 | .reveal h2, 34 | .reveal h3, 35 | .reveal h4, 36 | .reveal h5, 37 | .reveal h6 { 38 | margin: 0 0 20px 0; 39 | color: #383d3d; 40 | font-family: "Palatino Linotype", "Book Antiqua", Palatino, FreeSerif, serif; 41 | line-height: 0.9em; 42 | letter-spacing: 0.02em; 43 | text-transform: none; 44 | text-shadow: none; } 45 | 46 | .reveal h1 { 47 | text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); } 48 | 49 | /********************************************* 50 | * LINKS 51 | *********************************************/ 52 | .reveal a:not(.image) { 53 | color: #51483d; 54 | text-decoration: none; 55 | -webkit-transition: color .15s ease; 56 | -moz-transition: color .15s ease; 57 | -ms-transition: color .15s ease; 58 | -o-transition: color .15s ease; 59 | transition: color .15s ease; } 60 | 61 | .reveal a:not(.image):hover { 62 | color: #8b7c69; 63 | text-shadow: none; 64 | border: none; } 65 | 66 | .reveal .roll span:after { 67 | color: #fff; 68 | background: #25211c; } 69 | 70 | /********************************************* 71 | * IMAGES 72 | *********************************************/ 73 | .reveal section img { 74 | margin: 15px 0px; 75 | background: rgba(255, 255, 255, 0.12); 76 | border: 4px solid black; 77 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 78 | -webkit-transition: all .2s linear; 79 | -moz-transition: all .2s linear; 80 | -ms-transition: all .2s linear; 81 | -o-transition: all .2s linear; 82 | transition: all .2s linear; } 83 | 84 | .reveal a:hover img { 85 | background: rgba(255, 255, 255, 0.2); 86 | border-color: #51483d; 87 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 88 | 89 | /********************************************* 90 | * NAVIGATION CONTROLS 91 | *********************************************/ 92 | .reveal .controls div.navigate-left, 93 | .reveal .controls div.navigate-left.enabled { 94 | border-right-color: #51483d; } 95 | 96 | .reveal .controls div.navigate-right, 97 | .reveal .controls div.navigate-right.enabled { 98 | border-left-color: #51483d; } 99 | 100 | .reveal .controls div.navigate-up, 101 | .reveal .controls div.navigate-up.enabled { 102 | border-bottom-color: #51483d; } 103 | 104 | .reveal .controls div.navigate-down, 105 | .reveal .controls div.navigate-down.enabled { 106 | border-top-color: #51483d; } 107 | 108 | .reveal .controls div.navigate-left.enabled:hover { 109 | border-right-color: #8b7c69; } 110 | 111 | .reveal .controls div.navigate-right.enabled:hover { 112 | border-left-color: #8b7c69; } 113 | 114 | .reveal .controls div.navigate-up.enabled:hover { 115 | border-bottom-color: #8b7c69; } 116 | 117 | .reveal .controls div.navigate-down.enabled:hover { 118 | border-top-color: #8b7c69; } 119 | 120 | /********************************************* 121 | * PROGRESS BAR 122 | *********************************************/ 123 | .reveal .progress { 124 | background: rgba(0, 0, 0, 0.2); } 125 | 126 | .reveal .progress span { 127 | background: #51483d; 128 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 129 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 130 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 131 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 132 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 133 | 134 | /********************************************* 135 | * SLIDE NUMBER 136 | *********************************************/ 137 | .reveal .slide-number { 138 | color: #51483d; } 139 | -------------------------------------------------------------------------------- /css/theme/simple.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700); 2 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 3 | /** 4 | * A simple theme for reveal.js presentations, similar 5 | * to the default theme. The accent color is darkblue. 6 | * 7 | * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed. 8 | * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 9 | */ 10 | /********************************************* 11 | * GLOBAL STYLES 12 | *********************************************/ 13 | body { 14 | background: white; 15 | background-color: white; } 16 | 17 | .reveal { 18 | font-family: "Lato", sans-serif; 19 | font-size: 36px; 20 | font-weight: normal; 21 | letter-spacing: -0.02em; 22 | color: black; } 23 | 24 | ::selection { 25 | color: white; 26 | background: rgba(0, 0, 0, 0.99); 27 | text-shadow: none; } 28 | 29 | /********************************************* 30 | * HEADERS 31 | *********************************************/ 32 | .reveal h1, 33 | .reveal h2, 34 | .reveal h3, 35 | .reveal h4, 36 | .reveal h5, 37 | .reveal h6 { 38 | margin: 0 0 20px 0; 39 | color: black; 40 | font-family: "News Cycle", Impact, sans-serif; 41 | line-height: 0.9em; 42 | letter-spacing: 0.02em; 43 | text-transform: none; 44 | text-shadow: none; } 45 | 46 | .reveal h1 { 47 | text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); } 48 | 49 | /********************************************* 50 | * LINKS 51 | *********************************************/ 52 | .reveal a:not(.image) { 53 | color: darkblue; 54 | text-decoration: none; 55 | -webkit-transition: color .15s ease; 56 | -moz-transition: color .15s ease; 57 | -ms-transition: color .15s ease; 58 | -o-transition: color .15s ease; 59 | transition: color .15s ease; } 60 | 61 | .reveal a:not(.image):hover { 62 | color: #0000f1; 63 | text-shadow: none; 64 | border: none; } 65 | 66 | .reveal .roll span:after { 67 | color: #fff; 68 | background: #00003f; } 69 | 70 | /********************************************* 71 | * IMAGES 72 | *********************************************/ 73 | .reveal section img { 74 | margin: 15px 0px; 75 | background: rgba(255, 255, 255, 0.12); 76 | border: 4px solid black; 77 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 78 | -webkit-transition: all .2s linear; 79 | -moz-transition: all .2s linear; 80 | -ms-transition: all .2s linear; 81 | -o-transition: all .2s linear; 82 | transition: all .2s linear; } 83 | 84 | .reveal a:hover img { 85 | background: rgba(255, 255, 255, 0.2); 86 | border-color: darkblue; 87 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 88 | 89 | /********************************************* 90 | * NAVIGATION CONTROLS 91 | *********************************************/ 92 | .reveal .controls div.navigate-left, 93 | .reveal .controls div.navigate-left.enabled { 94 | border-right-color: darkblue; } 95 | 96 | .reveal .controls div.navigate-right, 97 | .reveal .controls div.navigate-right.enabled { 98 | border-left-color: darkblue; } 99 | 100 | .reveal .controls div.navigate-up, 101 | .reveal .controls div.navigate-up.enabled { 102 | border-bottom-color: darkblue; } 103 | 104 | .reveal .controls div.navigate-down, 105 | .reveal .controls div.navigate-down.enabled { 106 | border-top-color: darkblue; } 107 | 108 | .reveal .controls div.navigate-left.enabled:hover { 109 | border-right-color: #0000f1; } 110 | 111 | .reveal .controls div.navigate-right.enabled:hover { 112 | border-left-color: #0000f1; } 113 | 114 | .reveal .controls div.navigate-up.enabled:hover { 115 | border-bottom-color: #0000f1; } 116 | 117 | .reveal .controls div.navigate-down.enabled:hover { 118 | border-top-color: #0000f1; } 119 | 120 | /********************************************* 121 | * PROGRESS BAR 122 | *********************************************/ 123 | .reveal .progress { 124 | background: rgba(0, 0, 0, 0.2); } 125 | 126 | .reveal .progress span { 127 | background: darkblue; 128 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 129 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 130 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 131 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 132 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 133 | 134 | /********************************************* 135 | * SLIDE NUMBER 136 | *********************************************/ 137 | .reveal .slide-number { 138 | color: darkblue; } 139 | -------------------------------------------------------------------------------- /css/theme/sky.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic); 2 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700); 3 | /** 4 | * Sky theme for reveal.js. 5 | * 6 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | .reveal a:not(.image) { 9 | line-height: 1.3em; } 10 | 11 | /********************************************* 12 | * GLOBAL STYLES 13 | *********************************************/ 14 | body { 15 | background: #add9e4; 16 | background: -moz-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); 17 | background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #f7fbfc), color-stop(100%, #add9e4)); 18 | background: -webkit-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); 19 | background: -o-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); 20 | background: -ms-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); 21 | background: radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); 22 | background-color: #f7fbfc; } 23 | 24 | .reveal { 25 | font-family: "Open Sans", sans-serif; 26 | font-size: 36px; 27 | font-weight: normal; 28 | letter-spacing: -0.02em; 29 | color: #333333; } 30 | 31 | ::selection { 32 | color: white; 33 | background: #134674; 34 | text-shadow: none; } 35 | 36 | /********************************************* 37 | * HEADERS 38 | *********************************************/ 39 | .reveal h1, 40 | .reveal h2, 41 | .reveal h3, 42 | .reveal h4, 43 | .reveal h5, 44 | .reveal h6 { 45 | margin: 0 0 20px 0; 46 | color: #333333; 47 | font-family: "Quicksand", sans-serif; 48 | line-height: 0.9em; 49 | letter-spacing: -0.08em; 50 | text-transform: uppercase; 51 | text-shadow: none; } 52 | 53 | .reveal h1 { 54 | text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); } 55 | 56 | /********************************************* 57 | * LINKS 58 | *********************************************/ 59 | .reveal a:not(.image) { 60 | color: #3b759e; 61 | text-decoration: none; 62 | -webkit-transition: color .15s ease; 63 | -moz-transition: color .15s ease; 64 | -ms-transition: color .15s ease; 65 | -o-transition: color .15s ease; 66 | transition: color .15s ease; } 67 | 68 | .reveal a:not(.image):hover { 69 | color: #74a7cb; 70 | text-shadow: none; 71 | border: none; } 72 | 73 | .reveal .roll span:after { 74 | color: #fff; 75 | background: #264c66; } 76 | 77 | /********************************************* 78 | * IMAGES 79 | *********************************************/ 80 | .reveal section img { 81 | margin: 15px 0px; 82 | background: rgba(255, 255, 255, 0.12); 83 | border: 4px solid #333333; 84 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 85 | -webkit-transition: all .2s linear; 86 | -moz-transition: all .2s linear; 87 | -ms-transition: all .2s linear; 88 | -o-transition: all .2s linear; 89 | transition: all .2s linear; } 90 | 91 | .reveal a:hover img { 92 | background: rgba(255, 255, 255, 0.2); 93 | border-color: #3b759e; 94 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 95 | 96 | /********************************************* 97 | * NAVIGATION CONTROLS 98 | *********************************************/ 99 | .reveal .controls div.navigate-left, 100 | .reveal .controls div.navigate-left.enabled { 101 | border-right-color: #3b759e; } 102 | 103 | .reveal .controls div.navigate-right, 104 | .reveal .controls div.navigate-right.enabled { 105 | border-left-color: #3b759e; } 106 | 107 | .reveal .controls div.navigate-up, 108 | .reveal .controls div.navigate-up.enabled { 109 | border-bottom-color: #3b759e; } 110 | 111 | .reveal .controls div.navigate-down, 112 | .reveal .controls div.navigate-down.enabled { 113 | border-top-color: #3b759e; } 114 | 115 | .reveal .controls div.navigate-left.enabled:hover { 116 | border-right-color: #74a7cb; } 117 | 118 | .reveal .controls div.navigate-right.enabled:hover { 119 | border-left-color: #74a7cb; } 120 | 121 | .reveal .controls div.navigate-up.enabled:hover { 122 | border-bottom-color: #74a7cb; } 123 | 124 | .reveal .controls div.navigate-down.enabled:hover { 125 | border-top-color: #74a7cb; } 126 | 127 | /********************************************* 128 | * PROGRESS BAR 129 | *********************************************/ 130 | .reveal .progress { 131 | background: rgba(0, 0, 0, 0.2); } 132 | 133 | .reveal .progress span { 134 | background: #3b759e; 135 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 136 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 137 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 138 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 139 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 140 | 141 | /********************************************* 142 | * SLIDE NUMBER 143 | *********************************************/ 144 | .reveal .slide-number { 145 | color: #3b759e; } 146 | -------------------------------------------------------------------------------- /css/theme/solarized.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 2 | /** 3 | * Solarized Light theme for reveal.js. 4 | * Author: Achim Staebler 5 | */ 6 | @font-face { 7 | font-family: 'League Gothic'; 8 | src: url("../../lib/font/league_gothic-webfont.eot"); 9 | src: url("../../lib/font/league_gothic-webfont.eot?#iefix") format("embedded-opentype"), url("../../lib/font/league_gothic-webfont.woff") format("woff"), url("../../lib/font/league_gothic-webfont.ttf") format("truetype"), url("../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular") format("svg"); 10 | font-weight: normal; 11 | font-style: normal; } 12 | 13 | /** 14 | * Solarized colors by Ethan Schoonover 15 | */ 16 | html * { 17 | color-profile: sRGB; 18 | rendering-intent: auto; } 19 | 20 | /********************************************* 21 | * GLOBAL STYLES 22 | *********************************************/ 23 | body { 24 | background: #fdf6e3; 25 | background-color: #fdf6e3; } 26 | 27 | .reveal { 28 | font-family: "Lato", sans-serif; 29 | font-size: 36px; 30 | font-weight: normal; 31 | letter-spacing: -0.02em; 32 | color: #657b83; } 33 | 34 | ::selection { 35 | color: white; 36 | background: #d33682; 37 | text-shadow: none; } 38 | 39 | /********************************************* 40 | * HEADERS 41 | *********************************************/ 42 | .reveal h1, 43 | .reveal h2, 44 | .reveal h3, 45 | .reveal h4, 46 | .reveal h5, 47 | .reveal h6 { 48 | margin: 0 0 20px 0; 49 | color: #586e75; 50 | font-family: "League Gothic", Impact, sans-serif; 51 | line-height: 0.9em; 52 | letter-spacing: 0.02em; 53 | text-transform: uppercase; 54 | text-shadow: none; } 55 | 56 | .reveal h1 { 57 | text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); } 58 | 59 | /********************************************* 60 | * LINKS 61 | *********************************************/ 62 | .reveal a:not(.image) { 63 | color: #268bd2; 64 | text-decoration: none; 65 | -webkit-transition: color .15s ease; 66 | -moz-transition: color .15s ease; 67 | -ms-transition: color .15s ease; 68 | -o-transition: color .15s ease; 69 | transition: color .15s ease; } 70 | 71 | .reveal a:not(.image):hover { 72 | color: #78b9e6; 73 | text-shadow: none; 74 | border: none; } 75 | 76 | .reveal .roll span:after { 77 | color: #fff; 78 | background: #1a6091; } 79 | 80 | /********************************************* 81 | * IMAGES 82 | *********************************************/ 83 | .reveal section img { 84 | margin: 15px 0px; 85 | background: rgba(255, 255, 255, 0.12); 86 | border: 4px solid #657b83; 87 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 88 | -webkit-transition: all .2s linear; 89 | -moz-transition: all .2s linear; 90 | -ms-transition: all .2s linear; 91 | -o-transition: all .2s linear; 92 | transition: all .2s linear; } 93 | 94 | .reveal a:hover img { 95 | background: rgba(255, 255, 255, 0.2); 96 | border-color: #268bd2; 97 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 98 | 99 | /********************************************* 100 | * NAVIGATION CONTROLS 101 | *********************************************/ 102 | .reveal .controls div.navigate-left, 103 | .reveal .controls div.navigate-left.enabled { 104 | border-right-color: #268bd2; } 105 | 106 | .reveal .controls div.navigate-right, 107 | .reveal .controls div.navigate-right.enabled { 108 | border-left-color: #268bd2; } 109 | 110 | .reveal .controls div.navigate-up, 111 | .reveal .controls div.navigate-up.enabled { 112 | border-bottom-color: #268bd2; } 113 | 114 | .reveal .controls div.navigate-down, 115 | .reveal .controls div.navigate-down.enabled { 116 | border-top-color: #268bd2; } 117 | 118 | .reveal .controls div.navigate-left.enabled:hover { 119 | border-right-color: #78b9e6; } 120 | 121 | .reveal .controls div.navigate-right.enabled:hover { 122 | border-left-color: #78b9e6; } 123 | 124 | .reveal .controls div.navigate-up.enabled:hover { 125 | border-bottom-color: #78b9e6; } 126 | 127 | .reveal .controls div.navigate-down.enabled:hover { 128 | border-top-color: #78b9e6; } 129 | 130 | /********************************************* 131 | * PROGRESS BAR 132 | *********************************************/ 133 | .reveal .progress { 134 | background: rgba(0, 0, 0, 0.2); } 135 | 136 | .reveal .progress span { 137 | background: #268bd2; 138 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 139 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 140 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 141 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 142 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 143 | 144 | /********************************************* 145 | * SLIDE NUMBER 146 | *********************************************/ 147 | .reveal .slide-number { 148 | color: #268bd2; } 149 | -------------------------------------------------------------------------------- /images/java-collections.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/images/java-collections.png -------------------------------------------------------------------------------- /lib/css/zenburn.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Zenburn style from voldmar.ru (c) Vladimir Epifanov 4 | based on dark.css by Ivan Sagalaev 5 | 6 | */ 7 | 8 | pre code { 9 | display: block; padding: 0.5em; 10 | background: #3F3F3F; 11 | color: #DCDCDC; 12 | } 13 | 14 | pre .keyword, 15 | pre .tag, 16 | pre .css .class, 17 | pre .css .id, 18 | pre .lisp .title, 19 | pre .nginx .title, 20 | pre .request, 21 | pre .status, 22 | pre .clojure .attribute { 23 | color: #E3CEAB; 24 | } 25 | 26 | pre .django .template_tag, 27 | pre .django .variable, 28 | pre .django .filter .argument { 29 | color: #DCDCDC; 30 | } 31 | 32 | pre .number, 33 | pre .date { 34 | color: #8CD0D3; 35 | } 36 | 37 | pre .dos .envvar, 38 | pre .dos .stream, 39 | pre .variable, 40 | pre .apache .sqbracket { 41 | color: #EFDCBC; 42 | } 43 | 44 | pre .dos .flow, 45 | pre .diff .change, 46 | pre .python .exception, 47 | pre .python .built_in, 48 | pre .literal, 49 | pre .tex .special { 50 | color: #EFEFAF; 51 | } 52 | 53 | pre .diff .chunk, 54 | pre .subst { 55 | color: #8F8F8F; 56 | } 57 | 58 | pre .dos .keyword, 59 | pre .python .decorator, 60 | pre .title, 61 | pre .haskell .type, 62 | pre .diff .header, 63 | pre .ruby .class .parent, 64 | pre .apache .tag, 65 | pre .nginx .built_in, 66 | pre .tex .command, 67 | pre .prompt { 68 | color: #efef8f; 69 | } 70 | 71 | pre .dos .winutils, 72 | pre .ruby .symbol, 73 | pre .ruby .symbol .string, 74 | pre .ruby .string { 75 | color: #DCA3A3; 76 | } 77 | 78 | pre .diff .deletion, 79 | pre .string, 80 | pre .tag .value, 81 | pre .preprocessor, 82 | pre .built_in, 83 | pre .sql .aggregate, 84 | pre .javadoc, 85 | pre .smalltalk .class, 86 | pre .smalltalk .localvars, 87 | pre .smalltalk .array, 88 | pre .css .rules .value, 89 | pre .attr_selector, 90 | pre .pseudo, 91 | pre .apache .cbracket, 92 | pre .tex .formula { 93 | color: #CC9393; 94 | } 95 | 96 | pre .shebang, 97 | pre .diff .addition, 98 | pre .comment, 99 | pre .java .annotation, 100 | pre .template_comment, 101 | pre .pi, 102 | pre .doctype { 103 | color: #7F9F7F; 104 | } 105 | 106 | pre .coffeescript .javascript, 107 | pre .javascript .xml, 108 | pre .tex .formula, 109 | pre .xml .javascript, 110 | pre .xml .vbscript, 111 | pre .xml .css, 112 | pre .xml .cdata { 113 | opacity: 0.5; 114 | } -------------------------------------------------------------------------------- /lib/font/league_gothic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/lib/font/league_gothic-webfont.eot -------------------------------------------------------------------------------- /lib/font/league_gothic-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/lib/font/league_gothic-webfont.ttf -------------------------------------------------------------------------------- /lib/font/league_gothic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/lib/font/league_gothic-webfont.woff -------------------------------------------------------------------------------- /lib/font/league_gothic_license: -------------------------------------------------------------------------------- 1 | SIL Open Font License (OFL) 2 | http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL 3 | -------------------------------------------------------------------------------- /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 3 | Copyright Tero Piirainen (tipiirai) 4 | License MIT / http://bit.ly/mit-license 5 | Version 0.96 6 | 7 | http://headjs.com 8 | */(function(a){function z(){d||(d=!0,s(e,function(a){p(a)}))}function y(c,d){var e=a.createElement("script");e.type="text/"+(c.type||"javascript"),e.src=c.src||c,e.async=!1,e.onreadystatechange=e.onload=function(){var a=e.readyState;!d.done&&(!a||/loaded|complete/.test(a))&&(d.done=!0,d())},(a.body||b).appendChild(e)}function x(a,b){if(a.state==o)return b&&b();if(a.state==n)return k.ready(a.name,b);if(a.state==m)return a.onpreload.push(function(){x(a,b)});a.state=n,y(a.url,function(){a.state=o,b&&b(),s(g[a.name],function(a){p(a)}),u()&&d&&s(g.ALL,function(a){p(a)})})}function w(a,b){a.state===undefined&&(a.state=m,a.onpreload=[],y({src:a.url,type:"cache"},function(){v(a)}))}function v(a){a.state=l,s(a.onpreload,function(a){a.call()})}function u(a){a=a||h;var b;for(var c in a){if(a.hasOwnProperty(c)&&a[c].state!=o)return!1;b=!0}return b}function t(a){return Object.prototype.toString.call(a)=="[object Function]"}function s(a,b){if(!!a){typeof a=="object"&&(a=[].slice.call(a));for(var c=0;c 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Markdown Demo 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 | 22 |
23 | 24 | 25 |
26 | 36 |
37 | 38 | 39 |
40 | 54 |
55 | 56 | 57 |
58 | 69 |
70 | 71 | 72 |
73 | 77 |
78 | 79 | 80 |
81 | 86 |
87 | 88 | 89 |
90 | 100 |
101 | 102 |
103 |
104 | 105 | 106 | 107 | 108 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /plugin/multiplex/client.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var multiplex = Reveal.getConfig().multiplex; 3 | var socketId = multiplex.id; 4 | var socket = io.connect(multiplex.url); 5 | 6 | socket.on(multiplex.id, function(data) { 7 | // ignore data from sockets that aren't ours 8 | if (data.socketId !== socketId) { return; } 9 | if( window.location.host === 'localhost:1947' ) return; 10 | 11 | Reveal.slide(data.indexh, data.indexv, data.indexf, 'remote'); 12 | }); 13 | }()); 14 | -------------------------------------------------------------------------------- /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 ); -------------------------------------------------------------------------------- /plugin/multiplex/master.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | // Don't emit events from inside of notes windows 3 | if ( window.location.search.match( /receiver/gi ) ) { return; } 4 | 5 | var multiplex = Reveal.getConfig().multiplex; 6 | 7 | var socket = io.connect(multiplex.url); 8 | 9 | var notify = function( slideElement, indexh, indexv, origin ) { 10 | if( typeof origin === 'undefined' && origin !== 'remote' ) { 11 | var nextindexh; 12 | var nextindexv; 13 | 14 | var fragmentindex = Reveal.getIndices().f; 15 | if (typeof fragmentindex == 'undefined') { 16 | fragmentindex = 0; 17 | } 18 | 19 | if (slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION') { 20 | nextindexh = indexh; 21 | nextindexv = indexv + 1; 22 | } else { 23 | nextindexh = indexh + 1; 24 | nextindexv = 0; 25 | } 26 | 27 | var slideData = { 28 | indexh : indexh, 29 | indexv : indexv, 30 | indexf : fragmentindex, 31 | nextindexh : nextindexh, 32 | nextindexv : nextindexv, 33 | secret: multiplex.secret, 34 | socketId : multiplex.id 35 | }; 36 | 37 | socket.emit('slidechanged', slideData); 38 | } 39 | } 40 | 41 | Reveal.addEventListener( 'slidechanged', function( event ) { 42 | notify( event.currentSlide, event.indexh, event.indexv, event.origin ); 43 | } ); 44 | 45 | var fragmentNotify = function( event ) { 46 | notify( Reveal.getCurrentSlide(), Reveal.getIndices().h, Reveal.getIndices().v, event.origin ); 47 | }; 48 | 49 | Reveal.addEventListener( 'fragmentshown', fragmentNotify ); 50 | Reveal.addEventListener( 'fragmenthidden', fragmentNotify ); 51 | }()); -------------------------------------------------------------------------------- /plugin/notes-server/client.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | // don't emit events from inside the previews themselves 3 | if ( window.location.search.match( /receiver/gi ) ) { return; } 4 | 5 | var socket = io.connect(window.location.origin); 6 | var socketId = Math.random().toString().slice(2); 7 | 8 | console.log('View slide notes at ' + window.location.origin + '/notes/' + socketId); 9 | window.open(window.location.origin + '/notes/' + socketId, 'notes-' + socketId); 10 | 11 | // Fires when a fragment is shown 12 | Reveal.addEventListener( 'fragmentshown', function( event ) { 13 | var fragmentData = { 14 | fragment : 'next', 15 | socketId : socketId 16 | }; 17 | socket.emit('fragmentchanged', fragmentData); 18 | } ); 19 | 20 | // Fires when a fragment is hidden 21 | Reveal.addEventListener( 'fragmenthidden', function( event ) { 22 | var fragmentData = { 23 | fragment : 'previous', 24 | socketId : socketId 25 | }; 26 | socket.emit('fragmentchanged', fragmentData); 27 | } ); 28 | 29 | // Fires when slide is changed 30 | Reveal.addEventListener( 'slidechanged', function( event ) { 31 | var nextindexh; 32 | var nextindexv; 33 | var slideElement = event.currentSlide; 34 | 35 | if (slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION') { 36 | nextindexh = event.indexh; 37 | nextindexv = event.indexv + 1; 38 | } else { 39 | nextindexh = event.indexh + 1; 40 | nextindexv = 0; 41 | } 42 | 43 | var notes = slideElement.querySelector('aside.notes'); 44 | var slideData = { 45 | notes : notes ? notes.innerHTML : '', 46 | indexh : event.indexh, 47 | indexv : event.indexv, 48 | nextindexh : nextindexh, 49 | nextindexv : nextindexv, 50 | socketId : socketId, 51 | markdown : notes ? typeof notes.getAttribute('data-markdown') === 'string' : false 52 | 53 | }; 54 | 55 | socket.emit('slidechanged', slideData); 56 | } ); 57 | }()); 58 | -------------------------------------------------------------------------------- /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 | socket.on('slidechanged', function(slideData) { 19 | socket.broadcast.emit('slidedata', slideData); 20 | }); 21 | socket.on('fragmentchanged', function(fragmentData) { 22 | socket.broadcast.emit('fragmentdata', fragmentData); 23 | }); 24 | }); 25 | 26 | app.configure(function() { 27 | [ 'css', 'js', 'images', '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("/notes/:socketId", function(req, res) { 38 | 39 | fs.readFile(opts.baseDir + 'plugin/notes-server/notes.html', function(err, data) { 40 | res.send(Mustache.to_html(data.toString(), { 41 | socketId : req.params.socketId 42 | })); 43 | }); 44 | // fs.createReadStream(opts.baseDir + 'notes-server/notes.html').pipe(res); 45 | }); 46 | 47 | // Actually listen 48 | app.listen(opts.port || null); 49 | 50 | var brown = '\033[33m', 51 | green = '\033[32m', 52 | reset = '\033[0m'; 53 | 54 | var slidesLocation = "http://localhost" + ( opts.port ? ( ':' + opts.port ) : '' ); 55 | 56 | console.log( brown + "reveal.js - Speaker Notes" + reset ); 57 | console.log( "1. Open the slides at " + green + slidesLocation + reset ); 58 | console.log( "2. Click on the link your JS console to go to the notes page" ); 59 | console.log( "3. Advance through your slides and your notes will advance automatically" ); 60 | -------------------------------------------------------------------------------- /plugin/notes-server/notes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | reveal.js - Slide Notes 9 | 10 | 90 | 91 | 92 | 93 | 94 |
95 | 96 |
97 | 98 |
99 | 100 | UPCOMING: 101 |
102 |
103 | 104 | 105 | 106 | 107 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /plugin/notes/notes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Handles opening of and synchronization with the reveal.js 3 | * notes window. 4 | */ 5 | var RevealNotes = (function() { 6 | 7 | function openNotes() { 8 | var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path 9 | jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path 10 | var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=1120,height=850' ); 11 | 12 | // Fires when slide is changed 13 | Reveal.addEventListener( 'slidechanged', post ); 14 | 15 | // Fires when a fragment is shown 16 | Reveal.addEventListener( 'fragmentshown', post ); 17 | 18 | // Fires when a fragment is hidden 19 | Reveal.addEventListener( 'fragmenthidden', post ); 20 | 21 | /** 22 | * Posts the current slide data to the notes window 23 | */ 24 | function post() { 25 | var slideElement = Reveal.getCurrentSlide(), 26 | slideIndices = Reveal.getIndices(), 27 | messageData; 28 | 29 | var notes = slideElement.querySelector( 'aside.notes' ), 30 | nextindexh, 31 | nextindexv; 32 | 33 | if( slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION' ) { 34 | nextindexh = slideIndices.h; 35 | nextindexv = slideIndices.v + 1; 36 | } else { 37 | nextindexh = slideIndices.h + 1; 38 | nextindexv = 0; 39 | } 40 | 41 | messageData = { 42 | notes : notes ? notes.innerHTML : '', 43 | indexh : slideIndices.h, 44 | indexv : slideIndices.v, 45 | indexf : slideIndices.f, 46 | nextindexh : nextindexh, 47 | nextindexv : nextindexv, 48 | markdown : notes ? typeof notes.getAttribute( 'data-markdown' ) === 'string' : false 49 | }; 50 | 51 | notesPopup.postMessage( JSON.stringify( messageData ), '*' ); 52 | } 53 | 54 | // Navigate to the current slide when the notes are loaded 55 | notesPopup.addEventListener( 'load', function( event ) { 56 | post(); 57 | }, false ); 58 | } 59 | 60 | // If the there's a 'notes' query set, open directly 61 | if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) { 62 | openNotes(); 63 | } 64 | 65 | // Open the notes when the 's' key is hit 66 | document.addEventListener( 'keydown', function( event ) { 67 | // Disregard the event if the target is editable or a 68 | // modifier is present 69 | if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return; 70 | 71 | if( event.keyCode === 83 ) { 72 | event.preventDefault(); 73 | openNotes(); 74 | } 75 | }, false ); 76 | 77 | return { open: openNotes }; 78 | })(); 79 | -------------------------------------------------------------------------------- /plugin/postmessage/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 |
11 | 12 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /plugin/postmessage/postmessage.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | simple postmessage plugin 4 | 5 | Useful when a reveal slideshow is inside an iframe. 6 | It allows to call reveal methods from outside. 7 | 8 | Example: 9 | var reveal = window.frames[0]; 10 | 11 | // Reveal.prev(); 12 | reveal.postMessage(JSON.stringify({method: 'prev', args: []}), '*'); 13 | // Reveal.next(); 14 | reveal.postMessage(JSON.stringify({method: 'next', args: []}), '*'); 15 | // Reveal.slide(2, 2); 16 | reveal.postMessage(JSON.stringify({method: 'slide', args: [2,2]}), '*'); 17 | 18 | Add to the slideshow: 19 | 20 | dependencies: [ 21 | ... 22 | { src: 'plugin/postmessage/postmessage.js', async: true, condition: function() { return !!document.body.classList; } } 23 | ] 24 | 25 | */ 26 | 27 | (function (){ 28 | 29 | window.addEventListener( "message", function ( event ) { 30 | var data = JSON.parse( event.data ), 31 | method = data.method, 32 | args = data.args; 33 | 34 | if( typeof Reveal[method] === 'function' ) { 35 | Reveal[method].apply( Reveal, data.args ); 36 | } 37 | }, false); 38 | 39 | }()); 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /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 | page.viewportSize = { 15 | width: 1024, 16 | height: 768 17 | }; 18 | 19 | page.paperSize = { 20 | format: 'letter', 21 | orientation: 'landscape', 22 | margin: { 23 | left: '0', 24 | right: '0', 25 | top: '0', 26 | bottom: '0' 27 | } 28 | }; 29 | 30 | var revealFile = system.args[1] || 'index.html?print-pdf'; 31 | var slideFile = system.args[2] || 'slides.pdf'; 32 | 33 | if( slideFile.match( /\.pdf$/gi ) === null ) { 34 | slideFile += '.pdf'; 35 | } 36 | 37 | console.log( 'Printing PDF...' ); 38 | 39 | page.open( revealFile, function( status ) { 40 | console.log( 'Printed succesfully' ); 41 | page.render( slideFile ); 42 | phantom.exit(); 43 | } ); 44 | 45 | -------------------------------------------------------------------------------- /plugin/remotes/remotes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Touch-based remote controller for your presentation courtesy 3 | * of the folks at http://remotes.io 4 | */ 5 | 6 | (function(window){ 7 | 8 | /** 9 | * Detects if we are dealing with a touch enabled device (with some false positives) 10 | * Borrowed from modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touch.js 11 | */ 12 | var hasTouch = (function(){ 13 | return ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch; 14 | })(); 15 | 16 | /** 17 | * Detects if notes are enable and the current page is opened inside an /iframe 18 | * this prevents loading Remotes.io several times 19 | */ 20 | var isNotesAndIframe = (function(){ 21 | return window.RevealNotes && !(self == top); 22 | })(); 23 | 24 | if(!hasTouch && !isNotesAndIframe){ 25 | head.ready( 'remotes.ne.min.js', function() { 26 | new Remotes("preview") 27 | .on("swipe-left", function(e){ Reveal.right(); }) 28 | .on("swipe-right", function(e){ Reveal.left(); }) 29 | .on("swipe-up", function(e){ Reveal.down(); }) 30 | .on("swipe-down", function(e){ Reveal.up(); }) 31 | .on("tap", function(e){ Reveal.next(); }) 32 | .on("zoom-out", function(e){ Reveal.toggleOverview(true); }) 33 | .on("zoom-in", function(e){ Reveal.toggleOverview(false); }) 34 | ; 35 | } ); 36 | 37 | head.js('https://hakim-static.s3.amazonaws.com/reveal-js/remotes.ne.min.js'); 38 | } 39 | })(window); -------------------------------------------------------------------------------- /presentation/slides/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 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. -------------------------------------------------------------------------------- /presentation/slides/css/print/paper.css: -------------------------------------------------------------------------------- 1 | /* Default Print Stylesheet Template 2 | by Rob Glazebrook of CSSnewbie.com 3 | Last Updated: June 4, 2008 4 | 5 | Feel free (nay, compelled) to edit, append, and 6 | manipulate this file as you see fit. */ 7 | 8 | 9 | /* SECTION 1: Set default width, margin, float, and 10 | background. This prevents elements from extending 11 | beyond the edge of the printed page, and prevents 12 | unnecessary background images from printing */ 13 | body { 14 | background: #fff; 15 | font-size: 13pt; 16 | width: auto; 17 | height: auto; 18 | border: 0; 19 | margin: 0 5%; 20 | padding: 0; 21 | float: none !important; 22 | overflow: visible; 23 | } 24 | html { 25 | background: #fff; 26 | width: auto; 27 | height: auto; 28 | overflow: visible; 29 | } 30 | 31 | /* SECTION 2: Remove any elements not needed in print. 32 | This would include navigation, ads, sidebars, etc. */ 33 | .nestedarrow, 34 | .controls, 35 | .reveal .progress, 36 | .reveal.overview, 37 | .fork-reveal, 38 | .share-reveal, 39 | .state-background { 40 | display: none !important; 41 | } 42 | 43 | /* SECTION 3: Set body font face, size, and color. 44 | Consider using a serif font for readability. */ 45 | body, p, td, li, div, a { 46 | font-size: 16pt!important; 47 | font-family: Georgia, "Times New Roman", Times, serif !important; 48 | color: #000; 49 | } 50 | 51 | /* SECTION 4: Set heading font face, sizes, and color. 52 | Differentiate your headings from your body text. 53 | Perhaps use a large sans-serif for distinction. */ 54 | h1,h2,h3,h4,h5,h6 { 55 | color: #000!important; 56 | height: auto; 57 | line-height: normal; 58 | font-family: Georgia, "Times New Roman", Times, serif !important; 59 | text-shadow: 0 0 0 #000 !important; 60 | text-align: left; 61 | letter-spacing: normal; 62 | } 63 | /* Need to reduce the size of the fonts for printing */ 64 | h1 { font-size: 26pt !important; } 65 | h2 { font-size: 22pt !important; } 66 | h3 { font-size: 20pt !important; } 67 | h4 { font-size: 20pt !important; font-variant: small-caps; } 68 | h5 { font-size: 19pt !important; } 69 | h6 { font-size: 18pt !important; font-style: italic; } 70 | 71 | /* SECTION 5: Make hyperlinks more usable. 72 | Ensure links are underlined, and consider appending 73 | the URL to the end of the link for usability. */ 74 | a:link, 75 | a:visited { 76 | color: #000 !important; 77 | font-weight: bold; 78 | text-decoration: underline; 79 | } 80 | /* 81 | .reveal a:link:after, 82 | .reveal a:visited:after { 83 | content: " (" attr(href) ") "; 84 | color: #222 !important; 85 | font-size: 90%; 86 | } 87 | */ 88 | 89 | 90 | /* SECTION 6: more reveal.js specific additions by @skypanther */ 91 | ul, ol, div, p { 92 | visibility: visible; 93 | position: static; 94 | width: auto; 95 | height: auto; 96 | display: block; 97 | overflow: visible; 98 | margin: auto; 99 | text-align: left !important; 100 | } 101 | .reveal .slides { 102 | position: static; 103 | width: auto; 104 | height: auto; 105 | 106 | left: auto; 107 | top: auto; 108 | margin-left: auto; 109 | margin-top: auto; 110 | padding: auto; 111 | 112 | overflow: visible; 113 | display: block; 114 | 115 | text-align: center; 116 | -webkit-perspective: none; 117 | -moz-perspective: none; 118 | -ms-perspective: none; 119 | perspective: none; 120 | 121 | -webkit-perspective-origin: 50% 50%; /* there isn't a none/auto value but 50-50 is the default */ 122 | -moz-perspective-origin: 50% 50%; 123 | -ms-perspective-origin: 50% 50%; 124 | perspective-origin: 50% 50%; 125 | } 126 | .reveal .slides>section, 127 | .reveal .slides>section>section { 128 | 129 | visibility: visible !important; 130 | position: static !important; 131 | width: 90% !important; 132 | height: auto !important; 133 | display: block !important; 134 | overflow: visible !important; 135 | 136 | left: 0% !important; 137 | top: 0% !important; 138 | margin-left: 0px !important; 139 | margin-top: 0px !important; 140 | padding: 20px 0px !important; 141 | 142 | opacity: 1 !important; 143 | 144 | -webkit-transform-style: flat !important; 145 | -moz-transform-style: flat !important; 146 | -ms-transform-style: flat !important; 147 | transform-style: flat !important; 148 | 149 | -webkit-transform: none !important; 150 | -moz-transform: none !important; 151 | -ms-transform: none !important; 152 | transform: none !important; 153 | } 154 | .reveal section { 155 | page-break-after: always !important; 156 | display: block !important; 157 | } 158 | .reveal section .fragment { 159 | opacity: 1 !important; 160 | visibility: visible !important; 161 | 162 | -webkit-transform: none !important; 163 | -moz-transform: none !important; 164 | -ms-transform: none !important; 165 | transform: none !important; 166 | } 167 | .reveal section:last-of-type { 168 | page-break-after: avoid !important; 169 | } 170 | .reveal section img { 171 | display: block; 172 | margin: 15px 0px; 173 | background: rgba(255,255,255,1); 174 | border: 1px solid #666; 175 | box-shadow: none; 176 | } -------------------------------------------------------------------------------- /presentation/slides/css/print/pdf.css: -------------------------------------------------------------------------------- 1 | /* Default Print Stylesheet Template 2 | by Rob Glazebrook of CSSnewbie.com 3 | Last Updated: June 4, 2008 4 | 5 | Feel free (nay, compelled) to edit, append, and 6 | manipulate this file as you see fit. */ 7 | 8 | 9 | /* SECTION 1: Set default width, margin, float, and 10 | background. This prevents elements from extending 11 | beyond the edge of the printed page, and prevents 12 | unnecessary background images from printing */ 13 | 14 | * { 15 | -webkit-print-color-adjust: exact; 16 | } 17 | 18 | body { 19 | font-size: 18pt; 20 | width: 297mm; 21 | height: 229mm; 22 | margin: 0 auto !important; 23 | border: 0; 24 | padding: 0; 25 | float: none !important; 26 | overflow: visible; 27 | } 28 | 29 | html { 30 | width: 100%; 31 | height: 100%; 32 | overflow: visible; 33 | } 34 | 35 | @page { 36 | size: letter landscape; 37 | margin: 0; 38 | } 39 | 40 | /* SECTION 2: Remove any elements not needed in print. 41 | This would include navigation, ads, sidebars, etc. */ 42 | .nestedarrow, 43 | .controls, 44 | .reveal .progress, 45 | .reveal.overview, 46 | .fork-reveal, 47 | .share-reveal, 48 | .state-background { 49 | display: none !important; 50 | } 51 | 52 | /* SECTION 3: Set body font face, size, and color. 53 | Consider using a serif font for readability. */ 54 | body, p, td, li, div { 55 | font-size: 18pt; 56 | } 57 | 58 | /* SECTION 4: Set heading font face, sizes, and color. 59 | Differentiate your headings from your body text. 60 | Perhaps use a large sans-serif for distinction. */ 61 | h1,h2,h3,h4,h5,h6 { 62 | text-shadow: 0 0 0 #000 !important; 63 | } 64 | 65 | /* SECTION 5: Make hyperlinks more usable. 66 | Ensure links are underlined, and consider appending 67 | the URL to the end of the link for usability. */ 68 | a:link, 69 | a:visited { 70 | font-weight: normal; 71 | text-decoration: underline; 72 | } 73 | 74 | .reveal pre code { 75 | overflow: hidden !important; 76 | font-family: monospace !important; 77 | } 78 | 79 | 80 | /* SECTION 6: more reveal.js specific additions by @skypanther */ 81 | ul, ol, div, p { 82 | visibility: visible; 83 | position: static; 84 | width: auto; 85 | height: auto; 86 | display: block; 87 | overflow: visible; 88 | margin: auto; 89 | } 90 | .reveal { 91 | width: auto !important; 92 | height: auto !important; 93 | overflow: hidden !important; 94 | } 95 | .reveal .slides { 96 | position: static; 97 | width: 100%; 98 | height: auto; 99 | 100 | left: auto; 101 | top: auto; 102 | margin: 0 !important; 103 | padding: 0 !important; 104 | 105 | overflow: visible; 106 | display: block; 107 | 108 | text-align: center; 109 | 110 | -webkit-perspective: none; 111 | -moz-perspective: none; 112 | -ms-perspective: none; 113 | perspective: none; 114 | 115 | -webkit-perspective-origin: 50% 50%; /* there isn't a none/auto value but 50-50 is the default */ 116 | -moz-perspective-origin: 50% 50%; 117 | -ms-perspective-origin: 50% 50%; 118 | perspective-origin: 50% 50%; 119 | } 120 | .reveal .slides section { 121 | 122 | page-break-after: always !important; 123 | 124 | visibility: visible !important; 125 | position: relative !important; 126 | width: 100% !important; 127 | height: 229mm !important; 128 | min-height: 229mm !important; 129 | display: block !important; 130 | overflow: hidden !important; 131 | 132 | left: 0 !important; 133 | top: 0 !important; 134 | margin: 0 !important; 135 | padding: 2cm 2cm 0 2cm !important; 136 | box-sizing: border-box !important; 137 | 138 | opacity: 1 !important; 139 | 140 | -webkit-transform-style: flat !important; 141 | -moz-transform-style: flat !important; 142 | -ms-transform-style: flat !important; 143 | transform-style: flat !important; 144 | 145 | -webkit-transform: none !important; 146 | -moz-transform: none !important; 147 | -ms-transform: none !important; 148 | transform: none !important; 149 | } 150 | .reveal section.stack { 151 | margin: 0 !important; 152 | padding: 0 !important; 153 | page-break-after: avoid !important; 154 | height: auto !important; 155 | min-height: auto !important; 156 | } 157 | .reveal .absolute-element { 158 | margin-left: 2.2cm; 159 | margin-top: 1.8cm; 160 | } 161 | .reveal section .fragment { 162 | opacity: 1 !important; 163 | visibility: visible !important; 164 | 165 | -webkit-transform: none !important; 166 | -moz-transform: none !important; 167 | -ms-transform: none !important; 168 | transform: none !important; 169 | } 170 | .reveal section .slide-background { 171 | position: absolute; 172 | top: 0; 173 | left: 0; 174 | width: 100%; 175 | z-index: 0; 176 | } 177 | .reveal section>* { 178 | position: relative; 179 | z-index: 1; 180 | } 181 | .reveal img { 182 | box-shadow: none; 183 | } 184 | .reveal .roll { 185 | overflow: visible; 186 | line-height: 1em; 187 | } 188 | .reveal small a { 189 | font-size: 16pt !important; 190 | } 191 | -------------------------------------------------------------------------------- /presentation/slides/css/reveal-ck.css: -------------------------------------------------------------------------------- 1 | .reveal section img.emoji { 2 | background: none; 3 | border: 0; 4 | box-shadow: none; 5 | margin: 0; 6 | } 7 | -------------------------------------------------------------------------------- /presentation/slides/css/theme/beige.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 2 | /** 3 | * Beige theme for reveal.js. 4 | * 5 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 6 | */ 7 | @font-face { 8 | font-family: 'League Gothic'; 9 | src: url("../../lib/font/league_gothic-webfont.eot"); 10 | src: url("../../lib/font/league_gothic-webfont.eot?#iefix") format("embedded-opentype"), url("../../lib/font/league_gothic-webfont.woff") format("woff"), url("../../lib/font/league_gothic-webfont.ttf") format("truetype"), url("../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular") format("svg"); 11 | font-weight: normal; 12 | font-style: normal; } 13 | 14 | /********************************************* 15 | * GLOBAL STYLES 16 | *********************************************/ 17 | body { 18 | background: #f7f2d3; 19 | background: -moz-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); 20 | background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, white), color-stop(100%, #f7f2d3)); 21 | background: -webkit-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); 22 | background: -o-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); 23 | background: -ms-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); 24 | background: radial-gradient(center, circle cover, white 0%, #f7f2d3 100%); 25 | background-color: #f7f3de; } 26 | 27 | .reveal { 28 | font-family: "Lato", sans-serif; 29 | font-size: 36px; 30 | font-weight: normal; 31 | letter-spacing: -0.02em; 32 | color: #333333; } 33 | 34 | ::selection { 35 | color: white; 36 | background: rgba(79, 64, 28, 0.99); 37 | text-shadow: none; } 38 | 39 | /********************************************* 40 | * HEADERS 41 | *********************************************/ 42 | .reveal h1, 43 | .reveal h2, 44 | .reveal h3, 45 | .reveal h4, 46 | .reveal h5, 47 | .reveal h6 { 48 | margin: 0 0 20px 0; 49 | color: #333333; 50 | font-family: "League Gothic", Impact, sans-serif; 51 | line-height: 0.9em; 52 | letter-spacing: 0.02em; 53 | text-transform: uppercase; 54 | text-shadow: none; } 55 | 56 | .reveal h1 { 57 | text-shadow: 0 1px 0 #cccccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbbbbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaaaaa, 0 6px 1px rgba(0, 0, 0, 0.1), 0 0 5px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.3), 0 3px 5px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.25), 0 20px 20px rgba(0, 0, 0, 0.15); } 58 | 59 | /********************************************* 60 | * LINKS 61 | *********************************************/ 62 | .reveal a:not(.image) { 63 | color: #8b743d; 64 | text-decoration: none; 65 | -webkit-transition: color .15s ease; 66 | -moz-transition: color .15s ease; 67 | -ms-transition: color .15s ease; 68 | -o-transition: color .15s ease; 69 | transition: color .15s ease; } 70 | 71 | .reveal a:not(.image):hover { 72 | color: #c0a86e; 73 | text-shadow: none; 74 | border: none; } 75 | 76 | .reveal .roll span:after { 77 | color: #fff; 78 | background: #564826; } 79 | 80 | /********************************************* 81 | * IMAGES 82 | *********************************************/ 83 | .reveal section img { 84 | margin: 15px 0px; 85 | background: rgba(255, 255, 255, 0.12); 86 | border: 4px solid #333333; 87 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 88 | -webkit-transition: all .2s linear; 89 | -moz-transition: all .2s linear; 90 | -ms-transition: all .2s linear; 91 | -o-transition: all .2s linear; 92 | transition: all .2s linear; } 93 | 94 | .reveal a:hover img { 95 | background: rgba(255, 255, 255, 0.2); 96 | border-color: #8b743d; 97 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 98 | 99 | /********************************************* 100 | * NAVIGATION CONTROLS 101 | *********************************************/ 102 | .reveal .controls div.navigate-left, 103 | .reveal .controls div.navigate-left.enabled { 104 | border-right-color: #8b743d; } 105 | 106 | .reveal .controls div.navigate-right, 107 | .reveal .controls div.navigate-right.enabled { 108 | border-left-color: #8b743d; } 109 | 110 | .reveal .controls div.navigate-up, 111 | .reveal .controls div.navigate-up.enabled { 112 | border-bottom-color: #8b743d; } 113 | 114 | .reveal .controls div.navigate-down, 115 | .reveal .controls div.navigate-down.enabled { 116 | border-top-color: #8b743d; } 117 | 118 | .reveal .controls div.navigate-left.enabled:hover { 119 | border-right-color: #c0a86e; } 120 | 121 | .reveal .controls div.navigate-right.enabled:hover { 122 | border-left-color: #c0a86e; } 123 | 124 | .reveal .controls div.navigate-up.enabled:hover { 125 | border-bottom-color: #c0a86e; } 126 | 127 | .reveal .controls div.navigate-down.enabled:hover { 128 | border-top-color: #c0a86e; } 129 | 130 | /********************************************* 131 | * PROGRESS BAR 132 | *********************************************/ 133 | .reveal .progress { 134 | background: rgba(0, 0, 0, 0.2); } 135 | 136 | .reveal .progress span { 137 | background: #8b743d; 138 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 139 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 140 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 141 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 142 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 143 | 144 | /********************************************* 145 | * SLIDE NUMBER 146 | *********************************************/ 147 | .reveal .slide-number { 148 | color: #8b743d; } 149 | -------------------------------------------------------------------------------- /presentation/slides/css/theme/moon.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 2 | /** 3 | * Solarized Dark theme for reveal.js. 4 | * Author: Achim Staebler 5 | */ 6 | @font-face { 7 | font-family: 'League Gothic'; 8 | src: url("../../lib/font/league_gothic-webfont.eot"); 9 | src: url("../../lib/font/league_gothic-webfont.eot?#iefix") format("embedded-opentype"), url("../../lib/font/league_gothic-webfont.woff") format("woff"), url("../../lib/font/league_gothic-webfont.ttf") format("truetype"), url("../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular") format("svg"); 10 | font-weight: normal; 11 | font-style: normal; } 12 | 13 | /** 14 | * Solarized colors by Ethan Schoonover 15 | */ 16 | html * { 17 | color-profile: sRGB; 18 | rendering-intent: auto; } 19 | 20 | /********************************************* 21 | * GLOBAL STYLES 22 | *********************************************/ 23 | body { 24 | background: #002b36; 25 | background-color: #002b36; } 26 | 27 | .reveal { 28 | font-family: "Lato", sans-serif; 29 | font-size: 36px; 30 | font-weight: normal; 31 | letter-spacing: -0.02em; 32 | color: #93a1a1; } 33 | 34 | ::selection { 35 | color: white; 36 | background: #d33682; 37 | text-shadow: none; } 38 | 39 | /********************************************* 40 | * HEADERS 41 | *********************************************/ 42 | .reveal h1, 43 | .reveal h2, 44 | .reveal h3, 45 | .reveal h4, 46 | .reveal h5, 47 | .reveal h6 { 48 | margin: 0 0 20px 0; 49 | color: #eee8d5; 50 | font-family: "League Gothic", Impact, sans-serif; 51 | line-height: 0.9em; 52 | letter-spacing: 0.02em; 53 | text-transform: uppercase; 54 | text-shadow: none; } 55 | 56 | .reveal h1 { 57 | text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); } 58 | 59 | /********************************************* 60 | * LINKS 61 | *********************************************/ 62 | .reveal a:not(.image) { 63 | color: #268bd2; 64 | text-decoration: none; 65 | -webkit-transition: color .15s ease; 66 | -moz-transition: color .15s ease; 67 | -ms-transition: color .15s ease; 68 | -o-transition: color .15s ease; 69 | transition: color .15s ease; } 70 | 71 | .reveal a:not(.image):hover { 72 | color: #78b9e6; 73 | text-shadow: none; 74 | border: none; } 75 | 76 | .reveal .roll span:after { 77 | color: #fff; 78 | background: #1a6091; } 79 | 80 | /********************************************* 81 | * IMAGES 82 | *********************************************/ 83 | .reveal section img { 84 | margin: 15px 0px; 85 | background: rgba(255, 255, 255, 0.12); 86 | border: 4px solid #93a1a1; 87 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 88 | -webkit-transition: all .2s linear; 89 | -moz-transition: all .2s linear; 90 | -ms-transition: all .2s linear; 91 | -o-transition: all .2s linear; 92 | transition: all .2s linear; } 93 | 94 | .reveal a:hover img { 95 | background: rgba(255, 255, 255, 0.2); 96 | border-color: #268bd2; 97 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 98 | 99 | /********************************************* 100 | * NAVIGATION CONTROLS 101 | *********************************************/ 102 | .reveal .controls div.navigate-left, 103 | .reveal .controls div.navigate-left.enabled { 104 | border-right-color: #268bd2; } 105 | 106 | .reveal .controls div.navigate-right, 107 | .reveal .controls div.navigate-right.enabled { 108 | border-left-color: #268bd2; } 109 | 110 | .reveal .controls div.navigate-up, 111 | .reveal .controls div.navigate-up.enabled { 112 | border-bottom-color: #268bd2; } 113 | 114 | .reveal .controls div.navigate-down, 115 | .reveal .controls div.navigate-down.enabled { 116 | border-top-color: #268bd2; } 117 | 118 | .reveal .controls div.navigate-left.enabled:hover { 119 | border-right-color: #78b9e6; } 120 | 121 | .reveal .controls div.navigate-right.enabled:hover { 122 | border-left-color: #78b9e6; } 123 | 124 | .reveal .controls div.navigate-up.enabled:hover { 125 | border-bottom-color: #78b9e6; } 126 | 127 | .reveal .controls div.navigate-down.enabled:hover { 128 | border-top-color: #78b9e6; } 129 | 130 | /********************************************* 131 | * PROGRESS BAR 132 | *********************************************/ 133 | .reveal .progress { 134 | background: rgba(0, 0, 0, 0.2); } 135 | 136 | .reveal .progress span { 137 | background: #268bd2; 138 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 139 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 140 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 141 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 142 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 143 | 144 | /********************************************* 145 | * SLIDE NUMBER 146 | *********************************************/ 147 | .reveal .slide-number { 148 | color: #268bd2; } 149 | -------------------------------------------------------------------------------- /presentation/slides/css/theme/night.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Montserrat:700); 2 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic); 3 | /** 4 | * Black theme for reveal.js. 5 | * 6 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | /********************************************* 9 | * GLOBAL STYLES 10 | *********************************************/ 11 | body { 12 | background: #111111; 13 | background-color: #111111; } 14 | 15 | .reveal { 16 | font-family: "Open Sans", sans-serif; 17 | font-size: 30px; 18 | font-weight: normal; 19 | letter-spacing: -0.02em; 20 | color: #eeeeee; } 21 | 22 | ::selection { 23 | color: white; 24 | background: #e7ad52; 25 | text-shadow: none; } 26 | 27 | /********************************************* 28 | * HEADERS 29 | *********************************************/ 30 | .reveal h1, 31 | .reveal h2, 32 | .reveal h3, 33 | .reveal h4, 34 | .reveal h5, 35 | .reveal h6 { 36 | margin: 0 0 20px 0; 37 | color: #eeeeee; 38 | font-family: "Montserrat", Impact, sans-serif; 39 | line-height: 0.9em; 40 | letter-spacing: -0.03em; 41 | text-transform: none; 42 | text-shadow: none; } 43 | 44 | .reveal h1 { 45 | text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); } 46 | 47 | /********************************************* 48 | * LINKS 49 | *********************************************/ 50 | .reveal a:not(.image) { 51 | color: #e7ad52; 52 | text-decoration: none; 53 | -webkit-transition: color .15s ease; 54 | -moz-transition: color .15s ease; 55 | -ms-transition: color .15s ease; 56 | -o-transition: color .15s ease; 57 | transition: color .15s ease; } 58 | 59 | .reveal a:not(.image):hover { 60 | color: #f3d7ac; 61 | text-shadow: none; 62 | border: none; } 63 | 64 | .reveal .roll span:after { 65 | color: #fff; 66 | background: #d08a1d; } 67 | 68 | /********************************************* 69 | * IMAGES 70 | *********************************************/ 71 | .reveal section img { 72 | margin: 15px 0px; 73 | background: rgba(255, 255, 255, 0.12); 74 | border: 4px solid #eeeeee; 75 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 76 | -webkit-transition: all .2s linear; 77 | -moz-transition: all .2s linear; 78 | -ms-transition: all .2s linear; 79 | -o-transition: all .2s linear; 80 | transition: all .2s linear; } 81 | 82 | .reveal a:hover img { 83 | background: rgba(255, 255, 255, 0.2); 84 | border-color: #e7ad52; 85 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 86 | 87 | /********************************************* 88 | * NAVIGATION CONTROLS 89 | *********************************************/ 90 | .reveal .controls div.navigate-left, 91 | .reveal .controls div.navigate-left.enabled { 92 | border-right-color: #e7ad52; } 93 | 94 | .reveal .controls div.navigate-right, 95 | .reveal .controls div.navigate-right.enabled { 96 | border-left-color: #e7ad52; } 97 | 98 | .reveal .controls div.navigate-up, 99 | .reveal .controls div.navigate-up.enabled { 100 | border-bottom-color: #e7ad52; } 101 | 102 | .reveal .controls div.navigate-down, 103 | .reveal .controls div.navigate-down.enabled { 104 | border-top-color: #e7ad52; } 105 | 106 | .reveal .controls div.navigate-left.enabled:hover { 107 | border-right-color: #f3d7ac; } 108 | 109 | .reveal .controls div.navigate-right.enabled:hover { 110 | border-left-color: #f3d7ac; } 111 | 112 | .reveal .controls div.navigate-up.enabled:hover { 113 | border-bottom-color: #f3d7ac; } 114 | 115 | .reveal .controls div.navigate-down.enabled:hover { 116 | border-top-color: #f3d7ac; } 117 | 118 | /********************************************* 119 | * PROGRESS BAR 120 | *********************************************/ 121 | .reveal .progress { 122 | background: rgba(0, 0, 0, 0.2); } 123 | 124 | .reveal .progress span { 125 | background: #e7ad52; 126 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 127 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 128 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 129 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 130 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 131 | 132 | /********************************************* 133 | * SLIDE NUMBER 134 | *********************************************/ 135 | .reveal .slide-number { 136 | color: #e7ad52; } 137 | -------------------------------------------------------------------------------- /presentation/slides/css/theme/serif.css: -------------------------------------------------------------------------------- 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 | .reveal a:not(.image) { 8 | line-height: 1.3em; } 9 | 10 | /********************************************* 11 | * GLOBAL STYLES 12 | *********************************************/ 13 | body { 14 | background: #f0f1eb; 15 | background-color: #f0f1eb; } 16 | 17 | .reveal { 18 | font-family: "Palatino Linotype", "Book Antiqua", Palatino, FreeSerif, serif; 19 | font-size: 36px; 20 | font-weight: normal; 21 | letter-spacing: -0.02em; 22 | color: black; } 23 | 24 | ::selection { 25 | color: white; 26 | background: #26351c; 27 | text-shadow: none; } 28 | 29 | /********************************************* 30 | * HEADERS 31 | *********************************************/ 32 | .reveal h1, 33 | .reveal h2, 34 | .reveal h3, 35 | .reveal h4, 36 | .reveal h5, 37 | .reveal h6 { 38 | margin: 0 0 20px 0; 39 | color: #383d3d; 40 | font-family: "Palatino Linotype", "Book Antiqua", Palatino, FreeSerif, serif; 41 | line-height: 0.9em; 42 | letter-spacing: 0.02em; 43 | text-transform: none; 44 | text-shadow: none; } 45 | 46 | .reveal h1 { 47 | text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); } 48 | 49 | /********************************************* 50 | * LINKS 51 | *********************************************/ 52 | .reveal a:not(.image) { 53 | color: #51483d; 54 | text-decoration: none; 55 | -webkit-transition: color .15s ease; 56 | -moz-transition: color .15s ease; 57 | -ms-transition: color .15s ease; 58 | -o-transition: color .15s ease; 59 | transition: color .15s ease; } 60 | 61 | .reveal a:not(.image):hover { 62 | color: #8b7c69; 63 | text-shadow: none; 64 | border: none; } 65 | 66 | .reveal .roll span:after { 67 | color: #fff; 68 | background: #25211c; } 69 | 70 | /********************************************* 71 | * IMAGES 72 | *********************************************/ 73 | .reveal section img { 74 | margin: 15px 0px; 75 | background: rgba(255, 255, 255, 0.12); 76 | border: 4px solid black; 77 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 78 | -webkit-transition: all .2s linear; 79 | -moz-transition: all .2s linear; 80 | -ms-transition: all .2s linear; 81 | -o-transition: all .2s linear; 82 | transition: all .2s linear; } 83 | 84 | .reveal a:hover img { 85 | background: rgba(255, 255, 255, 0.2); 86 | border-color: #51483d; 87 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 88 | 89 | /********************************************* 90 | * NAVIGATION CONTROLS 91 | *********************************************/ 92 | .reveal .controls div.navigate-left, 93 | .reveal .controls div.navigate-left.enabled { 94 | border-right-color: #51483d; } 95 | 96 | .reveal .controls div.navigate-right, 97 | .reveal .controls div.navigate-right.enabled { 98 | border-left-color: #51483d; } 99 | 100 | .reveal .controls div.navigate-up, 101 | .reveal .controls div.navigate-up.enabled { 102 | border-bottom-color: #51483d; } 103 | 104 | .reveal .controls div.navigate-down, 105 | .reveal .controls div.navigate-down.enabled { 106 | border-top-color: #51483d; } 107 | 108 | .reveal .controls div.navigate-left.enabled:hover { 109 | border-right-color: #8b7c69; } 110 | 111 | .reveal .controls div.navigate-right.enabled:hover { 112 | border-left-color: #8b7c69; } 113 | 114 | .reveal .controls div.navigate-up.enabled:hover { 115 | border-bottom-color: #8b7c69; } 116 | 117 | .reveal .controls div.navigate-down.enabled:hover { 118 | border-top-color: #8b7c69; } 119 | 120 | /********************************************* 121 | * PROGRESS BAR 122 | *********************************************/ 123 | .reveal .progress { 124 | background: rgba(0, 0, 0, 0.2); } 125 | 126 | .reveal .progress span { 127 | background: #51483d; 128 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 129 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 130 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 131 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 132 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 133 | 134 | /********************************************* 135 | * SLIDE NUMBER 136 | *********************************************/ 137 | .reveal .slide-number { 138 | color: #51483d; } 139 | -------------------------------------------------------------------------------- /presentation/slides/css/theme/simple.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700); 2 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 3 | /** 4 | * A simple theme for reveal.js presentations, similar 5 | * to the default theme. The accent color is darkblue. 6 | * 7 | * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed. 8 | * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 9 | */ 10 | /********************************************* 11 | * GLOBAL STYLES 12 | *********************************************/ 13 | body { 14 | background: white; 15 | background-color: white; } 16 | 17 | .reveal { 18 | font-family: "Lato", sans-serif; 19 | font-size: 36px; 20 | font-weight: normal; 21 | letter-spacing: -0.02em; 22 | color: black; } 23 | 24 | ::selection { 25 | color: white; 26 | background: rgba(0, 0, 0, 0.99); 27 | text-shadow: none; } 28 | 29 | /********************************************* 30 | * HEADERS 31 | *********************************************/ 32 | .reveal h1, 33 | .reveal h2, 34 | .reveal h3, 35 | .reveal h4, 36 | .reveal h5, 37 | .reveal h6 { 38 | margin: 0 0 20px 0; 39 | color: black; 40 | font-family: "News Cycle", Impact, sans-serif; 41 | line-height: 0.9em; 42 | letter-spacing: 0.02em; 43 | text-transform: none; 44 | text-shadow: none; } 45 | 46 | .reveal h1 { 47 | text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); } 48 | 49 | /********************************************* 50 | * LINKS 51 | *********************************************/ 52 | .reveal a:not(.image) { 53 | color: darkblue; 54 | text-decoration: none; 55 | -webkit-transition: color .15s ease; 56 | -moz-transition: color .15s ease; 57 | -ms-transition: color .15s ease; 58 | -o-transition: color .15s ease; 59 | transition: color .15s ease; } 60 | 61 | .reveal a:not(.image):hover { 62 | color: #0000f1; 63 | text-shadow: none; 64 | border: none; } 65 | 66 | .reveal .roll span:after { 67 | color: #fff; 68 | background: #00003f; } 69 | 70 | /********************************************* 71 | * IMAGES 72 | *********************************************/ 73 | .reveal section img { 74 | margin: 15px 0px; 75 | background: rgba(255, 255, 255, 0.12); 76 | border: 4px solid black; 77 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 78 | -webkit-transition: all .2s linear; 79 | -moz-transition: all .2s linear; 80 | -ms-transition: all .2s linear; 81 | -o-transition: all .2s linear; 82 | transition: all .2s linear; } 83 | 84 | .reveal a:hover img { 85 | background: rgba(255, 255, 255, 0.2); 86 | border-color: darkblue; 87 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 88 | 89 | /********************************************* 90 | * NAVIGATION CONTROLS 91 | *********************************************/ 92 | .reveal .controls div.navigate-left, 93 | .reveal .controls div.navigate-left.enabled { 94 | border-right-color: darkblue; } 95 | 96 | .reveal .controls div.navigate-right, 97 | .reveal .controls div.navigate-right.enabled { 98 | border-left-color: darkblue; } 99 | 100 | .reveal .controls div.navigate-up, 101 | .reveal .controls div.navigate-up.enabled { 102 | border-bottom-color: darkblue; } 103 | 104 | .reveal .controls div.navigate-down, 105 | .reveal .controls div.navigate-down.enabled { 106 | border-top-color: darkblue; } 107 | 108 | .reveal .controls div.navigate-left.enabled:hover { 109 | border-right-color: #0000f1; } 110 | 111 | .reveal .controls div.navigate-right.enabled:hover { 112 | border-left-color: #0000f1; } 113 | 114 | .reveal .controls div.navigate-up.enabled:hover { 115 | border-bottom-color: #0000f1; } 116 | 117 | .reveal .controls div.navigate-down.enabled:hover { 118 | border-top-color: #0000f1; } 119 | 120 | /********************************************* 121 | * PROGRESS BAR 122 | *********************************************/ 123 | .reveal .progress { 124 | background: rgba(0, 0, 0, 0.2); } 125 | 126 | .reveal .progress span { 127 | background: darkblue; 128 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 129 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 130 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 131 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 132 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 133 | 134 | /********************************************* 135 | * SLIDE NUMBER 136 | *********************************************/ 137 | .reveal .slide-number { 138 | color: darkblue; } 139 | -------------------------------------------------------------------------------- /presentation/slides/css/theme/sky.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic); 2 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700); 3 | /** 4 | * Sky theme for reveal.js. 5 | * 6 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | .reveal a:not(.image) { 9 | line-height: 1.3em; } 10 | 11 | /********************************************* 12 | * GLOBAL STYLES 13 | *********************************************/ 14 | body { 15 | background: #add9e4; 16 | background: -moz-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); 17 | background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #f7fbfc), color-stop(100%, #add9e4)); 18 | background: -webkit-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); 19 | background: -o-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); 20 | background: -ms-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); 21 | background: radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%); 22 | background-color: #f7fbfc; } 23 | 24 | .reveal { 25 | font-family: "Open Sans", sans-serif; 26 | font-size: 36px; 27 | font-weight: normal; 28 | letter-spacing: -0.02em; 29 | color: #333333; } 30 | 31 | ::selection { 32 | color: white; 33 | background: #134674; 34 | text-shadow: none; } 35 | 36 | /********************************************* 37 | * HEADERS 38 | *********************************************/ 39 | .reveal h1, 40 | .reveal h2, 41 | .reveal h3, 42 | .reveal h4, 43 | .reveal h5, 44 | .reveal h6 { 45 | margin: 0 0 20px 0; 46 | color: #333333; 47 | font-family: "Quicksand", sans-serif; 48 | line-height: 0.9em; 49 | letter-spacing: -0.08em; 50 | text-transform: uppercase; 51 | text-shadow: none; } 52 | 53 | .reveal h1 { 54 | text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); } 55 | 56 | /********************************************* 57 | * LINKS 58 | *********************************************/ 59 | .reveal a:not(.image) { 60 | color: #3b759e; 61 | text-decoration: none; 62 | -webkit-transition: color .15s ease; 63 | -moz-transition: color .15s ease; 64 | -ms-transition: color .15s ease; 65 | -o-transition: color .15s ease; 66 | transition: color .15s ease; } 67 | 68 | .reveal a:not(.image):hover { 69 | color: #74a7cb; 70 | text-shadow: none; 71 | border: none; } 72 | 73 | .reveal .roll span:after { 74 | color: #fff; 75 | background: #264c66; } 76 | 77 | /********************************************* 78 | * IMAGES 79 | *********************************************/ 80 | .reveal section img { 81 | margin: 15px 0px; 82 | background: rgba(255, 255, 255, 0.12); 83 | border: 4px solid #333333; 84 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 85 | -webkit-transition: all .2s linear; 86 | -moz-transition: all .2s linear; 87 | -ms-transition: all .2s linear; 88 | -o-transition: all .2s linear; 89 | transition: all .2s linear; } 90 | 91 | .reveal a:hover img { 92 | background: rgba(255, 255, 255, 0.2); 93 | border-color: #3b759e; 94 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 95 | 96 | /********************************************* 97 | * NAVIGATION CONTROLS 98 | *********************************************/ 99 | .reveal .controls div.navigate-left, 100 | .reveal .controls div.navigate-left.enabled { 101 | border-right-color: #3b759e; } 102 | 103 | .reveal .controls div.navigate-right, 104 | .reveal .controls div.navigate-right.enabled { 105 | border-left-color: #3b759e; } 106 | 107 | .reveal .controls div.navigate-up, 108 | .reveal .controls div.navigate-up.enabled { 109 | border-bottom-color: #3b759e; } 110 | 111 | .reveal .controls div.navigate-down, 112 | .reveal .controls div.navigate-down.enabled { 113 | border-top-color: #3b759e; } 114 | 115 | .reveal .controls div.navigate-left.enabled:hover { 116 | border-right-color: #74a7cb; } 117 | 118 | .reveal .controls div.navigate-right.enabled:hover { 119 | border-left-color: #74a7cb; } 120 | 121 | .reveal .controls div.navigate-up.enabled:hover { 122 | border-bottom-color: #74a7cb; } 123 | 124 | .reveal .controls div.navigate-down.enabled:hover { 125 | border-top-color: #74a7cb; } 126 | 127 | /********************************************* 128 | * PROGRESS BAR 129 | *********************************************/ 130 | .reveal .progress { 131 | background: rgba(0, 0, 0, 0.2); } 132 | 133 | .reveal .progress span { 134 | background: #3b759e; 135 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 136 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 137 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 138 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 139 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 140 | 141 | /********************************************* 142 | * SLIDE NUMBER 143 | *********************************************/ 144 | .reveal .slide-number { 145 | color: #3b759e; } 146 | -------------------------------------------------------------------------------- /presentation/slides/css/theme/solarized.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 2 | /** 3 | * Solarized Light theme for reveal.js. 4 | * Author: Achim Staebler 5 | */ 6 | @font-face { 7 | font-family: 'League Gothic'; 8 | src: url("../../lib/font/league_gothic-webfont.eot"); 9 | src: url("../../lib/font/league_gothic-webfont.eot?#iefix") format("embedded-opentype"), url("../../lib/font/league_gothic-webfont.woff") format("woff"), url("../../lib/font/league_gothic-webfont.ttf") format("truetype"), url("../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular") format("svg"); 10 | font-weight: normal; 11 | font-style: normal; } 12 | 13 | /** 14 | * Solarized colors by Ethan Schoonover 15 | */ 16 | html * { 17 | color-profile: sRGB; 18 | rendering-intent: auto; } 19 | 20 | /********************************************* 21 | * GLOBAL STYLES 22 | *********************************************/ 23 | body { 24 | background: #fdf6e3; 25 | background-color: #fdf6e3; } 26 | 27 | .reveal { 28 | font-family: "Lato", sans-serif; 29 | font-size: 36px; 30 | font-weight: normal; 31 | letter-spacing: -0.02em; 32 | color: #657b83; } 33 | 34 | ::selection { 35 | color: white; 36 | background: #d33682; 37 | text-shadow: none; } 38 | 39 | /********************************************* 40 | * HEADERS 41 | *********************************************/ 42 | .reveal h1, 43 | .reveal h2, 44 | .reveal h3, 45 | .reveal h4, 46 | .reveal h5, 47 | .reveal h6 { 48 | margin: 0 0 20px 0; 49 | color: #586e75; 50 | font-family: "League Gothic", Impact, sans-serif; 51 | line-height: 0.9em; 52 | letter-spacing: 0.02em; 53 | text-transform: uppercase; 54 | text-shadow: none; } 55 | 56 | .reveal h1 { 57 | text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); } 58 | 59 | /********************************************* 60 | * LINKS 61 | *********************************************/ 62 | .reveal a:not(.image) { 63 | color: #268bd2; 64 | text-decoration: none; 65 | -webkit-transition: color .15s ease; 66 | -moz-transition: color .15s ease; 67 | -ms-transition: color .15s ease; 68 | -o-transition: color .15s ease; 69 | transition: color .15s ease; } 70 | 71 | .reveal a:not(.image):hover { 72 | color: #78b9e6; 73 | text-shadow: none; 74 | border: none; } 75 | 76 | .reveal .roll span:after { 77 | color: #fff; 78 | background: #1a6091; } 79 | 80 | /********************************************* 81 | * IMAGES 82 | *********************************************/ 83 | .reveal section img { 84 | margin: 15px 0px; 85 | background: rgba(255, 255, 255, 0.12); 86 | border: 4px solid #657b83; 87 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); 88 | -webkit-transition: all .2s linear; 89 | -moz-transition: all .2s linear; 90 | -ms-transition: all .2s linear; 91 | -o-transition: all .2s linear; 92 | transition: all .2s linear; } 93 | 94 | .reveal a:hover img { 95 | background: rgba(255, 255, 255, 0.2); 96 | border-color: #268bd2; 97 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } 98 | 99 | /********************************************* 100 | * NAVIGATION CONTROLS 101 | *********************************************/ 102 | .reveal .controls div.navigate-left, 103 | .reveal .controls div.navigate-left.enabled { 104 | border-right-color: #268bd2; } 105 | 106 | .reveal .controls div.navigate-right, 107 | .reveal .controls div.navigate-right.enabled { 108 | border-left-color: #268bd2; } 109 | 110 | .reveal .controls div.navigate-up, 111 | .reveal .controls div.navigate-up.enabled { 112 | border-bottom-color: #268bd2; } 113 | 114 | .reveal .controls div.navigate-down, 115 | .reveal .controls div.navigate-down.enabled { 116 | border-top-color: #268bd2; } 117 | 118 | .reveal .controls div.navigate-left.enabled:hover { 119 | border-right-color: #78b9e6; } 120 | 121 | .reveal .controls div.navigate-right.enabled:hover { 122 | border-left-color: #78b9e6; } 123 | 124 | .reveal .controls div.navigate-up.enabled:hover { 125 | border-bottom-color: #78b9e6; } 126 | 127 | .reveal .controls div.navigate-down.enabled:hover { 128 | border-top-color: #78b9e6; } 129 | 130 | /********************************************* 131 | * PROGRESS BAR 132 | *********************************************/ 133 | .reveal .progress { 134 | background: rgba(0, 0, 0, 0.2); } 135 | 136 | .reveal .progress span { 137 | background: #268bd2; 138 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 139 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 140 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 141 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 142 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 143 | 144 | /********************************************* 145 | * SLIDE NUMBER 146 | *********************************************/ 147 | .reveal .slide-number { 148 | color: #268bd2; } 149 | -------------------------------------------------------------------------------- /presentation/slides/images/java-collections.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/presentation/slides/images/java-collections.png -------------------------------------------------------------------------------- /presentation/slides/lib/css/zenburn.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Zenburn style from voldmar.ru (c) Vladimir Epifanov 4 | based on dark.css by Ivan Sagalaev 5 | 6 | */ 7 | 8 | pre code { 9 | display: block; padding: 0.5em; 10 | background: #3F3F3F; 11 | color: #DCDCDC; 12 | } 13 | 14 | pre .keyword, 15 | pre .tag, 16 | pre .css .class, 17 | pre .css .id, 18 | pre .lisp .title, 19 | pre .nginx .title, 20 | pre .request, 21 | pre .status, 22 | pre .clojure .attribute { 23 | color: #E3CEAB; 24 | } 25 | 26 | pre .django .template_tag, 27 | pre .django .variable, 28 | pre .django .filter .argument { 29 | color: #DCDCDC; 30 | } 31 | 32 | pre .number, 33 | pre .date { 34 | color: #8CD0D3; 35 | } 36 | 37 | pre .dos .envvar, 38 | pre .dos .stream, 39 | pre .variable, 40 | pre .apache .sqbracket { 41 | color: #EFDCBC; 42 | } 43 | 44 | pre .dos .flow, 45 | pre .diff .change, 46 | pre .python .exception, 47 | pre .python .built_in, 48 | pre .literal, 49 | pre .tex .special { 50 | color: #EFEFAF; 51 | } 52 | 53 | pre .diff .chunk, 54 | pre .subst { 55 | color: #8F8F8F; 56 | } 57 | 58 | pre .dos .keyword, 59 | pre .python .decorator, 60 | pre .title, 61 | pre .haskell .type, 62 | pre .diff .header, 63 | pre .ruby .class .parent, 64 | pre .apache .tag, 65 | pre .nginx .built_in, 66 | pre .tex .command, 67 | pre .prompt { 68 | color: #efef8f; 69 | } 70 | 71 | pre .dos .winutils, 72 | pre .ruby .symbol, 73 | pre .ruby .symbol .string, 74 | pre .ruby .string { 75 | color: #DCA3A3; 76 | } 77 | 78 | pre .diff .deletion, 79 | pre .string, 80 | pre .tag .value, 81 | pre .preprocessor, 82 | pre .built_in, 83 | pre .sql .aggregate, 84 | pre .javadoc, 85 | pre .smalltalk .class, 86 | pre .smalltalk .localvars, 87 | pre .smalltalk .array, 88 | pre .css .rules .value, 89 | pre .attr_selector, 90 | pre .pseudo, 91 | pre .apache .cbracket, 92 | pre .tex .formula { 93 | color: #CC9393; 94 | } 95 | 96 | pre .shebang, 97 | pre .diff .addition, 98 | pre .comment, 99 | pre .java .annotation, 100 | pre .template_comment, 101 | pre .pi, 102 | pre .doctype { 103 | color: #7F9F7F; 104 | } 105 | 106 | pre .coffeescript .javascript, 107 | pre .javascript .xml, 108 | pre .tex .formula, 109 | pre .xml .javascript, 110 | pre .xml .vbscript, 111 | pre .xml .css, 112 | pre .xml .cdata { 113 | opacity: 0.5; 114 | } -------------------------------------------------------------------------------- /presentation/slides/lib/font/league_gothic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/presentation/slides/lib/font/league_gothic-webfont.eot -------------------------------------------------------------------------------- /presentation/slides/lib/font/league_gothic-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/presentation/slides/lib/font/league_gothic-webfont.ttf -------------------------------------------------------------------------------- /presentation/slides/lib/font/league_gothic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aarti/data-structures-ruby/f6740008415a08ffaf76b2b709d80ce07feeae6a/presentation/slides/lib/font/league_gothic-webfont.woff -------------------------------------------------------------------------------- /presentation/slides/lib/font/league_gothic_license: -------------------------------------------------------------------------------- 1 | SIL Open Font License (OFL) 2 | http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL 3 | -------------------------------------------------------------------------------- /presentation/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 3 | Copyright Tero Piirainen (tipiirai) 4 | License MIT / http://bit.ly/mit-license 5 | Version 0.96 6 | 7 | http://headjs.com 8 | */(function(a){function z(){d||(d=!0,s(e,function(a){p(a)}))}function y(c,d){var e=a.createElement("script");e.type="text/"+(c.type||"javascript"),e.src=c.src||c,e.async=!1,e.onreadystatechange=e.onload=function(){var a=e.readyState;!d.done&&(!a||/loaded|complete/.test(a))&&(d.done=!0,d())},(a.body||b).appendChild(e)}function x(a,b){if(a.state==o)return b&&b();if(a.state==n)return k.ready(a.name,b);if(a.state==m)return a.onpreload.push(function(){x(a,b)});a.state=n,y(a.url,function(){a.state=o,b&&b(),s(g[a.name],function(a){p(a)}),u()&&d&&s(g.ALL,function(a){p(a)})})}function w(a,b){a.state===undefined&&(a.state=m,a.onpreload=[],y({src:a.url,type:"cache"},function(){v(a)}))}function v(a){a.state=l,s(a.onpreload,function(a){a.call()})}function u(a){a=a||h;var b;for(var c in a){if(a.hasOwnProperty(c)&&a[c].state!=o)return!1;b=!0}return b}function t(a){return Object.prototype.toString.call(a)=="[object Function]"}function s(a,b){if(!!a){typeof a=="object"&&(a=[].slice.call(a));for(var c=0;c 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Markdown Demo 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 | 22 |
23 | 24 | 25 |
26 | 36 |
37 | 38 | 39 |
40 | 54 |
55 | 56 | 57 |
58 | 69 |
70 | 71 | 72 |
73 | 77 |
78 | 79 | 80 |
81 | 86 |
87 | 88 | 89 |
90 | 100 |
101 | 102 |
103 |
104 | 105 | 106 | 107 | 108 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /presentation/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 | -------------------------------------------------------------------------------- /presentation/slides/plugin/multiplex/client.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var multiplex = Reveal.getConfig().multiplex; 3 | var socketId = multiplex.id; 4 | var socket = io.connect(multiplex.url); 5 | 6 | socket.on(multiplex.id, function(data) { 7 | // ignore data from sockets that aren't ours 8 | if (data.socketId !== socketId) { return; } 9 | if( window.location.host === 'localhost:1947' ) return; 10 | 11 | Reveal.slide(data.indexh, data.indexv, data.indexf, 'remote'); 12 | }); 13 | }()); 14 | -------------------------------------------------------------------------------- /presentation/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 ); -------------------------------------------------------------------------------- /presentation/slides/plugin/multiplex/master.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | // Don't emit events from inside of notes windows 3 | if ( window.location.search.match( /receiver/gi ) ) { return; } 4 | 5 | var multiplex = Reveal.getConfig().multiplex; 6 | 7 | var socket = io.connect(multiplex.url); 8 | 9 | var notify = function( slideElement, indexh, indexv, origin ) { 10 | if( typeof origin === 'undefined' && origin !== 'remote' ) { 11 | var nextindexh; 12 | var nextindexv; 13 | 14 | var fragmentindex = Reveal.getIndices().f; 15 | if (typeof fragmentindex == 'undefined') { 16 | fragmentindex = 0; 17 | } 18 | 19 | if (slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION') { 20 | nextindexh = indexh; 21 | nextindexv = indexv + 1; 22 | } else { 23 | nextindexh = indexh + 1; 24 | nextindexv = 0; 25 | } 26 | 27 | var slideData = { 28 | indexh : indexh, 29 | indexv : indexv, 30 | indexf : fragmentindex, 31 | nextindexh : nextindexh, 32 | nextindexv : nextindexv, 33 | secret: multiplex.secret, 34 | socketId : multiplex.id 35 | }; 36 | 37 | socket.emit('slidechanged', slideData); 38 | } 39 | } 40 | 41 | Reveal.addEventListener( 'slidechanged', function( event ) { 42 | notify( event.currentSlide, event.indexh, event.indexv, event.origin ); 43 | } ); 44 | 45 | var fragmentNotify = function( event ) { 46 | notify( Reveal.getCurrentSlide(), Reveal.getIndices().h, Reveal.getIndices().v, event.origin ); 47 | }; 48 | 49 | Reveal.addEventListener( 'fragmentshown', fragmentNotify ); 50 | Reveal.addEventListener( 'fragmenthidden', fragmentNotify ); 51 | }()); -------------------------------------------------------------------------------- /presentation/slides/plugin/notes-server/client.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | // don't emit events from inside the previews themselves 3 | if ( window.location.search.match( /receiver/gi ) ) { return; } 4 | 5 | var socket = io.connect(window.location.origin); 6 | var socketId = Math.random().toString().slice(2); 7 | 8 | console.log('View slide notes at ' + window.location.origin + '/notes/' + socketId); 9 | window.open(window.location.origin + '/notes/' + socketId, 'notes-' + socketId); 10 | 11 | // Fires when a fragment is shown 12 | Reveal.addEventListener( 'fragmentshown', function( event ) { 13 | var fragmentData = { 14 | fragment : 'next', 15 | socketId : socketId 16 | }; 17 | socket.emit('fragmentchanged', fragmentData); 18 | } ); 19 | 20 | // Fires when a fragment is hidden 21 | Reveal.addEventListener( 'fragmenthidden', function( event ) { 22 | var fragmentData = { 23 | fragment : 'previous', 24 | socketId : socketId 25 | }; 26 | socket.emit('fragmentchanged', fragmentData); 27 | } ); 28 | 29 | // Fires when slide is changed 30 | Reveal.addEventListener( 'slidechanged', function( event ) { 31 | var nextindexh; 32 | var nextindexv; 33 | var slideElement = event.currentSlide; 34 | 35 | if (slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION') { 36 | nextindexh = event.indexh; 37 | nextindexv = event.indexv + 1; 38 | } else { 39 | nextindexh = event.indexh + 1; 40 | nextindexv = 0; 41 | } 42 | 43 | var notes = slideElement.querySelector('aside.notes'); 44 | var slideData = { 45 | notes : notes ? notes.innerHTML : '', 46 | indexh : event.indexh, 47 | indexv : event.indexv, 48 | nextindexh : nextindexh, 49 | nextindexv : nextindexv, 50 | socketId : socketId, 51 | markdown : notes ? typeof notes.getAttribute('data-markdown') === 'string' : false 52 | 53 | }; 54 | 55 | socket.emit('slidechanged', slideData); 56 | } ); 57 | }()); 58 | -------------------------------------------------------------------------------- /presentation/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 | socket.on('slidechanged', function(slideData) { 19 | socket.broadcast.emit('slidedata', slideData); 20 | }); 21 | socket.on('fragmentchanged', function(fragmentData) { 22 | socket.broadcast.emit('fragmentdata', fragmentData); 23 | }); 24 | }); 25 | 26 | app.configure(function() { 27 | [ 'css', 'js', 'images', '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("/notes/:socketId", function(req, res) { 38 | 39 | fs.readFile(opts.baseDir + 'plugin/notes-server/notes.html', function(err, data) { 40 | res.send(Mustache.to_html(data.toString(), { 41 | socketId : req.params.socketId 42 | })); 43 | }); 44 | // fs.createReadStream(opts.baseDir + 'notes-server/notes.html').pipe(res); 45 | }); 46 | 47 | // Actually listen 48 | app.listen(opts.port || null); 49 | 50 | var brown = '\033[33m', 51 | green = '\033[32m', 52 | reset = '\033[0m'; 53 | 54 | var slidesLocation = "http://localhost" + ( opts.port ? ( ':' + opts.port ) : '' ); 55 | 56 | console.log( brown + "reveal.js - Speaker Notes" + reset ); 57 | console.log( "1. Open the slides at " + green + slidesLocation + reset ); 58 | console.log( "2. Click on the link your JS console to go to the notes page" ); 59 | console.log( "3. Advance through your slides and your notes will advance automatically" ); 60 | -------------------------------------------------------------------------------- /presentation/slides/plugin/notes-server/notes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | reveal.js - Slide Notes 9 | 10 | 90 | 91 | 92 | 93 | 94 |
95 | 96 |
97 | 98 |
99 | 100 | UPCOMING: 101 |
102 |
103 | 104 | 105 | 106 | 107 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /presentation/slides/plugin/notes/notes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Handles opening of and synchronization with the reveal.js 3 | * notes window. 4 | */ 5 | var RevealNotes = (function() { 6 | 7 | function openNotes() { 8 | var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path 9 | jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path 10 | var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=1120,height=850' ); 11 | 12 | // Fires when slide is changed 13 | Reveal.addEventListener( 'slidechanged', post ); 14 | 15 | // Fires when a fragment is shown 16 | Reveal.addEventListener( 'fragmentshown', post ); 17 | 18 | // Fires when a fragment is hidden 19 | Reveal.addEventListener( 'fragmenthidden', post ); 20 | 21 | /** 22 | * Posts the current slide data to the notes window 23 | */ 24 | function post() { 25 | var slideElement = Reveal.getCurrentSlide(), 26 | slideIndices = Reveal.getIndices(), 27 | messageData; 28 | 29 | var notes = slideElement.querySelector( 'aside.notes' ), 30 | nextindexh, 31 | nextindexv; 32 | 33 | if( slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION' ) { 34 | nextindexh = slideIndices.h; 35 | nextindexv = slideIndices.v + 1; 36 | } else { 37 | nextindexh = slideIndices.h + 1; 38 | nextindexv = 0; 39 | } 40 | 41 | messageData = { 42 | notes : notes ? notes.innerHTML : '', 43 | indexh : slideIndices.h, 44 | indexv : slideIndices.v, 45 | indexf : slideIndices.f, 46 | nextindexh : nextindexh, 47 | nextindexv : nextindexv, 48 | markdown : notes ? typeof notes.getAttribute( 'data-markdown' ) === 'string' : false 49 | }; 50 | 51 | notesPopup.postMessage( JSON.stringify( messageData ), '*' ); 52 | } 53 | 54 | // Navigate to the current slide when the notes are loaded 55 | notesPopup.addEventListener( 'load', function( event ) { 56 | post(); 57 | }, false ); 58 | } 59 | 60 | // If the there's a 'notes' query set, open directly 61 | if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) { 62 | openNotes(); 63 | } 64 | 65 | // Open the notes when the 's' key is hit 66 | document.addEventListener( 'keydown', function( event ) { 67 | // Disregard the event if the target is editable or a 68 | // modifier is present 69 | if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return; 70 | 71 | if( event.keyCode === 83 ) { 72 | event.preventDefault(); 73 | openNotes(); 74 | } 75 | }, false ); 76 | 77 | return { open: openNotes }; 78 | })(); 79 | -------------------------------------------------------------------------------- /presentation/slides/plugin/postmessage/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 |
11 | 12 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /presentation/slides/plugin/postmessage/postmessage.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | simple postmessage plugin 4 | 5 | Useful when a reveal slideshow is inside an iframe. 6 | It allows to call reveal methods from outside. 7 | 8 | Example: 9 | var reveal = window.frames[0]; 10 | 11 | // Reveal.prev(); 12 | reveal.postMessage(JSON.stringify({method: 'prev', args: []}), '*'); 13 | // Reveal.next(); 14 | reveal.postMessage(JSON.stringify({method: 'next', args: []}), '*'); 15 | // Reveal.slide(2, 2); 16 | reveal.postMessage(JSON.stringify({method: 'slide', args: [2,2]}), '*'); 17 | 18 | Add to the slideshow: 19 | 20 | dependencies: [ 21 | ... 22 | { src: 'plugin/postmessage/postmessage.js', async: true, condition: function() { return !!document.body.classList; } } 23 | ] 24 | 25 | */ 26 | 27 | (function (){ 28 | 29 | window.addEventListener( "message", function ( event ) { 30 | var data = JSON.parse( event.data ), 31 | method = data.method, 32 | args = data.args; 33 | 34 | if( typeof Reveal[method] === 'function' ) { 35 | Reveal[method].apply( Reveal, data.args ); 36 | } 37 | }, false); 38 | 39 | }()); 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /presentation/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 | page.viewportSize = { 15 | width: 1024, 16 | height: 768 17 | }; 18 | 19 | page.paperSize = { 20 | format: 'letter', 21 | orientation: 'landscape', 22 | margin: { 23 | left: '0', 24 | right: '0', 25 | top: '0', 26 | bottom: '0' 27 | } 28 | }; 29 | 30 | var revealFile = system.args[1] || 'index.html?print-pdf'; 31 | var slideFile = system.args[2] || 'slides.pdf'; 32 | 33 | if( slideFile.match( /\.pdf$/gi ) === null ) { 34 | slideFile += '.pdf'; 35 | } 36 | 37 | console.log( 'Printing PDF...' ); 38 | 39 | page.open( revealFile, function( status ) { 40 | console.log( 'Printed succesfully' ); 41 | page.render( slideFile ); 42 | phantom.exit(); 43 | } ); 44 | 45 | -------------------------------------------------------------------------------- /presentation/slides/plugin/remotes/remotes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Touch-based remote controller for your presentation courtesy 3 | * of the folks at http://remotes.io 4 | */ 5 | 6 | (function(window){ 7 | 8 | /** 9 | * Detects if we are dealing with a touch enabled device (with some false positives) 10 | * Borrowed from modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touch.js 11 | */ 12 | var hasTouch = (function(){ 13 | return ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch; 14 | })(); 15 | 16 | /** 17 | * Detects if notes are enable and the current page is opened inside an /iframe 18 | * this prevents loading Remotes.io several times 19 | */ 20 | var isNotesAndIframe = (function(){ 21 | return window.RevealNotes && !(self == top); 22 | })(); 23 | 24 | if(!hasTouch && !isNotesAndIframe){ 25 | head.ready( 'remotes.ne.min.js', function() { 26 | new Remotes("preview") 27 | .on("swipe-left", function(e){ Reveal.right(); }) 28 | .on("swipe-right", function(e){ Reveal.left(); }) 29 | .on("swipe-up", function(e){ Reveal.down(); }) 30 | .on("swipe-down", function(e){ Reveal.up(); }) 31 | .on("tap", function(e){ Reveal.next(); }) 32 | .on("zoom-out", function(e){ Reveal.toggleOverview(true); }) 33 | .on("zoom-in", function(e){ Reveal.toggleOverview(false); }) 34 | ; 35 | } ); 36 | 37 | head.js('https://hakim-static.s3.amazonaws.com/reveal-js/remotes.ne.min.js'); 38 | } 39 | })(window); --------------------------------------------------------------------------------