Skip to content

Instantly share code, notes, and snippets.

use sickly green for everything!!
rgba(74, 133, 74, 153)
#4a854a
rgb(74, 133, 74)
CMYK: 44%, 0%, 44%, 48%
HSV: 120°, 44%, 52%
HSL: 120°, 29%, 41%
@1oonie
1oonie / 1-pygame.md
Last active June 28, 2021 14:05
A little explanation of how to use the basics of pygame

pygame

pygame is a game framework for python. It can be used for creating many 2D games.

Contents

  • basic-window.py - Opening up a basic window
  • rectangle.py - Drawing a rectangle on the window
  • follow.py - Making a circle follow your cursor.
import discord
import inspect
def _get_options(callback):
sig = inspect.signature(callback)
options = []
types = {
str: 3,
@1oonie
1oonie / message_components.md
Last active March 30, 2024 18:22
Message components

Message components

This gist shows you how to use message components in discord.py 2.0

This assumes that you know how Object Orientated Programming in Python works, if you don't know what this is then I recommend that you read this guide.

Installing

You'll need to install discord.py from git to use this (if you don't have git then google how to install it for your OS, I can't be bothered to put it in here...), if you already have this then you can skip to the next section. However if you don't please read the below

@1oonie
1oonie / min.js
Created October 9, 2021 10:52
tictactoe
!function(){function r(r,e){for(let t=0;t<3;t++){if(r[0][t]===e&&r[1][t]===e&&r[2][t]===e)return!0;if(r[t][0]===e&&r[t][1]===e&&r[t][2]===e)return!0}return r[0][0]===e&&r[1][1]===e&&r[2][2]===e||r[2][0]===e&&r[1][1]===e&&r[0][2]===e}function e(e){for(let r=0;r<3;r++)for(let t=0;t<3;t++)if("-"===e[r][t])return!1;return!0!==r(e,"x")&&!0!==r(e,"o")}function t(r,e,t){if(parseInt(t)<4){if("-"!==r[0][parseInt(t)-1])return alert("Invalid Move!"),!1;r[0][parseInt(t)-1]=e}else if(parseInt(t)<7){if("-"!==r[1][parseInt(t)-4])return alert("Invalid Move!"),!1;r[1][parseInt(t)-4]=e}else{if(!(parseInt(t)<10))return alert("Invalid Move!"),!1;if("-"!==r[2][parseInt(t)-7])return alert("Invalid Move!"),!1;r[2][parseInt(t)-7]=e}return r}function n(r,e){var t=prompt(`${function(r){var e="";for(let n in r){var t="";for(let e in r[n])t+=`${r[n][e]} `;e+=`${t}\n`}return e}(r)}${e} what is your move? (Type q to quit)`),n=["1","2","3","4","5","6","7","8","9"];for(let r in n)if(n[r]===t)return t;if("q"===t)throw new Error("Stop scrip
@1oonie
1oonie / 1-README.md
Last active December 4, 2021 17:09
music

music bot

Instuctions

Download both the python files below and put them in your project's root directory, (you may have to rename them because I have prefixed them with numbers so they appear in the order that I want).

Download slash_util from here and put that in your project's root directory.

Then you can install the requirements which are:

  • youtube_dl
#pragma config(Motor, port3, br, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, fl, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, belt, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, bl, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port9, fr, tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#define activation_energy 40
void left_(int a) {