Skip to content

Instantly share code, notes, and snippets.

<v-panel>
<v-vertical-layout margin spacing>
<v-label><h3>Sign In</h3></v-label>
<v-horizontal-layout spacing>
<v-text-field caption="Email" />
<v-password-field caption="Password" />
</v-horizontal-layout>
<v-button style-name="primary">Sign In</v-button>
</v-vertical-layout>
</v-panel>
@Artur-
Artur- / gist:4b2fb9549db4d7de23fb
Last active August 29, 2015 14:15
Find remote controls with size problems from TeamCity
$x("//a[@class='testWithDetails']").forEach(function(val) {val.click();} );
// Wait for all stack traces to load...
var remoteIps = {};
$x("//div[@class='fullStacktrace']").forEach(
function(val) {
var t = val.innerText ;
t = t.substring(0,t.indexOf("\n"));
if (t.indexOf("contained images with differing ") == -1)
return;
<?php
function mysqlGrid($table, $columns="") {
if ($columns=="") {
$columns = array();
$q = "DESC $table";
$r = mysql_query($q);
while ($row = mysql_fetch_row($r)) {
$columns[] = $row[0];
}
}
@Artur-
Artur- / gist:e5e4b23d6dcd53c90072
Last active August 29, 2015 14:22
Open test for Gerrit change
var hostname="172.16.11.253";
var changeId=document.evaluate("//a[contains(@title,'Reload the change')]",document.body).iterateNext().innerText;
var patchSet = document.body.innerText.match("Patch Sets \\(\\d+/(\\d+)\\)")[1];
var testClass;
try {
var file = document.evaluate("//td[text()='A']/..//a[contains(text(),'Test.java')]",document.body).iterateNext().innerText;
var start = file.lastIndexOf("/")+1;
var end = file.lastIndexOf("Test.java");
testClass = file.substring(start,end);
} catch (e) {
@Artur-
Artur- / gist:abac860b9e6e80b3bf29
Last active August 29, 2015 14:22
Measure todomvc selectall
var toggleAll=document.querySelector("#toggle-all");
var allCheckboxes = document.querySelectorAll("ul input[type=checkbox]");
var firstCheckbox = allCheckboxes[0];
var lastCheckbox = allCheckboxes[allCheckboxes.length-1];
waitFor = !toggleAll.checked;
console.log("Wait until "+waitFor);
var startTime = new Date();
toggleAll.click();
<script>
// Measure time from starting page load (enter in location bar)
// until all the items are shown
var i = setInterval(function() {
var e = document.getElementById("itemsLeft");
if (e) {
if (e.innerText == "1000 items left") {
done = window.performance.now(); // Relative to navigationStart (i.e. enter in loc
clearInterval(i);
window.alert("Initial load time: "+done+"ms");
@Push(transport = Transport.LONG_POLLING)
public class PushWithoutThreads extends DelayedUI {
@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = Vaadin7helloworldUI.class)
public static class Servlet extends VaadinServlet {
}
private VerticalLayout layout;
From cc81debbf5ca6b0979dbb2104b2ac60f6492c86c Mon Sep 17 00:00:00 2001
From: Artur Signell <artur@vaadin.com>
Date: Wed, 29 Jul 2015 18:16:22 +0300
Subject: [PATCH] Use two-step write so Tomcat correctly reports a dead
connection
Change-Id: Ief2a1111926eefcb131d082b453081c705103e86
---
.../org/atmosphere/cpr/AtmosphereResponse.java | 26 ++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
@Artur-
Artur- / Vaadin CLA
Last active September 21, 2023 06:05
Vaadin Contribution Agreement
This Vaadin Contribution Agreement (hereinafter "Agreement") is entered by and between Vaadin Ltd, a limited liability company duly incorporated and organized under the laws of Finland having its principal office at Ruukinkatu 2-4, 20540, Turku, Finland (hereinafter "Vaadin"), and any individual or entity that has executed this Agreement as identified in the signature page of this Agreement (hereinafter "You"), and is made as of the date signed on the signature page of this Agreement (hereinafter "Effective Date").
WHEREAS, Vaadin Ltd manages the Vaadin Project;
WHEREAS, You wish to contribute certain intellectual property defined hereunder to Vaadin and for the use of the Project;
NOW, THEREFORE, in consideration of the mutual covenants set forth herein and intending to be legally bound, You accept and hereby agree to the following terms and conditions pursuant to which You are willing to submit Your present and future Contributions to Vaadin:
@Artur-
Artur- / DesignAutowireConfiguration.java
Last active February 27, 2017 19:11
Configuration class for allowing @Autowired components in Vaadin Designer files
package com.vaadin.template.orders.app;
import org.springframework.beans.factory.BeanFactoryUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;
import com.vaadin.ui.Component;
import com.vaadin.ui.declarative.Design;
import com.vaadin.ui.declarative.Design.DefaultComponentFactory;