Skip to content

Instantly share code, notes, and snippets.

View mcollovati's full-sized avatar

Marco Collovati mcollovati

View GitHub Profile

Oracle Express Edition 11g

SELECT
	CURRENT_TIMESTAMP AS before_currdate,
	CURRENT_DATE      AS currdate,
	CURRENT_TIMESTAMP AS after_currdate
FROM DUAL;
@mcollovati
mcollovati / ExtendedSessionImpl.java
Last active March 28, 2018 19:36
Vertx Session Serialization
class ExtendedSessionImpl ExtendedSessionImpl implements ExtendedSession, Shareable, ClusterSerializable {
// The original Vert.x Session
// I need to expand it with the createdAt attribute
Session delegate;
@Override
public void writeToBuffer(Buffer buffer) {
buffer.appendLong(createdAt);
if (useKryo) {
@mcollovati
mcollovati / CallsView.java
Last active March 19, 2018 13:53
TextArea Push Example
public class CallsView extends HorizontalLayout implements MyListener {
private TextArea textArea;
public CallsView() {
setSizeFull();
textArea = new TextArea();
textArea.setSizeFull();
this.addComponent(textArea);
}
window.com_github_mcollovati_vaadin_MyExtension = function() {
var me = this;
var btn = me.getElement(me.getParentId());
btn.onclick = function() {
// call external lib with extension callback
externalLib.doSomething(me.myCallback);
}
}
window.com_github_mcollovati_vaadin_ClipboardCopy = function() {
var me = this;
var el = me.getElement(me.getParentId());
el.onclick = function() {
console.log("exec copy");
document.execCommand('copy');
console.log("exec copy dones");
}