Skip to content

Instantly share code, notes, and snippets.

@Stuk
Stuk / promise-debug.js
Last active October 2, 2016 21:39
I've found this code useful for debugging promises, to find what order things are happening in. `console.error` gives a stack trace in the Webkit Developer Tools which makes easily narrow down where the promise creation and resolution is happening.
var Q = require("q");
var Set = require("collections/set"); // https://npmjs.org/package/collections
window.outstandingPromises = new Set();
var originalDefer = Q.defer;
Q.defer = function () {
console.error("Deferred created");
var deferred = originalDefer();
deferred.stack = new Error("").stack;
window.outstandingPromises.add(deferred);
var Serializer = require("montage/core/serialization").Serializer;
var MyComponent = Montage.create(Component, {
handleButtonClick: {
value: function (event) {
var serializer = Serializer.create().initWithRequire(require);
var serialization = serializer.serialize(this.theObjects);
console.log(serialization);
@Stuk
Stuk / README.md
Last active December 11, 2015 11:08
Montage app template

{{name}}

This is the Montage app template.

Note: Before working on your app you will need to add montage to it.

npm install .
@Stuk
Stuk / gist:3106155
Created July 13, 2012 17:31
Creating a new application with Montage minit
$ ../montage/tools/minit/minit app hello
* Clone Montage to your app:
git clone [email protected]:Motorola-Mobility/montage.git hello/node_modules/montage
* or add it as a submodule:
cd hello
git init
git submodule add [email protected]:Motorola-Mobility/montage.git node_modules/montage
Template expansion successful!
@Stuk
Stuk / gist:3106121
Created July 13, 2012 17:25
Creating a new component with Montage minit
$ ls
index.html node_modules package.json ui
$ ./node_modules/montage/tools/minit/minit component my-component MyComponent
my-component.reel created.
Template expansion successful!
$ ls ui/
main.reel my-component.reel
/**
* Known element location strategies. The returned objects have two
* methods on them, "single" and "many", for locating a single element
* or multiple elements, respectively.
*
* @private
* @const
* @type {Object.<string,bot.locators.strategy>}
*/
bot.locators.STRATEGIES_ = {
~/s/w/driver:master$ pwd
/home/stuart/src/watir/driver
~/s/w/driver:master$ mvn -f maven/pom.xml release:perform
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'release'.
[INFO] ------------------------------------------------------------------------
[INFO] Building OperaDriver
[INFO] task-segment: [release:perform] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [release:perform {execution: default-cli}]
import com.opera.core.systems.*;
import org.openqa.selenium.*;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.util.*;
import org.openqa.selenium.interactions.*;
class Example {
static RemoteWebDriver driver;
import com.opera.core.systems.*;
import com.opera.core.systems.settings.OperaDriverSettings;
import org.openqa.selenium.*;
import java.util.*;
import org.openqa.selenium.interactions.*;
class Example {
public static void main(String[] args) {
OperaDriver driver = new OperaDriver();