Skip to content

Instantly share code, notes, and snippets.

View Endermanch's full-sized avatar
😴
Working on 20 projects at once...

Andrew Endermanch

😴
Working on 20 projects at once...
View GitHub Profile
@Endermanch
Endermanch / swag.py
Created August 20, 2025 15:28
Swag and unswag your IP address
def swag(ip: str) -> int:
parts = ip.strip().split('.')
if len(parts) != 4:
raise ValueError("Invalid IPv4 address: must have 4 octets")
total = 0
for i, p in enumerate(parts):
@Endermanch
Endermanch / vite.ts
Last active January 27, 2024 10:59
Vite build.rollupOptions.output.manualChunks() example to chunk per each vendor package (node_modules)
...
vite: {
build: {
rollupOptions: {
output: {
manualChunks(id: string) {
if (id.includes('node_modules/')) {
return id
.split('node_modules/')[1]