Skip to content

Instantly share code, notes, and snippets.

View mcupak's full-sized avatar

Miro Cupak mcupak

View GitHub Profile
@mcupak
mcupak / .travis.yml
Last active February 20, 2019 20:44
language: java
dist: trusty
sudo: false
jdk:
- openjdk8
env:
- GH_URL=https://raw.githubusercontent.com VALIDATOR_URL=http://localhost:8080/validator/debug?url FILE_TO_VALIDATE=openapi.yaml URL_TO_VALIDATE=$GH_URL/${TRAVIS_PULL_REQUEST_SLUG:-$TRAVIS_REPO_SLUG}/${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}/$FILE_TO_VALIDATE
before_install:
# Build and start validator-badge. This setup will not be needed once the online version of validator-badge supports OAS 3.0. Until then we'll need to set up a local version.
- git clone --branch=v2.0.0 https://github.com/swagger-api/validator-badge.git
before_install:
# Build and start validator-badge. This setup will not be needed once the online version of validator-badge supports OAS 3.0. Until then we'll need to set up a local version.
- git clone --branch=v2.0.0 https://github.com/swagger-api/validator-badge.git
- cd validator-badge
- mvn package -q -DskipTests=true -Dmaven.javadoc.skip=true -B -V jetty:run &
- cd ..
- sleep 60
env:
- GH_URL=https://raw.githubusercontent.com VALIDATOR_URL=http://localhost:8080/validator/debug?url FILE_TO_VALIDATE=openapi.yaml URL_TO_VALIDATE=$GH_URL/${TRAVIS_PULL_REQUEST_SLUG:-$TRAVIS_REPO_SLUG}/${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}/$FILE_TO_VALIDATE
language: java
dist: trusty
sudo: false
jdk:
- openjdk8
@mcupak
mcupak / .travis.yml
Last active January 24, 2019 22:31
Obtaining a URL to a file in a GitHub repository in a Travis CI build
env:
- FILE_URL=https://raw.githubusercontent.com/${TRAVIS_PULL_REQUEST_SLUG:-$TRAVIS_REPO_SLUG}/${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}/{FILE_PATH}
@mcupak
mcupak / codemotion.jsh
Created November 30, 2018 12:13
JShell transcript from my Exploring what's new in Java 10 and 11 session at Codemotion Milan 2018.
List<Integer> list = new ArrayList<Integer>()
list.add(1)
list.add(2)
list.add(3)
list = Collections.unmodifiableList(list)
List<Integer> list2 = new ArrayList<Integer>(list)
list2.add(4)
List<Integer> list2 = Collections.unmodifiableList(new ArrayList<Integer>(list))
List<Integer> list = List.of(1,2,3)
list.add(4)
@mcupak
mcupak / devoxxua.jsh
Created November 24, 2018 10:05
JShell transcript from my Exploring what's new in Java in 2018 session at Devoxx Ukraine 2018.
List<Integer> list = new ArrayList<Integer>()
list.add(1)
list.add(2)
list.add(3)
list = Collections.unmodifiableList(list)
List<Integer> list2 = new ArrayList<Integer>(list)
list2.add(4)
List<Integer> list2 = Collections.unmodifiableList(new ArrayList<Integer>(list))
List<Integer> list = List.of(1,2,3)
list.add(4)
@mcupak
mcupak / thessaloniki.jsh
Created November 20, 2018 12:59
JShell transcript from my Reactive programming in Java session at VoxxedDays Thessaloniki 2018.
Thread t = new Thread(() -> System.out.println("hello thessaloniki"))
t.start()
ExecutorService e = Executors.newSingleThreadExecutor()
Future<String> f = e.submit(() -> "hello thessaloniki")
f
f.get()
ExecutorService e = ForkJoinPool.commonPool()
Future<String> f = e.submit(() -> "hello thessaloniki")
f.get()
CompletableFuture<String> cf = new CompletableFuture<String>()
@mcupak
mcupak / devoxx.jsh
Created November 15, 2018 20:44
JShell transcript from my Exploring reactive programming with Java session at Devoxx Belgium 2018.
Thread t = new Thread(() -> System.out.println("hello devoxx"))
t.start()
ExecutorService e = Executors.newSingleThreadExecutor()
Future<String> f = e.submit(() -> "hello devoxx")
f
f.get()
ExecutorService e = ForkJoinPool.commonPool()
Future<String> f = e.submit(() -> "hello devoxx")
f.get()
CompletableFuture<String> cf = new CompletableFuture<String>()
@mcupak
mcupak / voxxed-bristol-clean-code.jsh
Created November 8, 2018 10:27
JShell transcript from the Writing clean code with Java session at VoxxedDays Bristol 2018.
1+1
int x = 1+1
System.out.println(x)
Thread.sleep(2000)
/vars
/types
/list
/l
/help
Set<String> set = new HashSet<String>()