Skip to content

Instantly share code, notes, and snippets.

View yuchand017's full-sized avatar

Yuchan Han yuchand017

  • Republic of Korea
View GitHub Profile
@SaidBySolo
SaidBySolo / main.py
Last active November 13, 2021 06:52
from hashlib import md5
from typing import Any, Coroutine, Union, cast
from js2py.evaljs import EvalJs # type: ignore
from js2py.translators.translating_nodes import trans # type: ignore
from js2py.translators.translator import DEFAULT_HEADER # type: ignore
def make_js_program(body: list[Any]) -> dict[str, Any]:
return {"type": "Program", "body": body}
@yuchand017
yuchand017 / DiscordEmojiInfo.js
Last active May 4, 2021 01:50
Discord emoji information generator
var findModule = (item) => Object.values(webpackJsonp.push([[],{['']:(_,e,r)=>{e.cache=r.c}}, [['']]]).cache).find(m=>m.exports&&m.exports.default&&m.exports.default[item]!==void 0).exports.default;
findModule('sendMessage').sendMessage = (sendMessage => async(id, message, ...params) => {
if (message['content'].startsWith("getinfo <:") || message['content'].startsWith("getinfo <a:")) {
let arr = []
message.validNonShortcutEmojis.forEach(emoji => {
var emojiuse = message['content'].replace('getinfo ', '')
arr.push(` ${emojiuse}\n`)
arr.push(`Emoji \`${emoji.name}\` (${emoji.id})\n`)
arr.push(`Emoji Animated \`${emoji.animated}\` \n`)
arr.push(`Emoji Available \`${emoji.available}\` \n`)
@minibox24
minibox24 / bot.py
Created April 23, 2021 05:32
discord button poll bot
import discord
from discord.ext import commands
from discord.http import Route
import uuid
bot = commands.Bot(command_prefix='`')
bot.poll_data = {}
def make_buttons(tag, data):
@minibox24
minibox24 / bot.py
Created April 10, 2021 14:04
discord.py activities invite generator
import discord
from discord.ext import commands
from discord.http import Route
bot = commands.Bot(command_prefix='!')
@bot.command('youtube')
async def youtube(ctx):
voice = ctx.author.voice
@gerth2
gerth2 / discordBot.py
Created November 2, 2019 00:26
Discord.py Mike->Discord sample
import discord
import threading
import asyncio
import time, math, random
import sounddevice as sd #from https://python-sounddevice.readthedocs.io/en/0.3.14/
# Gets audio from the microphone
class MicrophoneAudioSource(discord.PCMAudio):
def __init__(self, duration_ms=20):
self.SAMP_RATE_HZ = 48000.0 #48 KHz
@cvan
cvan / adb-shell.txt
Created September 21, 2017 21:15
Attempting to launch Oculus Browser with Chrome for Android's Intents
# Command:
adb shell am start -n "com.oculus.vrshell/.MainActivity" -d apk://com.oculus.browser -e uri https://aframe.io/aframe/examples/showcase/spheres-and-fog/
# Output:
09-22 03:59:12.368 3820 20762 I ActivityManager: START u0 {act=null typ=null flg=0x10000000 cmp=ComponentInfo{com.oculus.vrshell/com.oculus.vrshell.MainActivity}} from uid 2000 on display 0
09-22 03:59:12.375 3820 20762 W ActivityManager: GearVR not ready: not allowed to start VR Activity. activity=ComponentInfo{com.oculus.vrshell/com.oculus.vrshell.MainActivity} intent=Intent { dat=apk://com.oculus.browser flg=0x10800000 cmp=com.oculus.vrshell/.MainActivity launchParam=MultiScreenLaunchParams { mDisplayId=0 mBaseDisplayId=0 mFlags=0 } (has extras) } isVrActivity=true
09-22 03:59:13.024 10937 10959 V VRSVC : (LogEvent.java:206) yTqX [onLaunchCancelled reason=hmt pIntent=Intent { dat=apk://com.oculus.browser flg=0x10800000 cmp=com.oculus.vrshell/.MainActivity launchParam=MultiScreenLaunchParams { mDisplayId=0 mBaseDisplayId=0 mFlags=0
@mattrasband
mattrasband / server.py
Created April 17, 2016 21:58
Google OAuth with Aiohttp
#!/usr/bin/env python3
import aiohttp
from aiohttp import web
from urllib.parse import urlencode
GOOGLE_SECRET = '<google secret>'
GOOGLE_CLIENT_ID = '<google client id>'
async def google_oauthcallback(request):
#!/usr/bin/env python3.4
import urllib.request
import asyncio
def return_response(url):
return urllib.request.urlopen(url).read()
@asyncio.coroutine
def read_page(loop, url):