What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-06 23:35:02
Optimize Image Size With JavaScript in Node.js
/* This code comes from Vincent Lab And it has a video version linked here: https://www.youtube.com/watch?v=bmSOapQ5I78 */ // Import dependencies const imagemin = require("imagemin"); const imageminJpegtran = require("imagemin-jpeg... Add solution -
Python 2022-03-05 11:20:20
how to make a discord bot python
import discord from discord.ext import commands bot = commands.Bot(command_prefix="!", description="The description") @bot.event async def on_ready(): print("Ready !") @bot.command() async def ping(ctx): await ctx... Add solution -
Dart 2022-03-03 02:10:01
Flutter make widget based on dio
import 'dart:async'; import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; Future<Album> fetchAlbum() async { final response = await http.get('https://jsonplaceholder.typicode.com/albums/1'... Add solution -
Python 2022-03-02 20:00:07
discord.File(fp=image_binary,filename=name) discord py
image = Image.open("test.png") with BytesIO() as image_binary: image.save(image_binary, "PNG") image_binary.seek(0) await ctx.send(file=discord.File(fp=image_binary,filename="image.png")) Add solution -
C# 2022-03-02 18:10:12
Window Dimensions in Blazor?
using Microsoft.JSInterop; using System.Threading.Tasks; public class BrowserService { private readonly IJSRuntime _js; public BrowserService(IJSRuntime js) { _js = js; } public async Task<BrowserDimension> GetDimensions() { return awai... Add solution -
Python 2022-02-28 07:40:17
p2p py
from p2p_python.utils import setup_p2p_params, setup_logger from p2p_python.server import Peer2Peer, Peer2PeerCmd import logging import asyncio import aiomonitor import time loop = asyncio.get_event_loop() log = logging.getLogger(__name__) setup_logge... Add solution -
Python 2022-02-28 00:20:03
how to make a latency command discord.py
@client.command() async def ping(ctx): before = time.monotonic() message = await ctx.send("Pong!") ping = (time.monotonic() - before) * 1000 await message.edit(content=f"Pong! `{int(ping)}ms`") #for discord.py... Add solution -
Dart 2022-02-27 15:40:02
type '_InternalLinkedHashMap<DateTime, int>' is not a subtype of type 'Map<DateTime, double>'
Future<List<Map<String, dynamic>>> fetch() async { http.Response response = await http.get('http://10.0.2.2:8000/api/membres'); if (response.statusCode != 200) return null; return List<Map<String, dynamic>>.from(json.de... Add solution