-
Change
apiVersion
from:- apiVersion: v1
(or
apiVersion: apps.openshift.io/v1
)to:
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
wsl.exe -u root -e sh -c "service docker status || service docker start" |
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
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 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 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 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 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 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 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, | |
}, | |
]; |
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
package.json | |
{ | |
"name": "config", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"type": "module", | |
"scripts": { | |
"test": "npx jest --runInBand test/", | |
"test:dev": "npx jest --runInBand --watchAll test/", |
NewerOlder