Skip to content

Instantly share code, notes, and snippets.

@Plagiatus
Plagiatus / ms_auth_class.ts
Created September 12, 2021 15:19
A basic implementation for a full flow of Microsoft-Login -> Minecraft Auth + Player Info. No error handling included for easier understandability.
import { XMLHttpRequest } from "xmlhttprequest";
interface AuthorizationTokenResponse {
token_type: string,
expires_in: number,
scope: string,
access_token: string,
refresh_token: string,
user_id: string,
foci: string
@xDimGG
xDimGG / app.js
Created October 15, 2017 19:07
Basic Discord OAuth2 Example
const { get, post } = require('snekfetch');
const express = require('express');
const btoa = require('btoa');
const app = express();
const cfg = {
id: 'get_one',
secret: 'get_one'
};
@citrusui
citrusui / dropdown.md
Last active April 21, 2024 18:44
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 3, 2024 18:53
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@graywolf336
graywolf336 / BukkitSerialization.java
Last active April 30, 2024 02:00
Serialize and deserialize the player's inventory, including armor and content.
/**
* Converts the player inventory to a String array of Base64 strings. First string is the content and second string is the armor.
*
* @param playerInventory to turn into an array of strings.
* @return Array of strings: [ main content, armor content ]
* @throws IllegalStateException
*/
public static String[] playerInventoryToBase64(PlayerInventory playerInventory) throws IllegalStateException {
//get the main content part, this doesn't return the armor
String content = toBase64(playerInventory);
@saidinesh5
saidinesh5 / Makefile
Created May 18, 2012 21:35
A nice Makefile for my Node.js projects.
#
# My Fancy Node.js project
#
PROJECT = "My Fancy Node.js project"
all: install test server
debug: ;@echo "Debugging ${PROJECT}.....http://0.0.0.0:8080/debug?port=5858 to start debugging"; \