Skip to content

Instantly share code, notes, and snippets.

View 4gboframram's full-sized avatar

4gboframram

View GitHub Profile
@4gboframram
4gboframram / bf.py
Created August 10, 2022 00:10
Rpython brainfuck JIT brainfuck interpreter
# A B***nfuck jit using RPython
# To compile:
# *path-to-rpython* --continuation --translation-backendopt-print_statistics --lto --translation-backendopt-really_remove_asserts -Ojit --output bf bf.py
from rpython.rlib.rfile import llexternal
from rpython.rtyper.lltypesystem import rffi
from rpython.rlib import jit
from rpython.rlib.rarithmetic import intmask
c_getchar = llexternal('getchar', [], rffi.INT, save_err=rffi.RFFI_SAVE_ERRNO)
@4gboframram
4gboframram / install_rpython.py
Last active October 2, 2021 22:06
[Windows] Install rpython and pypy with a script
# What this script does:
# 1: Download pypy2 windows binary
# 2: Rename exe to pypy2.exe (optional)
# 3: Append to Path
# 4: Download pypy3 source
# 5: add variable "rpython" and set it to {pypy3 source}\rpython\bin
# 6: Download pypy3 binary because we don't want to take a few years to build from source
# 7: Append to Path
# 7: To use rpython:
# pypy %rpython% {args} {file}
@4gboframram
4gboframram / main.py
Last active June 4, 2021 03:38
Discord-Components Tic Tac Toe
import os
import asyncio
import discord
from typing import Union
from discord_components import DiscordComponents, Button, ButtonStyle
from discord.ext import commands
bot = commands.Bot(command_prefix=";",help_command=None)
DiscordComponents(bot)
@4gboframram
4gboframram / self-embed.py
Created April 13, 2021 21:11
Just a little thing you can use to send embeds with discord.py. Not all functionality is here, but maybe I'll add more
import discord
from discord.ext import commands
TOKEN="lmao not leaking my token again"
client=discord.Client()
bot = commands.Bot(command_prefix='-')
title=''
author=''
author_icon=''