Todos os commits
devem seguir de um prefixo.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
function generate() { | |
const random = (min, max) => Math.floor(Math.random() * (max - min) + min); | |
const numbers = [random(1, 100), random(1, 100)]; | |
const pointer = ['+', '-', '*', '/'][Math.floor(Math.random() * ['+', '-', '*', '/'].length)]; | |
let result; | |
try { | |
result = eval(`${numbers[0]} ${pointer} ${numbers[1]}`); | |
} catch { |
class Indexable { | |
constructor(){ | |
this._indexer = Symbol(); | |
} | |
[Symbol.toPrimitive](){ return this._indexer } | |
} | |
class Animal extends Indexable {} | |
const cat = new Animal(); |
// All valid credit card numbers | |
const valid1 = [4, 5, 3, 9, 6, 7, 7, 9, 0, 8, 0, 1, 6, 8, 0, 8]; | |
const valid2 = [5, 5, 3, 5, 7, 6, 6, 7, 6, 8, 7, 5, 1, 4, 3, 9]; | |
const valid3 = [3, 7, 1, 6, 1, 2, 0, 1, 9, 9, 8, 5, 2, 3, 6]; | |
const valid4 = [6, 0, 1, 1, 1, 4, 4, 3, 4, 0, 6, 8, 2, 9, 0, 5]; | |
const valid5 = [4, 5, 3, 9, 4, 0, 4, 9, 6, 7, 8, 6, 9, 6, 6, 6]; | |
// All invalid credit card numbers | |
const invalid1 = [4, 5, 3, 2, 7, 7, 8, 7, 7, 1, 0, 9, 1, 7, 9, 5]; | |
const invalid2 = [5, 7, 9, 5, 5, 9, 3, 3, 9, 2, 1, 3, 4, 6, 4, 3]; |
/** | |
* 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); |
*, *::before, *::after { | |
box-sizing: border-box; | |
} | |
* { | |
margin: 0; | |
} | |
html, body { | |
height: 100%; |
Experienced: JavaScript, TypeScript | |
Intermediate: C, C++, Java, V | |
Beginner: Go, Rust, Assembly (intending to learn) |
public final class Cache<T> extends ArrayList<T> { | |
protected T find(Predicate<T> predicate) { | |
for(T value : this) | |
if(predicate.test(value)) | |
return value; | |
return null; | |
} | |
} |
import com.google.gson.*; | |
import org.bukkit.Color; | |
import org.bukkit.DyeColor; | |
import org.bukkit.FireworkEffect; | |
import org.bukkit.Material; | |
import org.bukkit.block.banner.Pattern; | |
import org.bukkit.block.banner.PatternType; | |
import org.bukkit.enchantments.Enchantment; | |
import org.bukkit.inventory.ItemFlag; | |
import org.bukkit.inventory.ItemStack; |
import com.mojang.authlib.GameProfile; | |
import com.mojang.authlib.properties.Property; | |
import com.mojang.datafixers.util.Pair; | |
import io.netty.buffer.Unpooled; | |
import net.minecraft.core.BlockPosition; | |
import net.minecraft.nbt.NBTTagCompound; | |
import net.minecraft.network.PacketDataSerializer; | |
import net.minecraft.network.chat.IChatBaseComponent; | |
import net.minecraft.network.protocol.Packet; | |
import net.minecraft.network.protocol.game.*; |