Skip to content

Instantly share code, notes, and snippets.

View noxzym's full-sized avatar
🐛

Orchitiadi Ismaulana Putra noxzym

🐛
View GitHub Profile
@siddAhmed
siddAhmed / fastapi-discord.py
Created June 6, 2021 07:46 — forked from haykkh/fastapi-discord.py
How to run a discord.py bot with FastAPI
import asyncio
import discord
from fastapi import FastAPI
app = FastAPI()
client = discord.Client()
# where the magic happens
# register an asyncio.create_task(client.start()) on app's startup event
@Allvaa
Allvaa / ExtendedMessage.js
Last active August 31, 2024 18:08
Discord.js v12 Inline Replies
const { APIMessage, Structures } = require("discord.js");
class ExtAPIMessage extends APIMessage {
resolveData() {
if (this.data) return this;
super.resolveData();
const allowedMentions = this.options.allowedMentions || this.target.client.options.allowedMentions || {};
if (allowedMentions.repliedUser !== undefined) {
if (this.data.allowed_mentions === undefined) this.data.allowed_mentions = {};
Object.assign(this.data.allowed_mentions, { replied_user: allowedMentions.repliedUser });
@anurag-7
anurag-7 / timer.py
Last active October 21, 2020 10:51
Before Using this Script, Install Python 3.5.3+ and Discord.py beforehand.
import asyncio
import logging
import time
from contextlib import suppress
from typing import Union
import discord
"""
@zhangshine
zhangshine / tinymce-react-nextjs.md
Last active November 23, 2024 15:22
NextJs- React - Self hosted TinyMCE
  1. Install (TinyMCE 5.x)
npm install --save tinymce @tinymce/tinymce-react copy-webpack-plugin
  1. Copy static files(tinymce skins) to public folder. Edit file next.config.js
const path = require('path');
const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
@slava-vishnyakov
slava-vishnyakov / readme.md
Last active February 11, 2025 20:08
How to upload images with TipTap editor
  1. Create a file Image.js from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that accepts uploadFunc (function to be called with image being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. } in the new Plugin section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'

/**
 * Matches following attributes in Markdown-typed image: [, alt, src, title]
 *
@dmurawsky
dmurawsky / index.js
Last active January 29, 2025 20:18
How to make a page full height in Next.js
const FullHeightPage = () => (
<div>
Hello World!
<style global jsx>{`
html,
body,
body > div:first-child,
div#__next,
div#__next > div {
height: 100%;