Skip to content

Instantly share code, notes, and snippets.

View leafypout's full-sized avatar

Levi leafypout

  • New Zealand
  • 08:58 (UTC +12:00)
View GitHub Profile
@leafypout
leafypout / file.js
Created November 23, 2024 07:33
Zed crash
(function zZMIJMvfSK(){TY();mzf();rrF();var pM=function(J3,lB){return J3===lB;};var NS=function(X2,T3){return X2>T3;};var C7=function W8(bB,SB){'use strict';var BM=W8;switch(bB){case T9:{var Zt;Y3.push(kh);return Zt=this[RG()[cZ(nh)].apply(null,[rt,lX,pX])],Y3.pop(),Zt;}break;case Fd:{var ZI;Y3.push(IB);return ZI=this[GL()[DI(kB)](rt,m2,RX,Xt,CI)],Y3.pop(),ZI;}break;case Uq:{var qp=SB[K0];Y3.push(LT);this[Z2()[RZ(PB)](I3,C8,v3,L8,P2,I7)]=qp;Y3.pop();}break;case Bq:{var tc=SB[K0];var hL=SB[Hn];Y3.push(A7);if(ID(hL,null)||NS(hL,tc[RG()[cZ(Gh)].call(null,C8,x3,Im)]))hL=tc[RG()[cZ(Gh)](C8,x3,Im)];for(var rI=Gh,LD=new (dJ[ZM()[WZ(dS)](wL,dM)])(hL);CG(rI,hL);rI++)LD[rI]=tc[rI];var xc;return Y3.pop(),xc=LD,xc;}break;case QN:{var xL;Y3.push(Hc);return xL=this[WB(typeof ZM()[WZ(U3)],NZ('',[][[]]))?ZM()[WZ(ht)](Ht,lc):ZM()[WZ(rt)].call(null,th,k8)],Y3.pop(),xL;}break;case wf:{var Sh=SB[K0];Y3.push(cp);this[pS()[JI(EM)].call(null,rt,Zh,R7,U3,bt,qG)]=Sh;Y3.pop();}break;case FY:{var Ih=SB[K0];Y3.push(I2);this[fG()[ND(SM)]
@leafypout
leafypout / encrypt.js
Created July 17, 2023 08:22
Adyen 4.5.0 encryption
/*
* Adyen 4.5.0 encryption by github.com/levi-nz
*
* This code is a rough implementation and can be improved in some places.
* Read comments throughout the code for more information.
*/
const jose = require('node-jose');
// Parse the key from the string found in securedFields.html ("10001|...")
@leafypout
leafypout / calculate_compute_hours.py
Last active June 15, 2023 02:43
Calculate approximate GameLift compute usage from player count and other variables
# --- CONFIG ---
# Options here can be set by normal users.
# Total amount of players playing the game
n_players = 500
# Amount of players per match (includes both teams)
n_players_per_match = 16 * 2 # 16 players per team
# Duration (in minutes) of each match
match_duration_mins = 30
# How many hours the playtest lasts
@leafypout
leafypout / ordered_json_object.py
Created May 18, 2023 15:53
JSON key ordering in objects
import json
class OrderedObjectDecoder(json.JSONDecoder):
def __init__(self, *args, **kwargs):
json.JSONDecoder.__init__(self, object_hook=self.object_hook, *args, **kwargs)
def object_hook(self, obj):
return {key: value for key, value in sorted(obj.items())}
@leafypout
leafypout / gist:55c230e32a8ef1038dac49d0dd941041
Created October 15, 2021 07:46
Verizon IP range scraping result
GOROOT=/usr/local/go #gosetup
GOPATH=/Users/levi/go #gosetup
/usr/local/go/bin/go build -o /private/var/folders/bt/w6199q096tn8yr5g8hp1b6jm0000gn/T/GoLand/___go_build_github_com_LeviDevs_verizon_business_finder_main github.com/LeviDevs/verizon-business-finder/main #gosetup
/private/var/folders/bt/w6199q096tn8yr5g8hp1b6jm0000gn/T/GoLand/___go_build_github_com_LeviDevs_verizon_business_finder_main -apiKey=at_TdCzkzo9LFvsVfeoVSzyq5DZz7Jef
2021/10/15 20:40:15 64.35.25.224: https://www.verizon.com/business/xo/
2021/10/15 20:40:15 62.189.90.96: https://www.verizon.com/business/
2021/10/15 20:40:16 71.123.55.72: https://www.verizon.com/business/
2021/10/15 20:40:16 65.201.80.192: https://www.verizon.com/business/
2021/10/15 20:40:16 65.46.218.244: https://www.verizon.com/business/xo/
2021/10/15 20:40:16 66.104.48.16: https://www.verizon.com/business/xo/
State is now HANDSHAKING
Jun 03, 2019 7:54:19 PM io.netty.channel.DefaultChannelHandlerContext invokeExceptionCaught
WARNING: An exception was thrown by a user handler's exceptionCaught() method while handling the following exception:
io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(1) + length(1) exceeds writerIndex(1): UnpooledHeapByteBuf(ridx: 1, widx: 1, cap: 1)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:263)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:131)
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337)
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173)
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337)
@leafypout
leafypout / gist:1b28bbd75f80529fbdba6e1b1aa9afc4
Created June 1, 2019 13:35
Lunar Client Ban Wave #1 JSON data
{"servers":["faithfulmc.com"],"uuid":06cca004-913d-4279-8720-9a6dfda4a2ad,"username":"incrust"}
{"servers":["lunar.gg"],"uuid":0965dc54-f9be-40ec-8d6c-5e848857833b,"username":"Cobalt_Will"}
{"servers":["pvptemple.com","minemen.club","faithfulmc.com","cavepvp.com","squads.gg"],"uuid":3304556a-8730-47ca-8681-8fcaa5ab95c8,"username":"Rolm"}
{"servers":["faithfulmc.com","lunar.gg"],"uuid":fceab8f9-3568-404d-9f50-7a338e3704e7,"username":"Checkiing"}
{"servers":["lunar.gg"],"uuid":619fd4ae-9e54-47fb-9569-8f5e1495a844,"username":"Deciple"}
{"servers":["pvptemple.com","faithfulmc.com","lunar.gg"],"uuid":2ceb5779-017b-4fd5-aa3d-beca94393585,"username":"1x21"}
{"servers":["lunar.gg"],"uuid":ecb99c38-63ba-4aee-878f-072f30600918,"username":"Jakhe"}
{"servers":["lunar.gg"],"uuid":406a3bf2-ba70-463f-ad7e-396d5f6eb863,"username":"clownedGG"}
{"servers":["sagepvp.org","lunar.gg"],"uuid":2fd24d40-88ec-4a35-a6c3-f7f49bb782c8,"username":"Nyzy"}
{"servers":["holyh.cf","eaglehcf.com","ghostly.live","lunar.gg","pvpgang.club"],"uui
@leafypout
leafypout / Packet ID mappings 1_7_R4
Last active May 14, 2019 01:52
1.7.10 protocol packet ID mappings
SERVERBOUND: 0, C00Handshake
CLIENTBOUND: 0, S00PacketKeepAlive
CLIENTBOUND: 1, S01PacketJoinGame
CLIENTBOUND: 2, S02PacketChat
CLIENTBOUND: 3, S03PacketTimeUpdate
CLIENTBOUND: 4, S04PacketEntityEquipment
CLIENTBOUND: 5, S05PacketSpawnPosition
CLIENTBOUND: 6, S06PacketUpdateHealth
CLIENTBOUND: 7, S07PacketRespawn
CLIENTBOUND: 8, S08PacketPlayerPosLook