What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-15 21:12:03
axios download excel \ file
axios({ url: 'http://api.dev/file-download', method: 'GET', responseType: 'blob', // important }).then((response) => { const url = window.URL.createObjectURL(new Blob([response.data])); const link = document.createElement('a'); link.href... Add solution -
PHP 2021-09-15 19:56:03
how to create config file in php
<?php return (object) array( 'host' => 'localhost', 'username' => 'root', 'pass' => 'password', 'database' => 'db' ); ?> This allows you to use the object syntax when you include the php : $configs->host instead o... Add solution -
Javascript 2021-09-15 12:18:03
js qr code scanner
var videoSelect = document.querySelector('select#videoSource'); navigator.mediaDevices.enumerateDevices() .then(gotDevices).then(getStream).catch(handleError); videoSelect.onchange = getStream; function gotDevices(deviceInfos) { for (var i = device... Add solution -
Javascript 2021-09-15 12:05:02
react map wait axios call
const postIds = ['123', 'dn28e29', 'dn22je3']; const posts = posts.map(post => { return axios .get(`https://example.com/post/${post.id}`) .then(res => res.data) .catch(e => console.error(e)); } Promise.all(posts).then(res => co... Add solution