This file contains 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
/* | |
* SPDX-License-Identifier: MIT | |
* | |
* Copyright (C) 2022 RainbowDashLabs | |
*/ | |
import java.util.Arrays; | |
import java.util.HashMap; | |
import java.util.LinkedHashSet; | |
import java.util.Map; |
This file contains 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
WITH | |
tables AS ( | |
SELECT | |
oid::REGCLASS::TEXT AS table_name, | |
CASE relkind | |
WHEN 'm' THEN 'materialized_view' | |
WHEN 'r' THEN 'table' | |
WHEN 'v' THEN 'view' | |
END AS type | |
FROM |
This file contains 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
echo "Create a directory for our bot" | |
mkdir repbot | |
# Enter it | |
cd repbot | |
# Get the reputation bot repository | |
git clone https://github.com/RainbowDashLabs/reputation-bot.git repo | |
echo "Copy logging config into config directory" | |
mkdir config | |
cp repo/src/main/resources/log4j2.xml config/log4j2.xml | |
echo "Getting scripts for running and upgrading" |
This file contains 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 org.bukkit.Material; | |
import org.bukkit.configuration.serialization.ConfigurationSerializable; | |
import org.bukkit.inventory.ItemStack; | |
import org.bukkit.inventory.PlayerInventory; | |
import java.util.Arrays; | |
import java.util.List; | |
public class InventoryContainer { | |
private final List<SerializeContainer> contents; |
This file contains 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
CREATE FUNCTION snowflake_to_unix_timestamp(snowflake BIGINT) RETURNS TIMESTAMP | |
LANGUAGE plpgsql | |
PARALLEL SAFE | |
IMMUTABLE | |
AS | |
$BODY$ | |
BEGIN | |
-- message_id::BIT(64) AS bits | |
-- bits::BIT(42) AS timestamp_bits | |
-- timestamp_bits::BIGINT AS discord_epoch |
This file contains 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
#!/bin/bash | |
# switch to config directory | |
while true; do | |
# Of course you can use any other executable file here. We use java. | |
java \ | |
-Xms256m \ | |
-Xmx2048m \ |
This file contains 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
// Workaround for https://github.com/aadnk/ProtocolLib/issues/191/ | |
package de.eldoria.util; | |
import com.comphenix.protocol.events.PacketContainer; | |
import net.kyori.adventure.text.TextComponent; | |
import java.util.function.Function; | |
import java.util.logging.Level; | |
public class AdventureComponentAdapter { |
This file contains 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
#!/bin/bash | |
# This script can help you when you forgot the pin for your disney plus profile. | |
# Dont use it to get access to other members of your account. This is only for your own profile :3 | |
# Arguments: <start> <end> <profile_id> <token> | |
# start and end are the first and last pin to be checked. zeros will be added by the script. | |
# the profile id can be found in the url url when you have to enter your pin | |
# the token can be found in any request which requires authentification. try a pin to get it for example. | |
# the token has to be entered without the "Bearer" in front of it. | |
FIRST=$1 | |
LAST=$2 |
This file contains 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 org.bukkit.plugin.Plugin; | |
import javax.sql.DataSource; | |
import java.sql.Connection; | |
import java.sql.SQLException; | |
import java.util.logging.Level; | |
public abstract class PluginDataHolder { | |
private final DataSource source; | |
private final Plugin plugin; |
This file contains 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 org.bukkit.Bukkit; | |
import org.bukkit.plugin.Plugin; | |
import org.bukkit.scheduler.BukkitScheduler; | |
import javax.annotation.CheckReturnValue; | |
import java.util.function.Consumer; | |
import java.util.function.Supplier; | |
import java.util.logging.Level; | |
public final class BukkitAsyncAction<T> { |