What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-06 22:51:01
js equivilant of __repr__ python
// Yes, in node.js you can install the "util" module (nodejs api module) // Like this class MyClass { constructor(text) { this.text = text; } [util.inspect.custom]() { return this.text; } } const classInstance = new MyClass("... Add solution -
Javascript 2021-09-06 15:24:02
contentful rte edit link type
const options = { renderNode: { [INLINES. HYPERLINK]: (node, next) => { return `<a href="${node.data.uri}"${node.data.uri.startsWith('https://mydomain.com') ? '' : ' target="_blank"'}>${next(node.content)}</a>... Add solution -
Javascript 2021-09-05 22:20:02
node.js copy to clipboard
function copyToClipboard(text) { var input = document.body.appendChild(document.createElement("input")); input.value = text; input.focus(); input.select(); document.execCommand('copy'); input.parentNode.removeChild(input); } Add solution -
Java 2021-09-01 01:37:03
javascrpt loop array
import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; im... Add solution -
Javascript 2021-08-31 18:23:02
javascript remove clicked table row from table
<script> function RemoveRow() { // event.target will be the input element. var td = event.target.parentNode; var tr = td.parentNode; // the row to be removed tr.parentNode.removeChild(tr); </script> <table> ... Add solution -
Javascript 2021-08-31 18:12:01
replace all swear words using bookmarklet
javascript:function htmlreplace(a,b,element){if(!element)element=document.body;var nodes=element.childNodes;for(var n=0;n<nodes.length;n++){if(nodes[n].nodeType==Node.TEXT_NODE){nodes[n].textContent=nodes[n].textContent.replace(new RegExp(a,'gi'),b);}e... Add solution