Browse files

add Talks I've Given post, make the post-snippeting delimited on a HR…

… rather than hard-coded to 2-nodes
  • Loading branch information...
1 parent 9eef820 commit 325f74286854a461a2ac432eae12bb0f5e5431f6 @lihaoyi committed Feb 14, 2016
@@ -8,9 +8,9 @@ import scalatags.Text.all.{width, height, _}
import scalatags.Text._
import ammonite.ops._
-import collection.JavaConversions._
+import collection.JavaConverters._
import org.pegdown.{PegDownProcessor, ToHtmlSerializer, LinkRenderer, Extensions}
-import org.pegdown.ast.{VerbatimNode, ExpImageNode, HeaderNode, TextNode}
+import org.pegdown.ast.{VerbatimNode, ExpImageNode, HeaderNode, TextNode, SimpleNode}
val postsFolder = cwd/'posts
@@ -51,7 +51,7 @@ val posts = {
for ((index, name, path) <- split.sortBy(_._1.toInt)) yield {
val processor = new PegDownProcessor(Extensions.FENCED_CODE_BLOCKS)
val ast = processor.parseMarkdown(read! path toArray)
- object serializer extends ToHtmlSerializer(new LinkRenderer){
+ class Serializer extends ToHtmlSerializer(new LinkRenderer){
override def printImageTag(rendering: LinkRenderer.Rendering) {
printer.print("<div style=\"text-align: center\"><img")
printAttribute("src", rendering.href)
@@ -72,6 +72,7 @@ val posts = {
val id =
+ .asScala
.collect{case t: TextNode => t.getText}
@@ -93,13 +94,19 @@ val posts = {
- val rawHtmlContent = serializer.toHtml(ast)
- if (ast.getChildren.size > 0) {
- val firstNode = ast.getChildren.get(0)
- ast.getChildren.clear()
- ast.getChildren.add(firstNode)
- }
- val rawHtmlSnippet = serializer.toHtml(ast)
+ val rawHtmlContent = new Serializer().toHtml(ast)
+ val snippetNodes =
+ ast.getChildren
+ .asScala
+ .takeWhile{
+ case n: SimpleNode if n.getType == SimpleNode.Type.HRule => false
+ case _ => true
+ }
+ ast.getChildren.clear()
+ snippetNodes.foreach(ast.getChildren.add)
+ val rawHtmlSnippet = new Serializer().toHtml(ast)
val updates = DatesFor(s"posts/$index - ").toSeq
(name, rawHtmlContent, rawHtmlSnippet, updates)
@@ -8,6 +8,8 @@ I am not the first person to have a blog, nor the first person to have a
programming blog, nor is this my first blog. Nevertheless, for me, doing
this is a mix of new and old ideas.
## The Old
This is not the first time I have had a blog/site. I had built one back
@@ -11,6 +11,8 @@ or
Sometimes to realize later that the *they* is in fact, yourself!
You learn things to get the job done: the code's purpose, it's constraints and
abilities. Often though, you learn more than that: you feel the thoughts,
feelings and characters of the people who wrote it. You feel their
@@ -7,6 +7,8 @@ aiming to provide style guidelines at a "strategic" level. Above the level of
a developer working with the Scala language choose from the buffet of possible
## About Strategic Scala Style
These guidelines are based on my own experience working on open- and
@@ -0,0 +1,172 @@
+I've given a bunch of talks at meetup groups, industry conferences and academic
+workshops. Most of them are about my work in the Scala programming language.
+The actual recordings for these are slightly scattered, over a mix of Youtube
+videos, Vimeo, and some conference sites.
+Here's a consolidated list of their abstracts and videos. I'll keep this
+updated as time goes on.
+## Metascala: a tiny DIY JVM
+*Scala Exchange 2 Dec 2013*
+Metascala is a tiny metacircular Java Virtual Machine (JVM) written in the
+Scala programming language. Metascala is barely 3000 lines of Scala, and is
+complete enough that it is able to interpret itself metacircularly. Being
+written in Scala and compiled to Java bytecode, the Metascala JVM requires a
+host JVM in order to run.
+The goal of Metascala is to create a platform to experiment with the JVM: a
+3000 line JVM written in Scala is probably much more approachable than the
+1,000,000 lines of C/C++ which make up HotSpot, the standard implementation,
+and more amenable to implementing fun features like continuations, isolates or
+value classes. The 3000 lines of code gives you:
+- The bytecode interpreter, together with all the run-time data structures
+- A stack-machine to SSA register-machine bytecode translator
+- A custom heap, complete with a stop-the-world, copying garbage collector
+- Implementations of parts of the JVM's native interface
+## Live-Coding Scala.js
+*SF Scala Meetup 28 Feb 2014*
+Scala like you've never seen it before! Live reloading, in the browser, on the
+canvas, with the DOM.
+## Fun Functional-Reactive Programming with Scala.Rx
+*Scaladays 17 Jun 2014*
+Scala.Rx is a change propagation library for Scala, that provides reactive
+values that save you the hassle of having to keep mutable variables in sync
+manually. This goes into the motivation behind the library, shows off some cool
+demos, and hopefully persuades you that Scala.Rx is a useful tool in managing
+messy, stateful applications.
+## Cross-platform development with Scala.js
+*Scala by the Bay 9 Aug 2014*
+This talk will explore the developer experience of using ScalaJS, from the
+boring-but-important cross-JVM/JS libraries, to pure-Scala client-server web
+applications, to whiz-bang ScalaJS games and animations. As the person who has
+written more ScalaJS code than anyone on the planet (!) I will go through the
+ups and downs of ScalaJS development, and demonstrate why you may want to try
+it out for your next round of web development.
+## Hands-On Scala.js
+*Pacific-North-West Scala 14 Nov 2014*
+A talk I gave at This is a hands-on tutorial that goes
+through what it's like getting started with Scala.js, introducing the project
+and walking through the experience of how to do common things on the Scala.js
+## Bootstrapping the Scala.js Ecosystem
+*Scala Exchange 7 Dec 2014*
+What does it take to go from a working compiler to a workable, productive
+platform? This presentation explores the range of libraries that needed to
+be built in order to turn Scala.js from a prototype to a product
+## Scala.js - Safety & Sanity in the wild west of the web
+*PhillyETE 8 Mar 2015*
+Developing for the web platform has historically been a slow, painful,
+fragile experience. You write code in multiple different languages, work
+with undocumented APIs, and are forced to implement things twice to have
+them work on both client and server. Lastly, you had better be the
+meticulous sort, because a single typo will bring down your site: at
+runtime, in production!
+Scala.js is an attempt to fix this problem. Like other compile-to-JS languages,
+it provides a concise, expressive language to do your work. Unlike others, it
+also promises seamless interop with Javascript, a ready-to-go ecosystem, tool
+support, and a smooth development experience. Above all, Scala.js provides
+Safety: an extreme level of safety that goes far beyond any competitor. Not
+only is your Scala.js code checked, but any use of Javascript APIs is also
+checked, and so are your Ajax calls between client and server!
+## Why (You might like) Scala.js
+*Scaladays 17 Mar 2015*
+Scala.js compiles Scala to Javascript. Why should you, as an individual, care?
+This talk discusses the things you can get out of Scala.js, starting from
+three main archetypes: Scala web developer, Scala non-web developer, and
+## Beyond Bash
+*Scala by the Bay 12 Aug 2015*
+The Scala REPL has been often touted as an advantage for the language: an
+interactive, exploratory experience very different from the static,
+often-IDE-based experience that for many is the bulk of their experience
+using Scala. Nevertheless, in comparison, the Scala REPL really sucks: buggy
+& unfriendly, it is not a place you want to spend most of your time.
+What if the Scala REPL had the same autocomplete as you'd get in Eclipse or
+IntelliJ? What if it had syntax-highlighting for everything? What if you could
+load libraries like Shapeless or Akka-HTTP to try out, without needing to muck
+with SBT? What if your Scala REPL was as versatile, usable and configurable as
+Bash or Zsh, and could be used as your home on the command line?
+## FastParse: Fast, Modern Parser Combinators
+*SF Scala Meetup 13 Oct 2015*
+Parsing text is typically difficult. As a programmer you have tools ranging
+from String#split (convenient and fast but inflexible) to Lex/Yacc/Antlr (fast
+and flexible but inconvenient) and parser combinators (convenient, flexible
+but very slow!)
+This talk introduces FastParse, a parser-combinator library for the Scala
+programming language, that aims to find a middle ground between all these
+alternatives. Convenient, flexible and fast, I'll show how code using FastParse
+looks almost the same as code using the in-built parser-combinators, but comes
+with an 85x (8500%!) speedup at run-time. I'll talk about how FastParse
+provides unprecedentedly good, structured error reporting for you to use to
+debug your parser (or help your users debug their input) and finish off with
+some demo live-coding of a language of the audience's choice.
+## Fast, Modern, OO Parser Combinators
+*Parsing@SLE, SPLASH 24 Oct 2015*
+A quick, 30 minute overview of the features and usage of the FastParse parser
+combinator library, allowing you to quickly write
+high-performance, debuggable, fail-friendly parsers
+## Shell-scripting in a Typed, OO Language
+*New Object Oriented Languages, SPLASH 28 Oct 2015*
+Talk given 27 October 2015 at the Zeroth Workshop for New Object Oriented
+What if instead of Bash, you could use a real, modern programming language to
+use as your systems shell? I'll spend 30 minutes talking about why people use
+Bash over other contemporary languages, how the Ammonite Scala REPL plays
+catch-up, and highlight various ways in which the experience benefits from
+using a statically-typed, object-oriented language running on the JVM.

0 comments on commit 325f742

Please sign in to comment.