Skip to content

Instantly share code, notes, and snippets.

View Mati365's full-sized avatar
🍋
Lemons

Mateusz Bagiński Mati365

🍋
Lemons
View GitHub Profile
@adtac
adtac / Dockerfile
Last active May 28, 2024 01:38
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@nomaster
nomaster / configuration.nix
Last active April 7, 2024 09:14
NixOS Configuration for experimental K3S cluster node
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
@giuseppe998e
giuseppe998e / nixos-btrfs-tmpfs.md
Last active June 15, 2024 23:31
Install NixOS with BTRFS and IN-RAM root

Install NixOS with BTRFS and IN-RAM root

1. Format and partition the hard drive

  1. Create the GPT partition table
    • $ parted /dev/sdX mklabel gpt
  2. Create the UEFI FAT32 partition (which will be /dev/sdXY)
    • $ parted /dev/sdX mkpart esp fat32 1MiB 512MiB
    • $ parted /dev/sdX set 1 esp on
    • $ parted /dev/sdX set 1 boot on
  • $ mkfs.fat -F 32 -n UEFI /dev/sdXY
@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active July 12, 2024 23:04
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

@skeeto
skeeto / README.md
Last active December 20, 2021 14:00
AI driving simulation
We can't make this file beautiful and searchable because it's too large.
Id,Data,Nick,Pasek,Autor,Tytuł,Gatunek,Ocena
50801421,2020-07-15 21:55:08,ranunculus,niebieski,Peter Heller,Gwiazdozbiór Psa,"Fantastyka, Postapo",7
50799873,2020-07-15 20:30:14,leuler,niebieski,Jason Schreier,"Krew, pot i piksele. Chwalebne i niepokojące opowieści o tym, jak robi się gry.",literatura faktu,6
50797785,2020-07-15 18:33:25,xandra,różowy,Martyna Raduchowska,Czarne Światła: Łzy Mai (tom I) i Spektrum (tom II),cyberpunk/sf/kryminał,8
50792029,2020-07-15 11:11:02,vivianka,różowy,Jeff Lindsay,Dekalog Dextera,kryminał,6
50791721,2020-07-15 10:44:18,vivianka,różowy,Magda Stachula,W pułapce,kryminał,6
50791493,2020-07-15 10:24:42,TeczkiUkladyAgentury,niebieski,Grzegorz Braun,A nie mówiłem? Koronawirus i III Wojna Światowa. Czy Polska przetrwa największy globalny kryzys od 100 lat?,publicystyka,
50786203,2020-07-14 23:05:19,konik_polanowy,niebieski,"Zbigniew Lew-Starowicz, Krystyna Romanowska",O rozkoszy,psychologia,5
50782305,2020-07-14 19:36:48,ranunculus,niebieski,Wiktor Noczkin,Lichwiarz,Fantasy,6
5
@liemle3893
liemle3893 / .gitlab-ci.yml
Created April 1, 2020 12:27
Gitlab CI with Nomad
# Disable the Gradle daemon for Continuous Integration servers as correctness
# is usually a priority over speed in CI environments. Using a fresh
# runtime for each build is more reliable since the runtime is completely
# isolated from any previous builds.
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
DOCKER_TLS_CERTDIR: ""
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
@goll
goll / README.md
Last active July 7, 2024 10:49
Docker nftables configuration for Debian 10
@zarv1k
zarv1k / abstract-unique-validator.ts
Last active April 12, 2024 07:14
Unique Validator Example for NestJS
import { ValidationArguments, ValidatorConstraintInterface } from 'class-validator';
import { Connection, EntitySchema, FindConditions, ObjectType } from 'typeorm';
interface UniqueValidationArguments<E> extends ValidationArguments {
constraints: [
ObjectType<E> | EntitySchema<E> | string,
((validationArguments: ValidationArguments) => FindConditions<E>) | keyof E,
];
}
@reecelucas
reecelucas / useScrollBlock.js
Last active July 18, 2024 15:01
React hook to enable/disable page scroll
import { useRef } from 'react';
const safeDocument = typeof document !== 'undefined' ? document : {};
/**
* Usage:
* const [blockScroll, allowScroll] = useScrollBlock();
*/
export default () => {
const scrollBlocked = useRef();