View wdio-example.js
describe.only('example', function () {
it('should find visible element, low arity', function () {
browser.execute(function () {
document.body.innerHTML = '<div id="a" class="a">foo</div><div id="b">blah</div>';
});
// We pretend we're waiting on a list of dom elements to be
// created.
browser.waitUntil(
() => browser.elements('//*[@class="a"]').value.length > 0,
View spark.clj
(ns try-spark.spark
(:refer-clojure :exclude [map filter reduce first name take min distinct max count])
(:require [clojure.core :as core])
(:require [clojure.reflect :as r])
(:import org.apache.spark.sql.api.java.JavaSchemaRDD))
; Parameter classes that we have to wrap in order to
; call rdd methods with plain clojure functions.
(def func-types
(into #{}
View bean.clj
(let [t (fn [type prop] ; type hint a property
(with-meta prop {:tag type}))
cc (fn [prop] ; camel-case a property
(str (.toUpperCase (subs (str prop) 0 1)) (subs (str prop) 1)))
m (fn [prop method] ; construct method name for property
(symbol (str method (cc prop))))
bean-interface (fn [bean-name & props] ; define interface for bean
(let [set (fn [type prop]
`(~(m prop 'set) [~(t type 's)]))
View fizzbizz
(defn fizzbizz [x]
(reduce (fn [a [s d]] (get [s] (mod x d) a))
x
[["bizz" 5]["fizz" 3]["fizzbizz" 15]]))
View haml2.js
// haml loader for requirejs
(function() {
function register(text, haml) {
var plugin = Object.create(text); // inherit methods of the text loader
function wrapload(fn) {
return function(value) {
fn(haml.compileHaml({source: value}));
}
View haml.js
define(['text', 'lib/haml'], function(text, haml) {
var plugin = Object.create(text); // inherit methods of the text loader
function wrapload(fn) {
return function(value) {
fn(haml.compileHaml({source: value}));
}
}
function load(name, req, onload, config) {
View loaderPlugin.js
(function() {
var loadSource = function(file, onSourceLoad) {
if (!file.fileSrc.match(/js-test/)) {
return false;
}
require([file.fileSrc], function() {
onSourceLoad({file: file, success: true, message: ''});
}, function(err) {