Skip to content

Instantly share code, notes, and snippets.

View Starrysparklez's full-sized avatar
Something went wrong...

Starrysparklez

Something went wrong...
View GitHub Profile
@Starrysparklez
Starrysparklez / MessageCache.java
Created December 14, 2021 10:40
Cache implementation for JDA bots
public class MessageCache {
public final ArrayList<Message> messages = new ArrayList<>();
int messageLimit;
public MessageCache(int limit) {
messageLimit = limit;
}
public void addMessage(@Nonnull Message msg) {
for (Message m : messages)
@Starrysparklez
Starrysparklez / reactorControlApp.lua
Created November 4, 2021 20:03
ComputerCraft Controller for BigReactors
-- critical amount of fuel
settings_criticalFuelAmount = 1200
-- how many seconds wait before updating stats
settings_loopWaitTime = 1
-- animated icon color
settings_iconColor = colors.red
-- background color
@Starrysparklez
Starrysparklez / wsl-display-how-to.txt
Created July 24, 2021 18:26
Running GUI applications in WSL with display in Windows.
EN:
1. Download the VcXsrv application:
https://sourceforge.net/projects/vcxsrv/files/latest/download
2. Disable Windows Firewall (I had it blocking WSL somehow)
3. Run the VcXsrv application. Do not change any settings.
When you are prompted to enter additional parameters for VcXsrv, specify "-ac" there, and click "Next" and then "Done".
4. Enter the command `ipconfig.exe` at the Windows command prompt and copy the IPv4 address of the Ethernet adapter.
5. Run WSL and run the following command:
`export DISPLAY=IP_ADDRESS_FROM_IPCONFIG:0.0` (without ``)
For example, `export DISPLAY=192.168.43.109:0.0`
@Starrysparklez
Starrysparklez / dlmk.sh
Last active June 15, 2021 06:41
A script that disables the lowmemorykiller module in Android.
#!/bin/sh
# Works in android terminal (for example, Terminal Emulator from Google Play, Termux app or adb shell)),
# but requires root rights. You should run this script from root user.
#
# The lowmemorykiller module is responsible for clearing the
# device's RAM by terminating background processes.
#
# Have you ever noticed that after minimizing an application for 5 minutes,
# when you maximize it, it starts up as if you hadn't used it before?
@Starrysparklez
Starrysparklez / install.sh
Created May 31, 2020 09:59
Installing python multidict on Alpine Linux (useful while installing discord.py on devices running Alpine Linux)
sudo apk add clang gcc musl-dev
pip install multidict --user
@Starrysparklez
Starrysparklez / PIL.sh
Last active June 5, 2024 11:09
Install Python Imaging Library (PIL) on Termux
apt update && apt upgrade -y
apt install python make wget termux-exec clang libjpeg-turbo freetype -y
env INCLUDE="$PREFIX/include" LDFLAGS=" -lm" pip install Pillow