Skip to content

Commit

Permalink
Automate all the Things! (as in: Shave all the Yaks).
Browse files Browse the repository at this point in the history
  • Loading branch information
bascht committed Jan 13, 2016
1 parent 94c69ff commit e2507a9
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Makefile

This file was deleted.

17 changes: 17 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

* My Talks


- [[file:2016-01-munich-rubyshift/][2016-01-munich-rubyshift/]]
- [[file:2015-12-munich-rubyshift/][2015-12-munich-rubyshift/]]
- [[file:2015-11-munich-rubyshift/][2015-11-munich-rubyshift/]]
- [[file:2015-10-munich-rubyshift/][2015-10-munich-rubyshift/]]
- [[file:2015-05-munich-rubyshift/][2015-05-munich-rubyshift/]]
- [[file:2015-03-munich-rubyshift/][2015-03-munich-rubyshift/]]
- [[file:2014-leipzig-js/][2014-leipzig-js/]]
- [[file:2014-cologne-js/][2014-cologne-js/]]
- [[file:2012-lightning-io/][2012-lightning-io/]]
- [[file:2012-cologne.rb/][2012-cologne.rb/]]
- [[file:2012-cologne-rb-vagrant/][2012-cologne-rb-vagrant/]]
- [[file:2012-cologne-rb-faceblock/][2012-cologne-rb-faceblock/]]
- [[file:2011-pyconde/][2011-pyconde/]]

This is a (non-comprehensive) list of talks I gave at various user
groups & conferences. If you have any questions, feel free to reach
out for me via a GitHub issue in this repo.
Expand All @@ -20,3 +35,5 @@ bascht dot com~ and I will take it down.
Unless noted otherwise, all content in this repository is free for you
to use under the terms of the [[http://creativecommons.org/licenses/by-sa/4.0/][Attribution-ShareAlike 4.0 International
(CC BY-SA 4.0)]] license.

Generated: 2016-01-13 17:25:51 +0100
27 changes: 27 additions & 0 deletions README.org.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#+HTML_HEAD: <style type="text/css">body { font-family: Fira Sans, Helvetica, Arial, sans-serif; }</style>

* My Talks

<% talks.each do |talk| %>
- [[file:<%= talk %>][<%= talk %>]]<% end %>

This is a (non-comprehensive) list of talks I gave at various user
groups & conferences. If you have any questions, feel free to reach
out for me via a GitHub issue in this repo.

** Found license issues & copyright violations?
I tried my best to keep the original licenses and give credit to
original authors. If you miss photos from a Talk I gave, that probably
means that I couldn't find the author of the image or give proper
attribution.

If you find photos / images / text content in this repository that
violates intellectual property, please notify me at ~github dot com at
bascht dot com~ and I will take it down.

** License
Unless noted otherwise, all content in this repository is free for you
to use under the terms of the [[http://creativecommons.org/licenses/by-sa/4.0/][Attribution-ShareAlike 4.0 International
(CC BY-SA 4.0)]] license.

Generated: <%= Time.new %>
45 changes: 45 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -- encoding: utf-8 --
require 'logger'
require 'fileutils'
require 'erb'

@logger = Logger.new(STDOUT)
@logger.formatter = proc { |serverity, time, progname, msg| "#{time}#{msg}\n" }

def talks(file = "")
Dir.glob("[0-9]*/#{file}").sort.reverse
end

def dontbotherme(command)
@logger.info("Executing [#{command}]")
pid = spawn(command, [:out, :err] => '/dev/null')
Process.wait(pid)
end

task :ioslide do
system("git checkout gh-pages")
talks("README.org").each do |file|
path = File.dirname(file)
if File.exists?("#{path}/index.html")
@logger.warn("Skipping #{path}. Found an index.html.")
next
end

@logger.info("Building #{file}")
dontbotherme("emacs --batch -l ~//.emacs.d/init.el --visit=#{file} --funcall org-ioslide-export-to-html")
@logger.debug("Moving #{path}/README.html to #{path}/index.html")
FileUtils.move("#{path}/README.html", "#{path}/index.html")
end
@logger.info("Done building ioslides.")
end

task :index do
README = File.read('README.org.erb')
index = ERB.new(README).result(binding)
File.open('README.org', 'w') {|f| f.write(index) }
@logger.info("Rebuilt ORG index.")
dontbotherme("emacs --batch -l ~//.emacs.d/init.el --visit=README.org --funcall org-html-export-to-html")
@logger.info("Rebuilt HTML index. I'm done.")
end

task :default => [:ioslide, :index]

0 comments on commit e2507a9

Please sign in to comment.