🦎
- piedhyper.space (dead x.x)
- in/grayson-miller-a8b784226
- https://www.shadertoy.com/user/graygoose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // peers.rs | |
| use std::io::prelude::*; | |
| use std::net::{TcpListener, TcpStream}; | |
| use itertools::Itertools; | |
| pub struct Peer { | |
| pub buffer: [u8; 256], | |
| server: TcpListener, | |
| clients: Vec<TcpStream>, | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package GenericIA3D; | |
| import processing.core.PApplet; | |
| import java.util.List; | |
| import java.util.ArrayList; | |
| import java.util.function.Function; | |
| import culebra.viz.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Library helpers | |
| function get_screen () | |
| local sides = { "top", "bottom", "left", "right", "front", "back" } | |
| for i = 1, #sides do | |
| if peripheral.isPresent(sides[i]) then | |
| if peripheral.getType(sides[i]) == "monitor" then | |
| local w, h = peripheral.call(sides[i], "getSize") | |
| local win = window.create(peripheral.wrap(sides[i]), 1, 1, w, h) | |
| win.setBackgroundColor(colors.black) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local function energy_percent() | |
| reactor_energy = peripheral.call("back", "getEnergyStats") | |
| reserve_percent = reactor_energy["energyStored"] / reactor_energy["energyCapacity"] | |
| return reserve_percent | |
| end | |
| local function reactor_loop () | |
| print("Starting reactor control loop") | |
| active = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from html.parser import HTMLParser | |
| from discord.ext import commands | |
| # docs on htmlparsing : https://www.pythoncentral.io/html-parser/ | |
| # search more if need be, it's the complex part | |
| # docs on discord.py https://discordpy.readthedocs.io | |
| # you really don't need to mess with this at all unless you decide to make it fancier | |
| class MyBot(commands.Bot): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import os | |
| import time | |
| from discord.ext import commands | |
| # Configuration setup | |
| config_path = os.path.join(os.getcwd(), 'resources', 'config.json') | |
| if os.path.exists(config_path): | |
| with open(config_path) as f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import os | |
| from importlib.util import spec_from_file_location, module_from_spec | |
| logger = logging.getLogger(__name__) | |
| class Plugin: | |
| """The command dictionaries are indexed by the command name and point to a function | |
| which returns a response to send or None if no response is necessary. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> a = "my string" | |
| >>> b = "my string" | |
| >>> id(a) | |
| 7570480 | |
| >>> id(b) | |
| 7574128 | |
| >>> id("my string") | |
| 7574192 | |
| >>> id("my string") | |
| 7574192 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is just a working example of One Time Pads | |
| # NOT FOR SECURE USAGE | |
| import random | |
| from string import printable | |
| rng = random.SystemRandom() | |
| def createkey(length, dictionary=printable): | |
| key = [] |