Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Coding

Giovanni Lovato heruan

:octocat:
Coding
View GitHub Profile
@heruan
heruan / arr.json
Created May 29, 2015
Mapping JSON parsed object instances
View arr.json
[
{
"name": "John",
"age": 20
},
{
"name": "Jack",
"age": 28
}
]
@heruan
heruan / plurals.php
Created Mar 4, 2013
Code generated by jison PHP port
View plurals.php
<?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 Nov 13, 2013
Boxen installation on Mavericks fails
View gist:7458185
$ 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 Feb 26, 2016
Entity with multiple reference to a composite-id foreign key throws EntityExistsException
View Company.java
@Entity
public class Company {
@Id
public Long id;
}
@heruan
heruan / app.html
Created Aug 10, 2016 — forked from jdanyow/app.html
Aurelia Validation Demo
View app.html
<template>
<require from="./registration-form"></require>
<registration-form></registration-form>
</template>
@heruan
heruan / flexbox.scss
Created Jan 26, 2017
Simple theme to make Valo layouts flexible
View flexbox.scss
@import "../valo/valo";
.flexbox {
@include valo;
.v-layout, .v-slot {
display: flex;
flex-wrap: wrap;
}
@heruan
heruan / DownloadStreamWriter.java
Created Jun 16, 2017
Vaadin Resource for FileDownload which consumes OutputStream
View DownloadStreamWriter.java
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 Nov 21, 2017
Transactional DataCommunicator and Grid for Flow
View StreamDataProvider.java
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;
View CustomComparatorTest.java
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> {
View bcrypt-hashes.txt
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/.