Skip to content

Instantly share code, notes, and snippets.

View zburgermeiszter's full-sized avatar
👨‍💻
Available for Remote DevOps Engineer positions

Zoltan Burgermeiszter zburgermeiszter

👨‍💻
Available for Remote DevOps Engineer positions
View GitHub Profile
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@zburgermeiszter
zburgermeiszter / serialize.js
Created December 22, 2017 14:43 — forked from istarkov/serialize.js
Serialize promise calls (run promises sequentially)
// promise
const sleep = (timeout, v) => new Promise(r => setTimeout(() => {console.log(v); r(v)}, timeout));
// series to call
const series = [() => sleep(1000, 1), () => sleep(1000, 2), () => sleep(1000, 3)];
// serialize
const r = series
.reduce(
(m, p) => m.then(v => Promise.all([...v, p()])),
Promise.resolve([])
@zburgermeiszter
zburgermeiszter / envsubst-multi.sh
Created December 14, 2017 11:28
Envsubst render multiple files.
for f in $(find deploy/templates -regex '.*\.ya*ml'); do envsubst < $f > "./deploy/generated/$(basename $f)"; done
@zburgermeiszter
zburgermeiszter / development.ts
Created November 24, 2017 22:06 — forked from romelgomez/development.ts
Express Server with TypeScript
import * as server from "./server";
new server.App
@zburgermeiszter
zburgermeiszter / NewsArticle.yaml
Created November 21, 2017 17:05 — forked from JamesMessinger/NewsArticle.yaml
Example of using `allOf` to extend an object in a Swagger API
swagger: "2.0"
info:
version: "1.0.0"
title: minimal
description: News Articles ftw
paths:
/users:
get:
responses:
"200":
@zburgermeiszter
zburgermeiszter / map-property-update.js
Last active August 15, 2017 15:16
ES6 destructuring magic
Modify object property in a list of object.
[{n: 1},{n: 2}].map(({n}) => ({n:n*2}))
But it break the structure:
[{n: 1, m:0},{n: 2,m:0}].map(({n}) => ({n:n*2}))
More: https://gist.github.com/mikaelbr/9900818
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
@zburgermeiszter
zburgermeiszter / multiple-ios-sim.md
Created July 6, 2017 09:31
Launch multiple iOS simulators

How to launch multiple iOS simulators.

open -n /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app

Then run it again, it will show an error message. Click OK, then change the device type do a different device ijn Hardware > Device.

To automate which device to launch, open a simulator, go to Hardware > Devices > Manage devices...

@zburgermeiszter
zburgermeiszter / .eslintrc.js
Created June 23, 2017 09:21 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
cat ~/.ssh/id_rsa.pub | ssh -i aws.pem ubuntu@ip_address "cat - >> ~/.ssh/authorized_keys"
@zburgermeiszter
zburgermeiszter / readme.md
Created June 13, 2017 09:25
Multiple app instances on OSX

open -na /Applications/Skype.app --args -DataPath /Users/$(whoami)/Library/Application\ Support/Skype2

To create icons:

You can write it as a shell script within the Run Shell Script action in Automator: Save it with the type Application (instead of Workflow) and place it in your Applications folder. It can now be placed in the Dock. https://apple.stackexchange.com/a/115118