Skip to content

Instantly share code, notes, and snippets.

View MrPowerGamerBR's full-sized avatar
:shipit:
We facepalm, we shrug and we hack around it and never look back.

MrPowerGamerBR MrPowerGamerBR

:shipit:
We facepalm, we shrug and we hack around it and never look back.
View GitHub Profile
package com.mrpowergamerbr.loritta.utils.oauth2
import com.github.kevinsawicki.http.HttpRequest
import com.github.salomonbrys.kotson.fromJson
import com.github.salomonbrys.kotson.long
import com.github.salomonbrys.kotson.obj
import com.github.salomonbrys.kotson.string
import com.google.gson.Gson
import com.google.gson.JsonElement
import com.google.gson.JsonObject
@MrPowerGamerBR
MrPowerGamerBR / main.kt
Last active March 14, 2019 22:17
Discord's Rich Presence in JDA
import net.dv8tion.jda.core.AccountType
import net.dv8tion.jda.core.JDABuilder
import java.io.File
import net.dv8tion.jda.core.WebSocketCode
import net.dv8tion.jda.core.entities.impl.JDAImpl
import org.json.JSONObject
fun main(args: Array<String>) {
val token = File("D:\\discord_token.txt").readText()
val jda = JDABuilder(AccountType.CLIENT).setToken(token).buildBlocking()
@MrPowerGamerBR
MrPowerGamerBR / akinator.kt
Last active August 20, 2017 18:53
Kotinator: A small Akiantor (reversed engineered) API implementation in Kotlin
package com.mrpowergamerbr.akinator
import com.github.kevinsawicki.http.HttpRequest
import com.github.salomonbrys.kotson.array
import com.github.salomonbrys.kotson.get
import com.github.salomonbrys.kotson.int
import com.github.salomonbrys.kotson.long
import com.github.salomonbrys.kotson.obj
import com.github.salomonbrys.kotson.string
import com.google.gson.JsonParser
package com.mrpowergamerbr.loritta.utils
val morseValues = mapOf(
// ALFABETO
'A' to ".-",
'B' to "-...",
'C' to "-.-.",
'D' to "-..",
'E' to ".",
'F' to "..-.",
@MrPowerGamerBR
MrPowerGamerBR / data.json
Created June 25, 2017 23:08
AminoREAPI - Community Info
{
"currentUserInfo":{
"notificationsCount":1,
"unreadChatThreadsCount":0,
"userProfile":{
"status":0,
"itemsCount":0,
"consecutiveCheckInDays":null,
"uid":"cd481edf-231f-42f2-bf2b-256fde90ef54",
"modifiedTime":"2017-06-25T22:57:51Z",
@MrPowerGamerBR
MrPowerGamerBR / amino.json
Created June 25, 2017 22:50
AminoREAPI - Suggested Aminos
{
"api:statuscode":0,
"api:duration":"0.004s",
"api:message":"OK",
"communityList":[
{
"status":0,
"endpoint":"star-vs-as-forcas-do-mal-pt-br",
"name":"Star Vs As For\u00e7as Do Mal PT/BR",
"modifiedTime":"2016-11-01T01:04:54Z",
@MrPowerGamerBR
MrPowerGamerBR / online.js
Created June 17, 2017 13:53
Comando customizado para a https://loritta.website/
var json = pegarConteúdoDeUmaURL("https://mcapi.ca/query/jogar.sparklypower.net/players"); // Pegar o texto em JSON
var obj = JSON.parse(json);
var online = obj.players.online;
var max = obj.players.max;
contexto.responder("**" + online + "**/**" + max + " ** players online no SparklyPower! 🎉");
TempoParaEsperar: 15 # Em segundos, deixe em 0 para desativar
TempoParaExpirar: 120 # Em segundos, deixe em 0 para desativar
TeletransporteSeguro: true
Mensagens:
EspereSegundos: "&cVocê precisa esperar {segundos} segundos antes de poder enviar outro pedido!"
NaoExisteOuOffline: "&c{player} está offline!"
MesmoPlayer: "&cVocê não pode enviar um pedido para si mesmo!"
JaEnviou: "&cVocê já enviou um pedido de teletransporte para {pedido}"
EnviadoComSucesso: "&aPedido enviado com sucesso!"
Aceitar: "&a&lCLIQUE AQUI"
@MrPowerGamerBR
MrPowerGamerBR / ImageUtils.java
Created April 2, 2017 16:34
Write text in images (and wrap it if needed)
package com.mrpowergamerbr.loritta.utils;
import java.awt.FontMetrics;
import java.awt.Graphics;
public class ImageUtils {
/**
* Escreve um texto em um Graphics, fazendo wrap caso necessário
* @param text Texto
* @param startX X inicial
1. First, you spawn an armor stand
2. Then you spawn an shulker
3. Make the shulker ride the armor stand
4. Spawn another armor stand in the same location as the previous armor stand
5. Spawn a falling block
6. Make the falling block ride the previous armor stand
7. Success!
TL;DR: Armor Stands