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
convertTextToUrl(text) { | |
let replacedText = ''; | |
if (text != '') { | |
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; | |
var text1 = text.replace(exp, "<a href='$1' target='_blank'>$1</a>"); | |
var exp2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim; | |
const node = this.myRefLink.current; | |
if (node != null) { | |
node.innerHTML = text1.replace(exp2, '$1<a href="http://$2" target="_blank">$2</a>'); | |
} |
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
//animation like - twitter opt1 | |
.heart { | |
width: 50px; | |
height: 50px; | |
background: url("https://cssanimation.rocks/images/posts/steps/heart.png") no-repeat; | |
background-size: cover; | |
background-position: 0 -7px; | |
cursor: pointer; | |
transition: background-position 1s steps(28); | |
transition-duration: 0s; |
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
<#assign newList = [] /> | |
<#list response.data.items as originalList> | |
<#if ! newList?seq_contains(originalList.xValue)> | |
<#assign newList = newList + [originalList.xValue] /> | |
</#if> | |
</#list> |
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
router.post('/endpointname', async function (req, res, next) { | |
let bodyObj = { "x": {} }; | |
let requestURL = "https://reqres.in/api/register"; | |
let requestOptions = { | |
method: "POST", | |
body: JSON.stringify(bodyObj), | |
headers: { 'Content-Type': 'application/json' } | |
}; | |
try { | |
const urlResponse = await fetch(requestURL, requestOptions); |
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
router.post('/endpointname', async function (req, res, next) { | |
let bodyObj = { "x": {} }; | |
let requestURL = "https://reqres.in/api/register"; | |
let requestOptions = { | |
method: "POST", | |
body: JSON.stringify(bodyObj), | |
headers: { 'Content-Type': 'application/json' } | |
}; | |
try { | |
const apiResponse = await fetch(requestURL, requestOptions); |
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 pdcObject = pdcs_collection.find((pObj) => pObj.itemId == p.itemId); |
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
// An array of objects | |
var persons = [{name: "Harry"}, {name: "Alice"}, {name: "Peter"}]; | |
// Find if the array contains an object by comparing the property value | |
if(persons.some(person => person.name === "Peter")){ | |
alert("Object found inside the array."); | |
} else{ | |
alert("Object not found."); | |
} |
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 arr = [ | |
{ | |
"Company": "IBM" | |
}, | |
{ | |
"Person": "ACORD LOMA" | |
}, | |
{ | |
"Company": "IBM" | |
}, |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder