This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Polymer outside click element | |
window.addEventListener((e) { | |
var target = event.target; | |
while(target != this && target != document.body) { | |
target = Polymer.dom(target).node.domHost.parentNode; | |
// might need some additional steps to get the parent from inside custom elements | |
// don't know by heart | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IConnect { | |
public void connect() throws CriticalException; | |
} | |
public class ReconnectProxy implements InvocationHandler { | |
public static final long RECONNECT_DELAY = 5000; | |
public static final String MESSAGE_CONNECT = "connect"; | |
ExecutorService threadPool; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
child.html | |
<div class="part"> | |
<style> | |
h3 { | |
color: red !important; | |
} | |
</style> | |
<h3>Warning!</h3> | |
<p>This page is under construction</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<div id="wrapper"> | |
</div> | |
<div>This has normal color.</div> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<template id="my-template"> | |
<h1>Hello world from template!</h1> | |
</template> | |
<div id="parent"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script> | |
class HelloWorld extends HTMLElement { | |
constructor() { | |
super(); | |
let shadowRoot = this.attachShadow({ | |
mode: 'open' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Integer> l = Arrays.asList(new Integer[]{1,2,3}); | |
Integer min = l.stream().min(Integer::compare).get(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// index.js | |
const path = require('path'); | |
const Queue = require('bull'); | |
let queue = new Queue('test queue', 'redis://192.168.99.100:6379'); | |
queue.process(1, path.join(__dirname, './processor.js')) | |
queue.on('completed', function(job, result) { | |
console.log("Completed: " + job.id + ", result = " + JSON.stringify(result)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:8-jre-alpine AS base | |
ENV GREENMAIL_OPTS -Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.smtp.hostname=localhost -Dgreenmail.verbose | |
RUN apk add --no-cache curl | |
RUN curl -O http://central.maven.org/maven2/com/icegreen/greenmail-standalone/1.5.9/greenmail-standalone-1.5.9.jar | |
FROM openjdk:8-jre-alpine AS final |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Stack; | |
public class XmlValidator { | |
public boolean isValid(String xml) { | |
Stack<String> stack = new Stack<>(); | |
boolean opening = false; | |
boolean closing = false; |
OlderNewer