What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-20 13:01:05
fetch in javascript
//Obj of data to send in future like a dummyDb const data = { username: 'example' }; //POST request with body equal on data in JSON format fetch('https://example.com/profile', { method: 'POST', headers: { 'Content-Type': 'application/json', }, ... Add solution -
Other 2021-09-20 12:56:03
preselect ionic picker selected value
async openResultsShownPicker() { const columns = [{name:"resultsShown",options:this.resultsShownOptions, selectedIndex: this.filters.resultsShownIdx }]; const translations = await this.translateService.get(['COMMON.CANCEL','COMMON.DON... Add solution -
Javascript 2021-09-20 02:58:03
getdata from fetch api into variable
<script> function getFromAPI(url, callback){ var obj; fetch(url) .then(res => res.json()) .then(data => obj = data) .then(() => callback(obj)) } getFromAPI('https://jsonplaceholder.typicode.com/posts', getData); function ... Add solution -
Javascript 2021-09-19 17:22:05
send multipart form data axios with node js
import React from 'react' import axios, { post } from 'axios'; class SimpleReactFileUpload extends React.Component { constructor(props) { super(props); this.state ={ file:null } this.onFormSubmit = this.onFormSubmit.bind(this) ... Add solution -
PHP 2021-09-19 14:50:03
laravel sanctum Authorizing Private Broadcast Channels
window.Echo = new Echo({ broadcaster: "pusher", cluster: process.env.MIX_PUSHER_APP_CLUSTER, encrypted: true, key: process.env.MIX_PUSHER_APP_KEY, authorizer: (channel, options) => { return { authorize:... Add solution -
Javascript 2021-09-19 13:28:01
excel javascript api protect worksheet
Excel.run(function (context) { var activeSheet = context.workbook.worksheets.getActiveWorksheet(); activeSheet.load("protection/protected"); return context.sync().then(function() { if (!activeSheet.protection.protected) { ... Add solution