-
Change
apiVersion
from:- apiVersion: v1
(or
apiVersion: apps.openshift.io/v1
)to:
This file contains hidden or 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
> docker run --rm -it -d --name localstack -p 4566:4566 -p 4510-4559:4510-4559 localstack/localstack | |
> docker ps | |
> docker exec -it <containerId> /bin/bash | |
> aws configure | |
AWS Access Key ID [None]: example-key | |
AWS Secret Access Key [None]: example-secret-key | |
Default region name [None]: us-east-1 | |
Default output format [None]: |
This file contains hidden or 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
wsl.exe -u root -e sh -c "service docker status || service docker start" |
This file contains hidden or 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
import { parseString, Builder } from "xml2js"; | |
// Convert string/XML to JSON | |
function toJson(xml: string) { | |
parseString(xml, { explicitArray: false }, function(error, result) { | |
console.log(result); | |
}); | |
} |
This file contains hidden or 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 | |
sudo add-apt-repository -y ppa:git-core/ppa | |
sudo apt-get update | |
sudo apt-get install git -y |
This file contains hidden or 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
export const alphanumeric = (len) => { | |
const str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
return [...Array(len)].reduce( | |
(a) => a + str[~~(Math.random() * str.length)], | |
"" | |
); | |
}; | |
console.log(alphanumeric(6)); // HNF2RU |
This file contains hidden or 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
// https://stackoverflow.com/a/1431113/11842937 | |
const replaceAt = function(str, index, replacement) { | |
return str.substring(0, index) + replacement + str.substring(index + replacement.length); | |
} | |
https://regexr.com/ - regex matches between symbol | |
regex = new RegExp(`^\\${symbol}(.*)\\${symbol}$`, 'gm') | |
g = global | |
m = multiline |
This file contains hidden or 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
function centuryFromYear(year) { | |
return Math.ceil(year / 100) | |
} |
This file contains hidden or 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
function isPalindrome(word) { | |
return word === word.split('').reverse().join('') | |
} |
This file contains hidden or 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
import "./styles.css"; | |
import Stripe from "stripe"; | |
const lineItems = [ | |
{ | |
price: "price_123", | |
quantity: 1, | |
}, | |
]; |