Skip to content

Instantly share code, notes, and snippets.

View nonnullish's full-sized avatar
🌼
fighting typescript, probably

nonnullish

🌼
fighting typescript, probably
View GitHub Profile
@nonnullish
nonnullish / mocking-t-from-i18next-in-jest-unit-tests.md
Created April 18, 2023 14:37
Mocking { t } from i18next in Jest unit tests

service.ts

import { t } from 'i18next';

export const myFunction = () => t('label.myLabel');

service.spec.ts

@nonnullish
nonnullish / util.js
Created December 13, 2022 08:26
Run JSON-server with multiple database .json files.
/*
JSON-server is unable to serve multiple files at once.
(https://stackoverflow.com/questions/36836424/cant-watch-multiple-files-with-json-server)
This is a quick script for making a joint db.json file.
Directory structure:
db/
├─ chunks/
│ ├─ example1.json
@nonnullish
nonnullish / making-windows-11-usable.md
Last active June 16, 2024 03:39
Making Windows 11 Usable

Making Windows 11 Usable

Remove Garbage

Sophia Script for Windows

Keep in mind that if you're not careful when selecting the settings, not only will it remove the preinstalled TikTok app but also the default photo viewer. Other than that works great.

Fix Explorer and Right Click Menus

Explorer Patcher

@nonnullish
nonnullish / abstract-ascii.py
Created April 7, 2021 08:56
generate abstract ascii patterns
from numpy import meshgrid
from random import choice, randrange
import argparse
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(description='generate abstract ascii patterns')
parser.add_argument('width', type=int, nargs='?', default=15);
parser.add_argument('height', type=int, nargs='?', default=9);
@nonnullish
nonnullish / recolor.py
Last active March 30, 2022 12:11
black nozzle doesn't work so we try with some other one let's go
from pdf2image import convert_from_path
from PIL import Image, ImageOps
import argparse
import itertools
from os import path, system
import tempfile
parser = argparse.ArgumentParser()
parser.add_argument("filename")
@nonnullish
nonnullish / nip.py
Created July 23, 2020 18:38
get the data of a company from its vat identification number (polish NIP)
import sys
import requests
from bs4 import BeautifulSoup
import re
if len(sys.argv) == 1:
sys.exit()
nip = sys.argv[1]