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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "azurerm" { | |
version = "=1.38.0" | |
# subscription_id = "***" | |
skip_provider_registration = true | |
} | |
variable "prefix" { | |
default = "application" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getNumber(number) { | |
return number | |
} | |
let tasks = [ | |
() => getNumber(1), | |
() => getNumber(2), | |
() => getNumber(3), | |
() => getNumber(4) | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const redis = require('redis') | |
const publisher = redis.createClient() | |
const subscriber = redis.createClient() | |
subscriber.psubscribe('channel:*') | |
subscriber.on('psubscribe', console.log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |