Paste this to your browser url bar:
data:text/html,
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="A sample react dropdown menu component" /> | |
<script src="//fb.me/react-with-addons-0.10.0.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="menu"></div> |
var casper = require("casper").create(); | |
var arr1 = [], arr2 = [], arr3 = []; | |
casper.start("http://foo.bar/", function() { | |
arr1.push("plop1"); | |
}); | |
casper.thenOpen("http://bar.foo/", function() { | |
arr2.push("plop2"); | |
}); |
var l10n = { | |
translate: function(el) { | |
console.log("l10n.translate() called for ", el); | |
} | |
}; | |
function makeL10n(ViewClass) { | |
var oldRender = ViewClass.prototype.render; | |
ViewClass.prototype.render = function renderL10n() { | |
oldRender.apply(this, arguments); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<ul id="list"> | |
<li>nope</li> | |
</ul> | |
<input type="button" id="btn" value="change"> |
{ | |
"bold_folder_labels": true, | |
"caret_style": "smooth", | |
"color_scheme": "Packages/User/Flatland Monokai (SL).tmTheme", | |
"default_encoding": "UTF-8", | |
"detect_slow_plugins": false, | |
"draw_minimap_border": false, | |
"draw_white_space": "all", | |
"ensure_newline_at_eof_on_save": true, | |
"fade_fold_buttons": true, |
(defn default-hash-map [default keys] | |
(into {} (map #(hash-map % default) (seq keys)))) | |
;; user> (default-hash-map 0 [:a :b]) | |
;; {:a 0, :b 0} |
module.exports = function Words(words) { | |
"use strict"; | |
function frequencies(freq, word) { | |
freq[word] = word in freq ? freq[word] + 1 : 1; | |
return freq; | |
} | |
return { | |
get count() { |
"use strict"; | |
function is_silence(message) { return message.length === 0; } | |
function is_shouting(message) { return message.toUpperCase() === message; } | |
function is_question(message) { return message.slice(-1) === '?'; } | |
module.exports = function Bob() { | |
var defaults = "Whatever."; | |
var reactions = [[is_silence, "Fine, be that way!"], | |
[is_shouting, "Woah, chill out!"], |
casper.test.begin('Testing HTTP headers', 1, function(test) { | |
casper.start('http://google.com/', function(res) { | |
test.assertEquals(res.headers.get('Content-Type'), 'text/html; charset=UTF-8'); | |
}); | |
casper.run(function() { | |
test.done(); | |
}); | |
}); |