What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-27 16:00:21
jest axios manual mock
//axios.js const axios = require('axios') module.exports = axios.get //__mocks__/axios.js const axios = require('axios') module.exports = { get: async () => { const url = 'https://jsonplaceholder.typicode.com/posts' const response = await axios... Add solution -
Python 2022-03-27 15:35:04
how to limit a command to a permission in discord.py
# Make sure you don't have a command called "commands" @client.command() # As usual @commands.has_permissions(administrator=True) # Making sure the person executing the command has the permissions async def foo(ctx): await ctx.send("Hello&... Add solution -
Other 2022-03-27 15:20:36
mongodb populate in same collection
async function lookup() { const times = []; for (let i = 0; i < 10; ++i) { let startTime = Date.now(); const orders = await Order.aggregate([ {$match: {completed: true}}, { $lookup: { from: 'users', localField: 'user', foreignField:... Add solution -
Javascript 2022-03-27 11:55:30
github react starter disques
import React from 'react'; import PropTypes from 'prop-types'; const SHORTNAME = 'example'; const WEBSITE_URL = 'http://www.example.com'; function renderDisqus() { if (window.DISQUS === undefined) { var script = document.createElement('script'); ... Add solution -
Other 2022-03-27 08:00:11
flutter get image file from assets
import 'dart:async'; import 'dart:io'; import 'package:flutter/services.dart' show rootBundle; import 'package:path_provider/path_provider.dart'; Future<File> getImageFileFromAssets(String path) async { final byteData = await rootBundle.load('as... Add solution