What do you want to save?
Add Code snippet
New code examples
-
Other 2022-02-28 00:25:41
simple shopify code
const Shopify = require('shopify-api-node') // Replace the following with your shop credentials const shopify = new Shopify({ shopName: 'your-shop-name', apiKey: 'your-api-key', password: 'your-password }) // Create a new customer function create_... Add solution -
Javascript 2022-02-28 00:25:01
javascript promise.all
var p1 = Promise.resolve(3); var p2 = 1337; var p3 = new Promise((resolve, reject) => { setTimeout(resolve, 100, "foo"); }); Promise.all([p1, p2, p3]).then(values => { console.log(values); // [3, 1337, "foo"] }); Add solution -
Javascript 2022-02-27 23:00:02
js copy to clipboard cross browser
/** copy text to the clipboard */ function copy2clipboard( text, callback /* optional */ ) { // use modern clipboard API if ( navigator.clipboard ) { navigator.clipboard.writeText( text ) .then( function(){ // if a callback is provided, call it ... Add solution -
Javascript 2022-02-27 17:35:20
next js shared hosting without node js
const { createServer } = require("http"); const { parse } = require("url"); const next = require("next"); const dev = process.env.NODE_ENV !== "production"; const port = !dev ? process.env.PORT : 3000; // Create t... Add solution -
Other 2022-02-26 21:15:15
send email using javascript and mailtrap
function sendEmail() { Email.send({ Host : "smtp.mailtrap.io", Username : "<Mailtrap username>", Password : "<Mailtrap password>", To : '[email protected]', From : "[email protected]&... Add solution -
Javascript 2022-02-26 07:20:20
mobx react hooks async
mobx.configure({ enforceActions: "observed" }) class Store { @observable githubProjects = [] @observable state = "pending" // "pending" / "done" / "error" @action fetchProjects() { ... Add solution -
TypeScript 2022-02-19 17:15:04
typescript get the promise return type
new Promise<boolean>((res, rej) => { res(true); }) .then(res => { console.log(res); return false; }) .then(res => { console.log(res); return true; }) .then(res => { console.log(res); }) .catch(error => { console.lo... Add solution