Run
minikube addons enable ingress
Wait until default-http-backend pod activate
Learn your node ip
minikube ip
var customMergeObjectsWithSameKeys = function (arr, key, mergeFunction) { | |
var _arr = [] | |
arr.forEach(item => { | |
var index = _arr.findIndex(_item => _item[key] === item[key]) | |
if (index === -1) { | |
_arr.push(item) | |
} else { | |
_arr[index] = mergeFunction(_arr[index], item) | |
} | |
}) |
function orderByKey (arr, key, asc) { | |
return arr.sort((a, b) => { | |
if (a[key] < b[key]) { | |
return asc === true ? -1 : 1 | |
} | |
if (a[key] > b[key]) { | |
return asc === true ? 1 : -1 | |
} | |
return 0 | |
}) |
public static Object[] delete(Object[] array, int index) { | |
Object[] newArray = new Object[array.length - 1]; | |
for (int i = 0; i < array.length; i++) { | |
if (i == index) | |
continue; | |
newArray[i] = array[i]; | |
} | |
return newArray; | |
} |
ingress: | |
enabled: true | |
annotations: | |
kubernetes.io/ingress.class: nginx | |
certmanager.k8s.io/cluster-issuer: letsencrypt-prod | |
certmanager.k8s.io/acme-http01-edit-in-place: "true" | |
hosts: | |
- name: chartmuseum.35.202.15.36.nip.io | |
path: / | |
tls: true |
/** | |
* Services: | |
* 1 - Convert integer to binary string | |
* 2 - Find binary gaps from binary string and add to custom data struct | |
* 3 - Get biggest binary gaps | |
*/ | |
function binaryGap(N) { | |
// get binary string | |
var binaryString = N.toString(2); |
docker volume create racher
docker run -d --restart=unless-stopped -p 7080:80 -p 7443:443 --name rancher -v rancher:/var/lib/rancher -v pwd
/fullchain.pem:/etc/rancher/ssl/cert.pem -v pwd
/privkey.pem:/etc/rancher/ssl/key.pem rancher/rancher --no-cacerts
// A closure does not mean that it necessarily is returned by a function. | |
// A closure generally is a function that has access to the declaration context's scope. | |
// A closure example without returning a function | |
var oddNumber = 3; | |
function isOddNumberIsReallyOdd() { | |
return oddNumber % 2 === 1; | |
} |
#! /bin/bash | |
for i in $(seq 100); do | |
bash -c "echo '' >/dev/tcp/$IP/8080" 2>/dev/null | |
if [ $? -eq 0 ]; then | |
break | |
fi | |
echo -n . | |
sleep 1 | |
done |
const redis = require('redis') | |
const publisher = redis.createClient() | |
const subscriber = redis.createClient() | |
subscriber.psubscribe('channel:*') | |
subscriber.on('psubscribe', console.log) |