Skip to content

Instantly share code, notes, and snippets.

View juanpicado's full-sized avatar
:octocat:
regular maintenance time

Juan Picado juanpicado

:octocat:
regular maintenance time
View GitHub Profile
@juanpicado
juanpicado / gist:2246772
Created March 30, 2012 05:18
Ignore testDashBoardController
@Test
@Ignore
public void testDashBoardController() throws Exception {
DashBoardController controller = this.dashBoardController;
request = new MockHttpServletRequest(MethodJson.GET.toString(), "/user/dashboard");
final ModelAndView mav = handlerAdapter.handle(request, response, controller);
assertViewName(mav, "dashboard");
}
@juanpicado
juanpicado / gist:4075433
Created November 14, 2012 22:53
Subquery Example
@SuppressWarnings("unchecked")
public List<TweetPoll> getTweetPollsbyHashTagNameAndDateRange(
final String tagName,
final SearchPeriods period) {
final DetachedCriteria detached = DetachedCriteria
.forClass(TweetPoll.class)
.createAlias("hashTags", "hashTags")
.setProjection(Projections.id())
.add(Subqueries.propertyIn(
"hashTags.hashTagId",
@juanpicado
juanpicado / m.controller.js
Last active December 16, 2015 11:28
Marionette.js basic controller
var Controller = Marionette.Controller.extend({
initialize : function(options) {
//TODO: initialize code
},
start: function(){
//TODO: code to start
}
});
@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
@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
// 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 / 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>
@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 / 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.
*/