- How is overflow handled?
- What is the behavior if the text/title is empty?
- Where does it go?
<!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> |
<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> |
# 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 |
// 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)); |
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: _*) |
// 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") |
// reporting library | |
// http://stackoverflow.com/questions/9160001/how-to-profile-methods-in-scala | |
def perf[R](block: => R): Unit = { | |
val t0 = System.nanoTime() | |
block | |
val t1 = System.nanoTime() | |
val elapsed = (t1 - t0) / 1000000000f | |
println("Elapsed time: " + elapsed + "s") |
implicit class Unlessable[A](a: => A) { | |
def unless(p: => Boolean) = if (!p) Some(a) else None | |
} | |
implicit class Iffable[A](a: => A) { | |
def iff(p: => Boolean) = if (p) Some(a) else None | |
} | |
// Class | |
package presenters.poiattributes | |
import scala.language.implicitConversions | |
import play.api.templates.Html | |
trait AttributePresenter { | |
val identifier: String | |
val value: Any |