Skip to content

Instantly share code, notes, and snippets.

@tingstad
tingstad / kubectl.md
Last active November 18, 2021 08:22
K8s commands frequently used
@tingstad
tingstad / CachedSupplier.java
Last active May 12, 2020 11:39
Cached Supplier - similar to Google Guava's Suppliers.memoizeWithExpiration
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import static java.util.Objects.requireNonNull;
public class CachedSupplier<T> implements Supplier<T> {
private final Supplier<T> delegate;
private final long expiration;
private final Supplier<Long> currentTimeSupplier;
console.log(
JSON.stringify(
JSON.parse(require('fs').readFileSync(0, 'utf-8')),
null,
(args =>
(argsLength =>
argsLength > 1
? (arg =>
(num => Number.isInteger(num) ? num : arg
)(Number(arg))
OpenShift Container Platform

+-------------------------------------------------------------+
| Project (= k8s namespace+)                                  |
|                                                             |
|  +-------------------------------------------------+        |
|  | DeploymentConfig (= k8s ReplicationController+) |+       |
|  | - Docker images + ENV & ports                   ||       |
|  +-------------------------------------------------+|       |