What do you want to save?
Add Code snippet
New code examples
-
Other 2022-01-26 12:25:36
rnimagepicker error This library does not require Manifest.permission.CAMERA, if you add this permission in manifest then you have to obtain the same.
const requestCameraPermission = async () => { try { const granted = await PermissionsAndroid.request( PermissionsAndroid.PERMISSIONS.CAMERA, { title: "App Camera Permission", message:"App needs access to... Add solution -
Javascript 2022-01-22 07:25:19
wrap wreck request inside async block
const asyncOperation = () => { return new Promise((resolve, reject) => { setTimeout(()=>{resolve("hi")}, 3000) }) } const asyncFunction = async (callback) => { let res = await asyncOperation(); callback(res);... Add solution -
Javascript 2022-01-22 07:20:03
electron sample question
'use strict'; const path = require('path'); const { app, BrowserWindow, Menu, globalShortcut} = require('electron'); const unhandled = require('electron-unhandled'); const debug = require('electron-debug'); const {is} = require('electron-util'); unhandle... Add solution -
Javascript 2021-11-22 03:15:18
puppeteer quick start
const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto('https://example.com'); await page.screenshot({path: 'example.png'}); await browser.clo... Add solution -
Javascript 2021-11-20 19:30:21
strapi.io react
import React from 'react'; // Parses the JSON returned by a network request const parseJSON = resp => (resp.json ? resp.json() : resp); // Checks if a network request came back fine, and throws an error if not const checkStatus = resp => { if (r... Add solution -
Javascript 2021-11-20 18:44:23
How to connect mongoDB using mongoose
import mongoose from 'mongoose' export const connectDb = async () => { try { await mongoose.connect('mongodb://localhost:27017/test', { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true, }) } catch (er... Add solution