Skip to content

Instantly share code, notes, and snippets.

View Northernside's full-sized avatar
🐕

Elias Northernside

🐕
View GitHub Profile
@Northernside
Northernside / dhash.mjs
Created September 6, 2023 15:29
dHashing in Node.js
import Jimp from "jimp";
export async function getDHash(skin) {
skin.grayscale();
skin.resize(8, 9);
let dHash = "";
for (let y = 0; y < 9; y++) {
let rowHash = 0;
for (let x = 0; x < 8 - 1; x++) {
@Northernside
Northernside / laby_differ.mjs
Created July 5, 2023 16:15
diffs the labymod launcher code (very basic, not the best but i wanted it quick)
import fs from "node:fs";
import { compare } from "dir-compare";
const path1 = "apps/app-1.0.15";
const path2 = "apps/app-1.0.16";
const options = { compareSize: true };
compare(path1, path2, options)
.then(res => {
for (let diff of res.diffSet)

Keybase proof

I hereby claim:

  • I am northernside on github.
  • I am northernside (https://keybase.io/northernside) on keybase.
  • I have a public key ASD1g_7E-8RQZ5F-RMrTrtms92dPpCAG5GnvLVBlxNH9NAo

To claim this, I am signing this object:

@Northernside
Northernside / fuck_apple.md
Last active March 6, 2023 10:43
Apple's absolutely stupid decisions no one fucking asked for

What did Apple do wrong?

Short answer: Everything!

Long answer: Due to Apple's unreasonable company politics, you cannot write into /usr/ (and many other directories) as this goes against their System Integrity Protection which:

[...] is a security technology designed to help prevent potentially malicious software from modifying protected files and folders on your Mac. System Integrity Protection restricts the root user account and limits the actions that the root user can perform on protected parts of the Mac operating system. (source)

This is absolutely bullshit when you consider the fact that Apple actually lets you.. kinda? disable this stupid protection without the option to disable it actually working! To disable it you have to find your way into the RCM (Recovery Mode) and then type csrutil disable, bla bla bla.. Though, it doesn't work, because the next time you want to write into these protected parts, macOS will throw you another error which neit

import {Readable} from "node:stream";
import {finished} from "node:stream/promises";
import FS from "node:fs";
for (let i = 1; i <= 200; i++) {
const {body, status} = await fetch(`https://git.laby.tech/uploads/-/system/user/avatar/${i}/avatar.png`);
if (status !== 200)
continue;
const stream = FS.createWriteStream(`avatar/${i}.png`);
@Northernside
Northernside / smartArrange.js
Created November 21, 2022 16:12
Automatically arrange array elements to make the most of them fit into a specific character limitation
/*
@Northernside - Elias
Created on 20th November 2022,
Last edited on 21st November 2022
*/
function smartArrange(array, charLimit) {
/*
We're going to use Bubble Sort here, it might not be the quickest one, but I. Don't. Care. :)
Also, I'm using nested for-loops, but I. Don't. Care.
let url = location.href.split("/");
let gameCode = "876204";
let terms = [];
let definitions = [];
function parseQuestions() {
let q = questions.termIdToTermsMap;
let qKeys = Object.keys(q);
terms = [];
definitions = [];
@Northernside
Northernside / index.html
Created January 26, 2021 16:21
Simple Electron IPC messages transmitter and receiver
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
<button id="test">Test</button>