Skip to content

Instantly share code, notes, and snippets.

@zdimension
zdimension / basic.out
Created March 31, 2023 22:17
list function calls in a C file and look up in man
isatty (3) - test whether a file descriptor refers to a terminal
open (2) - open and possibly create a file
dup2 (2) - duplicate a file descriptor
close (2) - close a file descriptor
sigaction (2) - examine and change a signal action
execvp (3) - execute a file
example usage, to assemble file.s
./test.sh file
(without .s)
will assemble file.s to file.bin

Keybase proof

I hereby claim:

  • I am zdimension on github.
  • I am zdimension_ (https://keybase.io/zdimension_) on keybase.
  • I have a public key ASCjhvtNc2c-tOuISzF3SfgJWup6ljrpTYf-DbHdGYEiZQo

To claim this, I am signing this object:

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

@zdimension
zdimension / probleme1.pl
Created August 4, 2022 12:13
résolution prolog de problèmes de logique du test psychotechnique du CNED édition 1998
adjacent(A, B, List) :- nextto(A, B, List); nextto(B, A, List).
solve(AimeVoile) :-
length(Garcons, 4),
member(garcon(claude, treize, _, _), Garcons), % Claude est âge de treize ans
adjacent(garcon(_, _, tennis, _), garcon(_, _, _, policier), Garcons), % Le joueur de tennis s'entretient avec son voisin qui aime par-dessus tout les romans policiers
member(garcon(_, onze, nage, _), Garcons), % Le garçon de onze ans est un nageur accompli
member(garcon(_, dix, _, aventure), Garcons), % Celui qui préfère les livres d'aventures est âge de dix ans
adjacent(garcon(pierre, douze, _, _), garcon(_, _, tennis, _), Garcons), % Pierre, douze ans, parle avec son voisin qui pratique le tennis
nth1(1, Garcons, garcon(_, _, _, policier)), % Le joueur placé à l'extrême gauche est celui qui préfère les romans policiers
@zdimension
zdimension / options.pl
Created December 15, 2021 00:05
Calculateur d'options semestre 8
% CALCULATEUR D'OPTIONS SEMESTRE 8
% (c) 1989-1993 Tom Niget
% Programme testé sur 486-DX
% USAGE:
% ?- choix_options(+FILIERE, +OPTIONS DESIREES, +OPTIONS NON DESIREES, -OPTIONS1, -OPTIONS2)
%
% NB: Les options doivent être spécifiées par ordre ALPHABETIQUE!
% EXEMPLE:
from dataclasses import dataclass
from typing import Any
@dataclass
class List:
pass
@dataclass
class Empty(List):
def __iter__(self):
from dataclasses import dataclass
from typing import Any, Callable
from enum import Enum
import operator
import string
@dataclass
class BinOperator:
symbol: str
timeout() {
end=$(($(date +%s) + $1))
watch -c -n 1 -t 'toilet --gay -F border -t $(('"$end"' - $(date +%s)))'
}
@zdimension
zdimension / gen.php
Created August 4, 2020 22:50
Small PHP script that allows importing a Plex library directly into Radarr
<?php
// put this file in a web-served directory with a server that handles PHP files
// use the URL of the field as the "Trakt API" URL in Radarr
// (e.g. http://yourserver/somepath/gen.php)
// put your Plex library path here (escape eventual spaces using backslashes)
$res = `sqlite3 /storage/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/com.plexapp.plugins.library.db "select guid from metadata_items where guid like 'com.plexapp.agents.imdb%';" | grep -P 'tt\d+' -o`;
$movies = explode("\n", $res);