Skip to content

Instantly share code, notes, and snippets.

View juanpicado's full-sized avatar
🎯
Focusing

Juan Picado juanpicado

🎯
Focusing
View GitHub Profile
@juanpicado
juanpicado / emitter.js
Last active August 29, 2015 14:23 — forked from brentertz/emitter.js
var util = require('util'),
EventEmitter = require('events').EventEmitter;
var Server = function() {
var self = this;
this.on('custom_event', function() {
self.logSomething('custom_event');
});
@juanpicado
juanpicado / Future Promise
Last active August 29, 2015 14:23
Promise future and past
var foo = function(a){
var promise = new Promise();
asyncAjaxFunction(a).done(function(){
promise.resolve();
}).fail(function(){
promise.reject();
})
};
foo.then(function(){
@juanpicado
juanpicado / example.ts
Last active August 29, 2015 14:19
typescript example
class Animal {
constructor(public name) { }
move(meters) {
alert(this.name + " moved " + meters + "m.");
}
}
class Snake extends Animal {
move() {
alert("Slithering...");
@juanpicado
juanpicado / exec.js
Last active August 29, 2015 14:06 — forked from Stuk/exec.js
var spawn = require("child_process").spawn;
var Q = require("q");
/**
* Wrap executing a command in a promise
* @param {string} command command to execute
* @param {Array<string>} args Arguments to the command.
* @param {string} cwd The working directory to run the command in.
* @return {Promise} A promise for the completion of the command.
*/
@juanpicado
juanpicado / gist:89ac0ea6153aeb27ebef
Created September 4, 2014 22:03
dojo widget jsp binding
<div id="chart" data-dojo-type="me/web/widget/tweetpoll/detail/TweetPollChartDetail"
tweetPollid="${tweetpoll.id}"
question="${tweetpoll.questionBean.questionName}"
completed="${tweetpoll.completed}"
username="${tweetpoll.ownerUsername}"></div>
@juanpicado
juanpicado / gist:0373dead1cce88e3b2bf
Created July 24, 2014 17:19
dojo download via Maven
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>1.0-beta-1</version>
<executions>
<execution>
<id>download-dojo</id>
<phase>generate-resources</phase>
<goals>
<goal>download-single</goal>
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
@juanpicado
juanpicado / chromedriver_android_device_wdjs.md
Last active April 6, 2017 09:21
Running Test in Chromedriver + wd.js + Android Device

Running Test in Chromedriver + wd.js + Android Device

Setup the Environment

$you> adb start-server
$you> adb devices
List of devices attached
@juanpicado
juanpicado / gist:7686130abc1cd1417b92
Last active August 29, 2015 14:01
How to get the console.log in Android stock browser

How to get the console.log in Android stock browser

Just type this command

adb logcat browser:I *:S