TLDR: Use for...of instead of forEach() in asynchronous code.
For legacy browsers, use for(...;...;...) or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
| import * as eks from '@aws-cdk/aws-eks'; | |
| import * as iam from '@aws-cdk/aws-iam'; | |
| import * as cdk8s from 'cdk8s'; | |
| import { Construct, Stack, StackProps } from '@aws-cdk/core'; | |
| import * as k8s from '../imports/k8s'; | |
| export class TestClusterStack extends Stack { | |
| constructor(scope: Construct, id: string, props?: StackProps) { | |
| super(scope, id, props); |
| oldContainers="$(docker ps -f "status=exited" | grep -E 'Exited \(.*\) [5-9] h|Exited \(.*\) \d\d h' | awk '{ print $1 }')" | |
| echo -e -n "\nRemoving containers older than 4 hours" | |
| if [ "$oldContainers" != "" ]; then | |
| echo "" | |
| docker rm $oldContainers | |
| else | |
| echo "...none found." | |
| fi |
| image: docker.mydomain.com/build/kube-go-make | |
| variables: | |
| DOCKER_TAG: docker.mydomain.com/myapp/home:$CI_COMMIT_REF_SLUG | |
| DOCKER_HOST: tcp://localhost:2375 | |
| DOCKER_DRIVER: overlay | |
| PROD_RSYNC_HOST: myprodserver.com | |
| DOMAIN: mydomain.com | |
| CHART_DIR: chart |
| image: docker:latest | |
| services: | |
| - docker:dind | |
| stages: | |
| - build | |
| - test | |
| - release | |
| variables: | |
| CONTAINER_IMAGE: registry.anuary.com/$CI_PROJECT_PATH | |
| DOCKER_DRIVER: overlay2 |
You may need to override toString on any recursive or deeply-nested data structure, since IntelliJ will ask the Java Debugger (JDB) to call toString all the time.
This will blow up your memory.
Useful for any number of reasons: testing on a different OS, using lots of memory/cpu resources you don't have locally, etc.
See an Intellij / IDEA guide for background.
bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --delete-config retention.ms
| var _ = require('lodash'); | |
| var Success = function(success) { this.success = success; }; | |
| var Failure = function(failure) { this.failure = failure; }; | |
| var bindAll = function(fs) { | |
| var bind = function(res, f) { | |
| return res instanceof Success ? f(res.success) : res; | |
| }; | |
| var bindF = function(f) { return _.partial(bind, _, f); }; |
| // | |
| // Signal+Extensions.swift | |
| // Khan Academy | |
| // | |
| // Created by Nacho Soto on 10/1/15. | |
| // Copyright © 2015 Khan Academy. All rights reserved. | |
| // | |
| import ReactiveCocoa |