Skip to content

Instantly share code, notes, and snippets.

@grawk
grawk / gradtype.json
Created March 26, 2018 14:48
gradtype
[{"ts":16.559,"k":"I"},{"ts":16.65,"k":" "},{"ts":16.778,"k":"s"},{"ts":16.907,"k":"u"},{"ts":17.026,"k":"p"},{"ts":17.178,"k":"p"},{"ts":17.33,"k":"o"},{"ts":17.386000000000003,"k":"s"},{"ts":17.442,"k":"e"},{"ts":17.506,"k":" "},{"ts":17.618,"k":"o"},{"ts":17.698,"k":"n"},{"ts":17.803,"k":"e"},{"ts":17.898,"k":" "},{"ts":17.979000000000003,"k":"m"},{"ts":18.155,"k":"u"},{"ts":18.21,"k":"s"},{"ts":18.266,"k":"t"},{"ts":18.331000000000003,"k":" "},{"ts":18.467,"k":"b"},{"ts":18.595,"k":"e"},{"ts":18.69,"k":" "},{"ts":18.779,"k":"s"},{"ts":18.843,"k":"e"},{"ts":18.914,"k":"r"},{"ts":19.035,"k":"i"},{"ts":19.107000000000003,"k":"o"},{"ts":19.162,"k":"u"},{"ts":19.235000000000003,"k":"s"},{"ts":19.338,"k":" "},{"ts":19.467,"k":"s"},{"ts":19.523,"k":"o"},{"ts":19.603,"k":"m"},{"ts":19.706000000000003,"k":"e"},{"ts":19.826,"k":"t"},{"ts":19.922,"k":"i"},{"ts":20.003,"k":"m"},{"ts":20.051,"k":"e"},{"ts":20.114,"k":"s"},{"ts":20.194,"k":"."},{"ts":21.219,"k":"G"},{"ts":21.419,"k":"o"},{"ts":21.907,"k":"o"},{"ts":22.
@grawk
grawk / nemo-firefox-profile.md
Created June 7, 2017 20:48
Nemo using firefox profile

Using the selenium-webdriver/firefox module to set firefox profile in nemo

Use the "builders" version of the driver configuration:

  "driver": {
    "builders": {
      "forBrowser": ["firefox"],
      "setFirefoxOptions": ["require:./firefoxProfile"]
 }
@grawk
grawk / nextTick.js
Created June 2, 2017 16:19
nextTick
var queue = [];
for (var i = 0; i < 10; i++) {
queue.push(function () {
process.nextTick(function () {
console.log(Date.now());
(queue.length > 0) ? queue.shift()() : null;
});
});
}
queue.shift()();
@grawk
grawk / nemo-setup-util.js
Last active October 14, 2016 21:24
sample nemo-view/mocha setup routine
'use strict';
var Nemo = require('nemo');
module.exports.nemoSetup = function (before, after, addUserFlag) {
before(function (done) {
this.nemo = Nemo(function (err) {
if (err) {
done(err);
@grawk
grawk / drivextest.js
Created March 16, 2015 20:30
illustrate waitForElementVisible test
describe("@waitForElementVisible@ method", function() {
it("should be visible", function () {
assert.ok(nemo.drivex.waitForElementVisible);
});
it("should return true when an element is visible", function(done) {
nemo.driver.get(nemo.props.targetBaseUrl + '/waits');
nemo.drivex.waitForElementVisible({'locator': 'body', 'type': 'tagName'}, 5000, "couldn't find body tag").then(function(found) {
assert.equal(found, true);
done();
});
@grawk
grawk / lusca-express4-example.js
Created August 15, 2014 01:30
krakenjs/lusca express4 example app
'use strict';
var express = require('express'),
cookieParser = require('cookie-parser'),
session = require('cookie-session'),
bodyParser = require('body-parser'),
errorHandler = require('errorhandler'),
lusca = require('./index'),
h = ['<html><head><title>views</title></head><body><h1>', '</h1><form method="POST" action="/"><input type="hidden" name="_csrf" value="', '"/><input type="submit" value="Submit"/></form></body></html>'],
@grawk
grawk / kraken-examples-routes.md
Last active August 29, 2015 14:05
discussion of kraken-examples routes

is this what you think routes/index.js should look like:

'use strict';

var IndexModel = require('../models/index');
var setLocale = require('./setLocale');

module.exports = function (router) {
 router.get('/', indexRoute);
@grawk
grawk / moq-nemo-preso.md
Last active August 29, 2015 14:01
Masters Of Quality Nemo Presentation Outline

MOQ Nemo Preso outline

  1. generate a new kraken-js based express app
  2. start and display the app
  3. generate a nemo test suite for the app
  4. run on different browsers, and on devices (via saucelabs)
  5. install a new plugin using generator
  6. add new functionality to app, then add a new view and spec to test it
/*global describe:true, it:true, before:true, after:true */
'use strict';
var nemoFactory = require('nemo-mocha-factory'),
plugins = require('../config/nemo-plugins'),
setup = {
"view": ['addcard']
};
describe('Nemo @addcardSuite@', function() {