Skip to content

Instantly share code, notes, and snippets.

View ShayBox's full-sized avatar
🐧

Shayne Hartford ShayBox

🐧
View GitHub Profile
@ShayBox
ShayBox / main.rs
Created February 13, 2024 03:27
Infinite Craft automated with headless_chrome
use std::{collections::HashSet, time::Duration};
use anyhow::Result;
use derive_config::{json::Value, DeriveJsonConfig, DeriveTomlConfig};
use headless_chrome::{browser::default_executable, Browser, LaunchOptions};
use serde::{Deserialize, Serialize};
#[derive(Debug, Default, DeriveJsonConfig, Deserialize, Serialize)]
struct Combinations(HashSet<(String, String)>);
@ShayBox
ShayBox / main.py
Created July 6, 2023 04:15
Temporary low voltage detection using standard deviation for RPI Pico W & CircuitPython
import analogio
import board
import math
import time
voltage = analogio.AnalogIn(board.VOLTAGE_MONITOR)
voltage_conversion_factor = 3 * 3.3 / 65535
def calculate_mean(data):
return sum(data) / len(data)
@ShayBox
ShayBox / CubemapExtractor.cs
Created June 26, 2023 08:59
Unity editor script that extracts 6 sided images from a cubemap
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Linq;
public class CubemapExtractor : Editor
{
private static readonly CubemapFace[] CubemapFaces = new CubemapFace[]
{
CubemapFace.PositiveX, // Right
@nikhiljha
nikhiljha / README.md
Last active February 10, 2024 22:34
Apple Silicon (M1) + MultiMC + Minecraft 1.18 + Native LWJGL

Apple Silicon (M1) + MultiMC + Minecraft 1.18 + Native LWJGL

Up to Minecraft 1.17.X I used yusefnapora/m1-multimc-hack, but this stopped working for me starting in Minecraft 1.18. Grabbing random jarfiles from a git repository is a little suspicious, so let's do it safely by getting the libraries from the official LWJGL website!

Installing Java

If you don't have Homebrew installed already, install Homebrew by following the instructions at brew.sh. Then, just open a Terminal and type...

brew install java
@BigBrainAFK
BigBrainAFK / wootility_lekker_edition_usb_feature_codes.js
Last active April 20, 2024 22:56
Wootility Lekker Edition USB Feature Codes
Ping = 0 = "Ping"
GetVersion = 1 = "GetVersion"
ResetToBootloader = 2 = "ResetToBootloader"
GetSerial = 3 = "GetSerial"
GetRgbProfileCount = 4 = "GetRgbProfileCount"
REMOVED_GetCurrentRgbProfileIndex = 5 = "REMOVED_GetCurrentRgbProfileIndex"
REMOVED_GetRgbMainProfile = 6 = "REMOVED_GetRgbMainProfile"
ReloadProfile0 = 7 = "ReloadProfile0"
SaveRgbProfile = 8 = "SaveRgbProfile"
GetDigitalProfilesCount = 9 = "GetDigitalProfilesCount"
@kandhan-kuhan-t
kandhan-kuhan-t / 1password_1pux_to_csv.py
Created October 14, 2020 13:44
This converts the json file (you'll have to extract 'export.data' file from '*.1pux' file) exported from 1password (linux app) to .csv
#! /usr/bin/python3
import json
import csv
# extract export.data from .1pux file using archive manager
# extract.data is a json file
json_file_path = './export.data'
# output file path
@haykkh
haykkh / fastapi-discord.py
Created June 24, 2020 10:09
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
@andreiagmu
andreiagmu / FastPlatformSwitcher.cs
Last active December 14, 2022 14:47
Improved FastPlatformSwitcher for Unity 2018 (and maybe other Unity versions), for Asset Database v1
// Improved FastPlatformSwitcher for Unity 2018 (and maybe other Unity versions)
// For Asset Database v1
// by Andy Miira (Andrei Müller), October 2019
//
// Based on:
// Unity – fast build platform switcher script! (by Aymeric - Da Viking Code)
// https://davikingcode.com/blog/unity-fast-build-platform-switcher-script/
//
// A simple fast platform switcher for Unity (by Waldo Bronchart)
// https://gist.github.com/waldobronchart/b3cb789c028c199e2855
@vcapra1
vcapra1 / hosts.rs
Created May 12, 2019 19:37
Rocket.rs route by subdomain
use rocket::{request::FromRequest, Outcome, Request};
pub struct WWWHost;
pub struct AAAHost;
impl<'a, 'r> FromRequest<'a, 'r> for WWWHost {
type Error = ();
fn from_request(request: &'a Request<'r>) -> rocket::request::Outcome<Self, Self::Error> {
if let Some(hostname) = request.headers().get_one("host") {
import discord
import asyncio
import requests
import json
client = discord.Client()
def check_psn(psn):
response = requests.post('https://accounts.api.playstation.com/api/v1/accounts/onlineIds', json={"onlineId": psn, "reserveIfAvailable": False})
return response.status_code != 401 and response.status_code != 400