(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
"""Event emitter playground""" | |
import asyncio | |
import logging | |
import pytest | |
from pyee import AsyncIOEventEmitter | |
LOG = logging.getLogger(__name__) | |
@pytest.mark.asyncio |
import static org.apache.http.protocol.HttpCoreContext.HTTP_TARGET_HOST; | |
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.TreeMap; |
# http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/ | |
# Get files ready to move | |
git clone <git repo A> | |
cd <git repo A directory> | |
git remote rm origin | |
git filter-branch --subdirectory-filter <directory 1> -- --all | |
mkdir <directory 1> | |
mv * <directory 1> | |
git add . |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
To remove a submodule you need to:
#!/bin/bash | |
# Delete all stopped containers | |
docker ps -q -f status=exited | xargs --no-run-if-empty docker rm | |
# Delete all dangling (unused) images | |
docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi |
variables: | |
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true" | |
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true" | |
cache: | |
paths: | |
- .m2/repository | |
.validate: &validate | |
stage: build |
void setHeight(int arg) { | |
height = arg; | |
} | |
void setWidth(int arg) { | |
width = arg; | |
} |
void setValue(String name, int value) { | |
if (name.equals("height")) { | |
height = value; | |
return; | |
} | |
if (name.equals("width")) { | |
width = value; | |
return; | |
} | |
} |
public void findPrimeNumbers() { | |
List<Integer> primeNumbers = IntStream | |
.rangeClosed(1, 100) | |
.filter(this::isPrime) | |
.boxed() | |
.collect(Collectors.toList()); | |
System.out.println(primeNumbers.toString()); | |
} |