Skip to content

Instantly share code, notes, and snippets.

View diuis's full-sized avatar

diuis diuis

  • Intesa SanPaolo
  • Milan, Italy
View GitHub Profile
@diuis
diuis / iprangevalidation
Last active February 27, 2020 13:25
ip range validation
import static org.assertj.core.api.Assertions.assertThat;
import java.math.BigInteger;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Optional;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
{
"Booking": {
"detailedPrice": {
"running": 9.94,
"parked": 0,
"free": 0,
"prepaid": 0,
"outOfGeoFence": 0,
"adjustment": 0,
"vat": 2.18
@diuis
diuis / tsconfig
Created October 24, 2018 13:14
tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"outDir": "build/dist",
"module": "esnext",
"target": "es2017",
"lib": ["es7", "dom"],
"sourceMap": true,
"allowJs": false,
"jsx": "react",
@diuis
diuis / githubpages
Last active October 25, 2018 16:02
install hub : https://github.com/github/hub
on mac os x:
brew install hub
add to ~/.ssh/config :
Host github
HostName github.com
PubKeyAuthentication yes
IdentityFile ~/.ssh/id_rsa
@diuis
diuis / react starter
Last active October 24, 2018 09:00
react web app
https://github.com/Microsoft/TypeScript-React-Starter
npm init
npm install -g create-react-app
create-react-app vto-mirror-demo --scripts-version=react-scripts-ts
git init
@diuis
diuis / gist:fc1c2f0e255538cda397c5a6b669c9bf
Created October 5, 2018 13:24
react video element iOS autoplay
import * as React from "react";
import { Container, Row, Col } from 'reactstrap';
import '../styles/video-react.css'
export interface ApplicationProps { url: string; }
export class Application extends React.Component<ApplicationProps, {}> {
private videoNode: HTMLVideoElement;
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<configuration>
<to>
<image>gcr.io/xxx-catalogue/xxx-catalog-be:${project.version}</image>
<auth>
<username>_json_key</username>
<password>${env.GCR_JSONKEY}</password>
</auth>
@diuis
diuis / gist:199e9e09e5bc9ebe95a2339c296b6135
Created September 7, 2018 14:29
jib maven dockerhub registry auth
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<configuration>
<to>
<image>xxx/xxx-catalogue-be:${project.version}</image>
<auth>
<username>${env.DOCKERHUB_USERNAME}</username>
<password>${env.DOCKERHUB_PASSWORD}</password>
</auth>
@diuis
diuis / gist:cfc2577e43d2ce7bb156ba06d0bccead
Last active July 27, 2018 12:51
meecrowave 1.2.3 and geronimo openapi 1.0.1
> mvn -f vto-catalogue-be/pom.xml meecrowave:bake Fri Jul 27 11:45:33 2018
11:45:36 [INFO] Scanning for projects...
11:45:37 [WARNING]
11:45:37 [WARNING] Some problems were encountered while building the effective model for com.***.***.vto:vto-catalogue-be:jar:1.0.0-SNAPSHOT
11:45:37 [WARNING] 'dependencies.dependency.scope' for com.***.***.vto:vto-bom:pom must be one of [provided, compile, runtime, test, system] but is 'import'. @ com.***.***.vto:vto-catalogue-be:[unknown-version], /Users/dgallisto/jee/eclipse-workspaces/***-workspace/vto-catalogue/vto-catalogue-multi-module/vto-catalogue-be/pom.xml, line 39, column 14
11:45:37 [WARNING]
11:45:37 [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
11:45:37 [WARNING]
11:45:37 [WARNING] For this reason, future Maven versions might no longer support bu
@diuis
diuis / gist:8b4c8784c844783eb4bc334cff617b73
Created November 21, 2017 15:44
infinispan 9.1.3 sqlserver jdbc store config
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.jmxStatistics()
.disable();
builder.clustering()
.cacheMode(CacheMode.LOCAL);
builder.persistence()
.passivation(false)
.addStore(JdbcStringBasedStoreConfigurationBuilder.class)
.dialect(DatabaseType.SQL_SERVER)
.fetchPersistentState(false)