A Pen by Saras Arya on CodePen.
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
let customer = { | |
name: "Carl", | |
details: { age: 82 }, | |
surname: "" | |
}; | |
console.log(customer?.city ?? "Unknown city";); // Unknown city | |
console.log(customer?.city ?? "Unknown city";); // Unknown city | |
console.log(customer?.surname ?? "Unknown city";); // '' | |
console.log(customer?.surname || "Unknown city";); // Unknown city |
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 fs = require('fs-extra'); | |
const folders = [ | |
{ | |
path: './build/static/css', | |
regex: /^(main).[\w]*.css$/, | |
outputFile: '../public-pages/style/sme.css' | |
}, | |
{ | |
path: './build/static/js', | |
regex: /^(main).[\w]*.js$/, |
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
sudo rm -rf ~/.npm ~/.nvm ~/node_modules ~/.node-gyp ~/.npmrc ~/.node_repl_history | |
sudo rm -rf /usr/local/bin/npm /usr/local/bin/node-debug /usr/local/bin/node /usr/local/bin/node-gyp | |
sudo rm -rf /usr/local/share/man/man1/node* /usr/local/share/man/man1/npm* | |
sudo rm -rf /usr/local/include/node /usr/local/include/node_modules | |
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /usr/local/lib/dtrace/node.d | |
sudo rm -rf /opt/local/include/node /opt/local/bin/node /opt/local/lib/node | |
sudo rm -rf /usr/local/share/doc/node | |
sudo rm -rf /usr/local/share/systemtap/tapset/node.stp | |
brew uninstall node |
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
/** | |
* Code snippet to throw an error for Null or Undefined | |
* Container = object containing variables for example | |
* if we want to assert that a variable x is not null or undefined | |
* we can use function like this | |
* let x; | |
* assertNonNull({x}) // if x is null or undefined, | |
* this function will throw appropriate error | |
*/ | |
export const assertNonNull = (container: any) => { |
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 { Dispatch } from 'redux'; | |
export interface IDom { | |
value?: string; | |
name?: string; | |
className?: string; | |
style?: any; | |
} | |
export interface IEvent { | |
target?: IDom; |
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
/** | |
* logger | |
* @param data object | |
*/ | |
export const log = (data: any) => { | |
console.log('------------------logger------------------------'); | |
Object.entries(data || {}).forEach((t, i) => { | |
console.log(`\n ${i}. \t ${t[0]} is ${JSON.stringify(t[1], null, 2)}`); | |
}); | |
console.log('------------------logger------------------------'); |
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
[ | |
{ | |
"code": "AF", | |
"text": "Afghanistan", | |
"address_config": { | |
"city": {"tem": {"label": "City", "field": "city", "sequence": 3}}, | |
"state": {"tem": {"label": "State", "field": "state", "sequence": 4}}, | |
"address1": { | |
"tem": {"label": "Address Line 1", "field": "address1", "sequence": 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
{ | |
"editor.wordWrap": "on", | |
"editor.formatOnSave": true, | |
"editor.formatOnType": true, | |
"prettier.tabWidth": 2, | |
"prettier.endOfLine": "lf", | |
"prettier.jsxBracketSameLine": true, | |
"editor.useTabStops": false, | |
"git.autofetch": true, | |
"git.confirmSync": false, |
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
Last login: Mon Oct 4 10:58:38 on console | |
akshay@Akshays-MacBook-Pro ~ % cd code/w | |
akshay@Akshays-MacBook-Pro w % ls | |
developer-portal wso2am-3.2.0 wso2am-3.2.0.zip | |
akshay@Akshays-MacBook-Pro w % cd wso2am-3.2.0 | |
akshay@Akshays-MacBook-Pro wso2am-3.2.0 % ls | |
INSTALL.txt bin release-notes.html tmp | |
LICENSE.txt business-processes repository updates | |
README.txt dbscripts resources wso2carbon.pid | |
XMLInputFactory.properties lib samples |
OlderNewer