Skip to content

Instantly share code, notes, and snippets.

View almostSouji's full-sized avatar
🦈

Souji almostSouji

🦈
View GitHub Profile
@almostSouji
almostSouji / lineprops.py
Created April 3, 2024 10:17
Simple py script to find the longest and highest entropy lines in a file
#!/usr/bin/env python3
from collections import Counter
from math import log
def entropy(text):
cc = Counter(text)
ps = [float(cc[c]/len(text)) for c in cc]
return -sum([p * log(p)/log(2.0) for p in ps])
@almostSouji
almostSouji / dirdiff.sh
Last active April 3, 2024 10:24
Get a diff of two directories using git (sifferences to orginal code basis)
git diff --no-index --ignore-all-space a/path b/path > some_filename
@almostSouji
almostSouji / assignment.tex
Created May 2, 2023 12:59
LaTex assignment template
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,257mm},
left=20mm,
top=20mm,
footskip = \dimexpr\headsep+\ht\strutbox\relax,
}
@almostSouji
almostSouji / TOKEN
Last active April 15, 2024 12:19
You leaked your token. This is probably how you get here
- ODAxMDMwNzMwMDg3NjYxNTk4.GMTHHg.hWM_MP5rwLqGvt0zwqKED1seGagSKS4MRaO6lM
- ODAxMDMwNzMwMDg3NjYxNTk4.GjTpli.p3ojBQjVtgUprd5tQbZGzc80iarPBnIN3eH628
- Nzk0MjQwMzQwNjM4NDMzMzUw.G1rTAp.0I6gCjJglZNfLtFrAjufrT-CaaKYcNv0EGGwO0
- MTIyNDcwMjc5ODI4OTk2MDk4MQ.GhSprd.66SUyc9IpjE7ASgsGgT5jjMLQZ5w9K1DGkVNQU

Keybase proof

I hereby claim:

  • I am almostsouji on github.
  • I am moeh (https://keybase.io/moeh) on keybase.
  • I have a public key ASBoHa8beHBnVU1z38yFC428OOr-eGt0eI9NnIEZf_U-Cgo

To claim this, I am signing this object:

@almostSouji
almostSouji / 01_intro.md
Last active December 27, 2023 10:24
Discord.js: Collections but Cookies

Discord.js Collections explained with cookies

Intro

I keep seing people that have issues with understanding our Collection class.

Note

Boiled down to essentials, Collection just extends the base JavaScript Map class with Array-like methods.

If that's enough for you to understand, you can stop reading here.