Skip to content

Instantly share code, notes, and snippets.

View gutyerrez's full-sized avatar
🏠
Working from home

Vinícius Gutierrez gutyerrez

🏠
Working from home
View GitHub Profile
{
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma",
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"breadcrumbs.enabled": true,
"console-ninja.featureSet": "Community",
@gutyerrez
gutyerrez / esm-package.md
Created December 19, 2022 02:35 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
export class ObjectHelper {
public static snakeCase = (objects: any[]): any[] => {
var newKeys: any[] = []
for (const object of objects) {
const newObject = {}
for (const key of Object.keys(object)) {
newObject[
key.replace(/[A-Z]/, (char) => `_${char.toLowerCase()}`)
public void execute(CommandSender sender, String[] args) {
Integer onlineCount = ProxyServer.getInstance().getOnlineCount();
// recomendo utilizar o new ComponentBuilder()
// e o .appendLegacy(String) por que por padrão o bungeecord possui problemas com a formatação de textos
// então não usa o .append(String) :)
if (!(sender instanceof ProxiedPlayer)) {
sender.sendMessage(
new ComponentBuilder()
package com.gutyerez.core.spigot.misc.utils
import com.gutyerrez.core.spigot.CoreSpigotPlugin
import io.netty.channel.*
import net.minecraft.server.v1_8_R3.NetworkManager
import net.minecraft.server.v1_8_R3.PacketLoginInStart
import org.bukkit.Bukkit
import org.bukkit.craftbukkit.v1_8_R3.CraftServer
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer
import org.bukkit.entity.Player