- How is overflow handled?
- What is the behavior if the text/title is empty?
- Where does it go?
// reporting library | |
// http://stackoverflow.com/questions/9160001/how-to-profile-methods-in-scala | |
def perf[R](block: => R): Unit = { | |
val t0 = System.nanoTime() | |
for(_ <- 1 to 1000000) block | |
val t1 = System.nanoTime() | |
val elapsed = (t1 - t0) / 1000000000f | |
println("Elapsed time: " + elapsed + "s") |
import scala.util.parsing.combinator.JavaTokenParsers | |
object Parser extends JavaTokenParsers { | |
object Renderer { | |
def render(ms: List[Module]): String = { | |
// Assemble a map | |
val names = ms.map(_.name) | |
val modules = Map(names.zip(ms).toArray: _*) |
// Javascript | |
jQuery.fn.on_original = jQuery.fn.on; | |
jQuery.fn.on = function() { | |
var args = Array.prototype.slice.call(arguments, 0); | |
var events = args[0]; | |
var params = args.slice(1); | |
events.split(' ').forEach(function(ev) { | |
var eventArgs = params.slice(0).unshift(ev); | |
jQuery.fn.on_original.apply(this, eventArgs); | |
}.bind(this)); |
# Download the repo the first time | |
git clone git://github.com..... | |
# Update the whole repo with everything | |
git pull | |
# Update from a specific branch | |
git pull origin release | |
# Bring in only 1 commit |
<input type="checkbox" data-represents="voting" /> | |
$('input[type="checkbox"]').change(function() { | |
var represents = $(this).attr('data-represents'); | |
$('[data-' + represents +'="true"]').show(); | |
}); | |
<div data-voting="true"></div> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Examples</title> | |
<!-- Tags have a default attribute which can be ommitted --> | |
<meta="keywords" content="template language" /> | |
<meta="author" content="template language" /> | |
<script> |
#!/usr/bin/env ruby | |
# | |
# Use: | |
# | |
# => cfl | |
# => cfl all | |
# => cfl last | |
# => cfl last 3 | |
# |
# | |
# Slim Using Longhand (full tags) | |
# slim-lang.org | |
# | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Slim Examples</title> |
<!DOCTYPE> | |
<html> | |
<body> | |
<script type="text/javascript"> | |
var base10 = { | |
increment: function(v) { | |
var incrementBit = function(bits) { | |
var b = bits[0]; | |
if (b == '0') { | |
bits.splice(0, 1, '1'); |