Skip to content

Instantly share code, notes, and snippets.

@BGMP
BGMP / Postgres.java
Created January 1, 2021 00:17
Example
package cl.bgmp;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Properties;
public class Main {
@BGMP
BGMP / CommandBlockEvents.java
Last active December 24, 2020 01:06
Command blocks's @s breaks on Bukkit. This fixes it for close interactions.
package cl.bgmp.lobbyx.listeners;
import cl.bgmp.lobbyx.events.PreciseCommandBlockEvent;
import org.bukkit.Bukkit;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.CommandBlock;
import org.bukkit.command.BlockCommandSender;
import org.bukkit.event.EventHandler;
@BGMP
BGMP / GitHub-Styling.md
Last active November 13, 2021 19:10
CSS snippet to revert a bit of the new GitHub styles.

boop.css

As stated in the description, this is a small CSS snippet which aims to revert a little bit of the new changes made to Github's styling.

It currently:

  • Centres repositories and their headers.
  • Aligns the status emoji's text a bit better.
  • Gets raid of some rounded shapes that didn't exist before.
@BGMP
BGMP / FlashComponent.java
Last active June 14, 2020 08:09
BungeeCoord TextComponent Wrapper
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
# A model that tracks which Users have viewed it, when they last viewed it,
# and the number of updates that have happened since (i.e. the "unread" count).
module Viewable
extend ActiveSupport::Concern
include Mongoid::Document
INDEX_visibly_updated_at = {visibly_updated_at: -1}
INDEX_user_unread = {'views.user' => 1, 'views.unread' => 1}
included do
@BGMP
BGMP / NPC.java
Last active December 15, 2020 17:51
boop
package net.braehmc.bgnpc.NPC;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import net.minecraft.server.v1_8_R3.*;
import org.bukkit.Bukkit;