Skip to content

Instantly share code, notes, and snippets.

View heruan's full-sized avatar
:octocat:
Coding

Giovanni Lovato heruan

:octocat:
Coding
View GitHub Profile
@heruan
heruan / arr.json
Created May 29, 2015 15:03
Mapping JSON parsed object instances
[
{
"name": "John",
"age": 20
},
{
"name": "Jack",
"age": 28
}
]
@heruan
heruan / plurals.php
Created March 4, 2013 16:09
Code generated by jison PHP port
<?php
/* Jison generated parser */
class Parser
{
var $symbols_ = array();
var $terminals_ = array();
var $productions_ = array();
var $table = array();
var $defaultActions = array();
@heruan
heruan / gist:7458185
Created November 13, 2013 23:09
Boxen installation on Mavericks fails
$ sudo mkdir -p /opt/boxen
$ sudo chown ${USER}:staff /opt/boxen
$ git clone https://github.com/boxen/our-boxen /opt/boxen/repo
$ cd /opt/boxen/repo
$ git remote rm origin
$ git remote add origin git@github.com:heruan/our-boxen
$ git push -u origin master
$ script/boxen
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
Boxen is up-to-date.
@heruan
heruan / Company.java
Created February 26, 2016 16:11
Entity with multiple reference to a composite-id foreign key throws EntityExistsException
@Entity
public class Company {
@Id
public Long id;
}
@heruan
heruan / app.html
Created August 10, 2016 08:41 — forked from jdanyow/app.html
Aurelia Validation Demo
<template>
<require from="./registration-form"></require>
<registration-form></registration-form>
</template>
@heruan
heruan / flexbox.scss
Created January 26, 2017 14:35
Simple theme to make Valo layouts flexible
@import "../valo/valo";
.flexbox {
@include valo;
.v-layout, .v-slot {
display: flex;
flex-wrap: wrap;
}
@heruan
heruan / DownloadStreamWriter.java
Created June 16, 2017 11:02
Vaadin Resource for FileDownload which consumes OutputStream
import java.io.IOException;
import java.io.OutputStream;
import java.util.Iterator;
import java.util.function.Consumer;
import javax.servlet.http.HttpServletResponse;
import com.vaadin.server.Constants;
import com.vaadin.server.DownloadStream;
import com.vaadin.server.VaadinRequest;
@heruan
heruan / StreamDataProvider.java
Last active November 21, 2017 08:16
Transactional DataCommunicator and Grid for Flow
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Stream;
import com.vaadin.data.provider.AbstractBackEndDataProvider;
import com.vaadin.data.provider.Query;
public class StreamDataProvider<T> extends AbstractBackEndDataProvider<T, Predicate<T>> {
private final Supplier<Stream<T>> streamSupplier;
import java.util.Comparator;
import java.util.Optional;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class CustomComparatorTest {
static class CustomComparator<T> implements Comparator<T> {
Fadcfv59klSATAZN $2a$10$RAEHbnhGi2sEDZK.4TY8U.lMPlkHpIXKTHGJ14.p1ZHleYrbVsr9m
j45rXi0OKa8u33D4 $2a$10$ATQpY70dcknzJPFfj187kuoQvONWn328xCCueeoYSXiBMnUGlMR.O
cNf3MWvfXe15eiRX $2a$10$rWzF9S.irV.lNGlICnxzPe/wT/cyo3jizPS4QrRaUDbZG2Q6t2U6.
vQ89UmH6iiOTiuKi $2a$10$ATiaYx.hTFZdjwW2MQdwzOw1eZelVrn72dyP.Xm2gzBS5sgF3SpY6
dEI9NfMIZYur8iHq $2a$10$/JEz.YV/txRYLKkufjjHUO3ythe.tqzrI2JMJVSL8F8OUVGMbn4dS
v2YWtBd5sgBl8JKg $2a$10$5pxH3FKM.yh04OTrBPIMLO5LbBswmiLd3IFcT7fTeiKj5JK.DR0OG
pfwqWrUQwT00esAl $2a$10$Knf7o5f2TL6vZisvBDv1ye1i3uJ.ntubRuBHpl.OjhIr77oug3.Q6
NiyYaHLOj2wrUTDM $2a$10$FcmaVo.AUuO5CwbMsIm.ruNwiJttjI33bvcKR0vJWTnyJNd/jXZMW
qklrYaWsh4DdwbMN $2a$10$bQV71ZDm/xWm4H7DTFYp0ehDy/zF0xCOULuZNCHC0SjLh.3rxTr5.
Ck1pFOb1tMSRb573 $2a$10$3dMTbX0.3Oh6tyImAAmUMuFaOtekFIAlkiRxtzZILau1GPElwL7/.