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
apiVersion: cert-manager.io/v1alpha2 | |
kind: Issuer | |
metadata: | |
name: selfsigned | |
spec: | |
selfSigned: {} |
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
apiVersion: networking.k8s.io/v1beta1 | |
kind: Ingress | |
metadata: | |
name: mynode-ingress | |
namespace: nodejs | |
spec: | |
rules: | |
- host: mynodeapp.com | |
http: | |
paths: |
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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: mynode-app | |
namespace: nodejs | |
spec: | |
selector: | |
app: mynode-app | |
ports: | |
- port: 80 |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: mynode-app | |
namespace: nodejs | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: | |
app: mynode-app |
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 | |
var1='A' | |
var2='B' | |
my_function () { | |
local var1='C' | |
var2='D' | |
echo "Inside function: var1: $var1, var2: $var2" | |
} |
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 domainName(url){ | |
if(url.search('//')>0){ | |
url = url.slice(url.search('//')+2); | |
} | |
if(url.search('www')>=0){ | |
url = url.slice(url.search('www')+4); | |
} | |
return url.slice(0,url.indexOf('.')); | |
} |
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 sortByName(arr) { | |
let ones= ['zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen']; | |
let tens = ['','','twenty','thirty','fourty','fifty','sixty','seventy','eighty','ninety'] | |
let alphanums = {} | |
arr.forEach((v,i)=>{ | |
let numstring = String(v) | |
numstring =numstring.split('').reverse('').join(''); | |
let len= numstring.length; | |
let str='' | |
let x= 0; |
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
class Address{ | |
constructor(street,city,country){ | |
this.street = street; | |
this.city = city; | |
this.country = country; | |
} | |
} | |
class User{ |
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 callApi(url){ | |
return new Promise((resolve,reject) => { | |
console.log(`calling API: ${url}`) | |
if(url==='twitter'|| url=='facebook'){ | |
resolve(`connected to ${url}`) | |
} | |
else{ | |
reject(`Sorry unsupported API : ${url}`) | |
} | |
}); |
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 validSolution(board) { | |
let valid = true; | |
const testvaliditiy = (arr) => { | |
let set = new Set(arr); | |
if (arr.includes(0) || [...set].length !== 9) { | |
return false; | |
} else { | |
return true; | |
} | |
} |