Skip to content

Instantly share code, notes, and snippets.

View CyberFlameGO's full-sized avatar
💠
Hey, I’m Cyber/Aaron.

CyberFlame CyberFlameGO

💠
Hey, I’m Cyber/Aaron.
View GitHub Profile
@CyberFlameGO
CyberFlameGO / VolatileExample.java
Created October 20, 2021 05:08
Java volatility
public class VolatileExample {
/*
ESSENTIALLY, WITHOUT VOLATILE THREADS OTHER THAN MAIN WON'T BE ABLE
TO FETCH THE MOST UPDATED VALUE FOR THIS VARIABLE AS IT IS FETCHING FROM
CPU CATCH, THEREFORE, TO SURPASS THIS, WE USE VOLATILE AS IT WILL FORCE
THE SYSTEM TO FETCH THE TARGET VARIABLE DIRECTLY FROM MAIN MEMORY.
*/
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
public class KeyUtils {
public static SecretKey rebuildKey(String encodedKey){
final byte[] decodedKey = Base64.getDecoder().decode(encodedKey);
@CyberFlameGO
CyberFlameGO / xp.md
Created October 28, 2021 06:34 — forked from Fuwn/xp.md
Windows XP All Editions Universal Product Keys Collection.

Although Microsoft does not support Windows XP updates any more, I’m sure there are still many users using it due to their personal habits or job demands. Therefore XP’s product keys may be necessary even now, and 8cy provided you with the most comprehensive Windows XP product keys here, just in order to provide some convenience.

The following CD-KEYs are official and original from Microsoft, mainly used for Windows XP Professional Service Pack 2/3 VOL/VLK system images which are the easiest ones to find on the Internet. Their biggest advantage is your Windows XP will be activated after using these CD-KEYs to complete installation.

// Windows XP Pro Product Keys //

/**
* Utility message for sending version independent actionbar messages as to be able to
* support versions from 1.8 and up without having to disable a simple feature such as this.
*
* @param player the recipient of the actionbar message.
* @param message the message to send. If it is empty ("") the actionbar is cleared.
*/
public void sendActionbar(Player player, String message) {
if (player == null || message == null) return;
@CyberFlameGO
CyberFlameGO / asynctosync.java
Created November 18, 2021 09:34
this is a small snippet for running sync code asynchronously (just a task in an async scheduler)
Bukkit.getScheduler().runTaskTimerAsynchronously(LumberHarvester.getInstance(), () -> {
Bukkit.getScheduler().runTask(VoidFlame.getPlugin(), () -> {
World world = Bukkit.getWorld("world");
world.spawnEntity(new Location(world, 0, 100, 0), EntityType.PRIMED_TNT);
});
}, 0L, 20L);
@CyberFlameGO
CyberFlameGO / BitBucketOutputStream.java
Created December 7, 2021 08:37
Basically a replacement for /dev/null
import java.io.*;
/**
* A repository for unwanted bytes.
* Basically a replacement for <code>/dev/null</code>
*/
public class BitBucketOutputStream extends OutputStream
{
/**
* Sets System.out to use the BitBucketOutputStream as the output
* stream. In effect, redirecting standard out to oblivion.
@CyberFlameGO
CyberFlameGO / MRJTempFolder.java
Created December 7, 2021 08:38
Returns the Temporary Items Folder on the Mac OS.
import java.io.File;
import java.io.FileNotFoundException;
import com.apple.mrj.MRJFileUtils;
public class MRJTempFolder
{
/**
* Returns the Temporary Items Folder on the Mac OS.
* @return a File object representing the Temporary Items Folder,
* or null, if it could not be found.
@CyberFlameGO
CyberFlameGO / cards.ts
Created December 8, 2021 07:44 — forked from melmsie/cards.ts
Dank Memer Blackjack Command Files
import * as Constants from './constants';
const randomInArray = <T>(arr: readonly T[]): T =>
arr[Math.floor(Math.random() * arr.length)];
export interface Card {
suit: typeof Constants.SUITS[number];
face: typeof Constants.FACES[number];
baseValue: number;
};
@CyberFlameGO
CyberFlameGO / main.go
Created December 8, 2021 07:46 — forked from melmsie/main.go
package main
import (
// "encoding/json"
"flag"
"fmt"
"github.com/bwmarrin/discordgo"
"log"
"net/http"
"os"
@CyberFlameGO
CyberFlameGO / test.js
Created December 8, 2021 07:46 — forked from melmsie/test.js
//Main JS file
const Eris = require('eris');
Eris.Client.prototype.setupListeners = function() {
if (!this._listeners) this._listeners = [];
for (let listener of this._listeners) {
this.removeListener(listener.eventName, listener.listener);
}