Skip to content

Instantly share code, notes, and snippets.

View Sigmanificient's full-sized avatar
🎲
Continuing random projets

Yohann Boniface Sigmanificient

🎲
Continuing random projets
View GitHub Profile
@Sigmanificient
Sigmanificient / top_nixpkgs_nix_files.sh
Created April 30, 2024 06:18
Get the amount of nix lines within the top 10 nixpkgs' nix files
find . -type f -name "*.nix" \
| xargs -i sh -c " \
cat {} \
| wc -l \
| xargs printf '%06d'; printf '\t%s\n' {}" \
| sort \
| tail -n 10 \
| tr '\t' ' ' \
| cut -d ' ' -f 1 \
| paste -s -d+ - \
@Sigmanificient
Sigmanificient / get_maintainerless_pkgs.bash
Last active April 28, 2024 13:25
Retrieve a json listing main information about packages that have no maintainers
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq brotli
url="https://channels.nixos.org/nixpkgs-unstable/packages.json.br"
curl -L "$url" \
| brotli -d --stdout \
| jq '.packages[] | select(.meta.maintainers == []) | {
"pname": .pname,
"system": .system,
"version": .version,
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq brotli
function parse_unstable_json() {
local url="https://channels.nixos.org/nixos-unstable/$1.json.br"
echo $(curl -L "$url" | brotli -d --stdout | jq "$2")
}
pkg_count=$(parse_unstable_json "packages" ".packages | length")
opt_count=$(parse_unstable_json "options" "length")
@Sigmanificient
Sigmanificient / hello_word.py
Created March 30, 2024 15:50
Just a regular hello world, with copyright & license
@lambda _: _[False](__ := str(_[True]()), __)()
@lambda _: (_[False](_[False](..., __ := lambda k: -~(not k), _=__), _=__)(_[__(False)]), _[True])
@lambda _: (lambda *__, _: ((...,) + __)[-_(' ')].__class__, lambda: (__ := _).__doc__, _())
def hello_world():
"""Hello, World!"""
return copyright and license
@Sigmanificient
Sigmanificient / confusion.c
Created January 26, 2024 20:34
Stack hack
#include <stdio.h>
static char *S[] = { "Hello ", "world!\n" };
static
void print_me(int kek, const char p[static sizeof printf])
{
(void)p;
(**((void (**)(char *, char *))
((&kek - sizeof kek) + 1)))
i̷ͧ́̇̽̂̈̇ͨ͗͛͂ͬ̈́͌͊͆̽̆͊͋̒͊̾̃̅͊ͭͭ̋͂̇̒ͥ̓̍ͨ̍̑̈́̒ͩ̆͆͊̐̾͑̽́͒ͦͩͮ̐ͨ̒̓̈̊͐̂͊̚̚̚̕͏̸̷̴̴̷̸̸̵̧̨̢̡̨̛́́͘͢͡͠͝͏̵̷̶̷̸̷̷̶̢̧̢̢̡̡̧̛̀̀́͘͘͘̕͘͘͟͢͜͟͡͝͡͞͝͞͞͝͠͏̶̵̨̢́͏͞͏͏̛͕̳͍̮̠̘̣̬̜͍̹͖̳͙̮̪̝̗͕͍̫̼̱̙̲͍̠̹̠̝̭̠̟̟̱̠͇̟̜̩̞͚̮̗̺͎͚̮̬͇̪͖̺͈̫̮͍͎͎̞͈̦̤̤̟̥̰̗̩͈̼͉̟̣͕̪̼͍̫
@Sigmanificient
Sigmanificient / kitty.conf
Created September 9, 2023 13:29
kitty conf generated
# Generated by Home Manager.
# See https://sw.kovidgoyal.net/kitty/conf.html
font_family JetbrainsMono Nerd Font
font_size 9
# Shell integration is sourced and configured manually
shell_integration no-rc enabled
active_tab_background #8B8AF1
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
import vera_wrapper as vera
# Replace vera with the wrapper only for the typechecker
# at runtime, the vera_wrapper doesn't exists
else:
import vera
@Sigmanificient
Sigmanificient / builtin_func_middleware.py
Created June 14, 2023 22:03
Add a middleware to a builtin function
from functools import wraps
def builtin_func_middleware(original):
import builtins
def wrapper(func):
@wraps(original)
def wrapped(*args, **kwargs):
@Sigmanificient
Sigmanificient / README.md
Last active May 1, 2024 12:15
Epitech Coding Style Checker on Arch GNU/Linux

Running the coding style on Arch

In order to run the Epitech coding style checker natively, you will need to compile the vera binary.

I. Clone the vera-banana repo from Epitech

The repo is private, but you can access it using your ssh key

git clone git@github.com:Epitech/banana-vera.git