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 / Dockerfile
Created February 12, 2023 23:00
Arch - CSFML / Criterion / NCURSES - Docker for epitech
FROM archlinux:base-devel
RUN pacman -Syu meson ninja cmake csfml curl ncurses --noconfirm --needed
RUN curl -LO https://github.com/Snaipe/Criterion/releases/download/v2.4.1/criterion-2.4.1.tar.xz
RUN tar -xf criterion-2.4.1.tar.xz
RUN cd criterion-2.4.1 && arch-meson -Db_pie=false -Db_lto=false build
RUN cd criterion-2.4.1 && meson compile -C build -v --ninja-args=-n,-v,-d,explain
@Sigmanificient
Sigmanificient / Makefile
Created February 10, 2023 11:33
Check a commmand to exist within a makefile
# Example use case
include check_cmd.mk
all: $(VENV)
VENV=VENV
$(VENV):
$(call CHECK_CMD, python3)
@ python3 -m venv $@
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.service import Service
URL = "https://www.google.com"
def main():
options = Options()
options.headless = True
git clone https://github.com/Epitech/banana-vera.git || exit 1
cd banana-vera
yay -Sy boost
cmake . -DVERA_LUA=OFF -DPANDOC=OFF -DVERA_USE_SYSTEM_BOOST=ON
make -j
sudo make install
@Sigmanificient
Sigmanificient / _one_line.py
Created November 11, 2022 20:22
Lights out in 1 line
print("Light out in 1 line, use A1 to E5 to play (A-E vertical, 1-5 horizontal)"*0,type('',((__:=setattr)and(BS:=5)and(r:=__import__('random'))and()),{'__init__':lambda s:(__(s,'b',[[0 for _ in range(BS)]for _ in range(BS)])or __(s,'ir',0)or s.sb())and None,'__iter__':lambda s: s,'__next__':lambda s: s.ir,'__repr__':lambda s:'\n'.join(' '.join('.x'[c]for c in line)for line in s.b),'main':lambda s:(__(s,'ir',0),[(print(s),(s.hp(),s.cw()))for _ in iter(s.__next__, 1)], "You won!")[2],'c':property(lambda s:sum(map(sum,s.b))),'cp':lambda _,cs:(len(cs) == 2 and cs[0]in'ABCDE'and cs[1] in '12345'),'cw':lambda s:(__(s,'ir',s.iw)),'iw':property(lambda s: (s.c==0)),'hp':lambda s:(s.cp(p:=input("Where to play? "))and(s.sl(*s.tc(p)))),'sb':lambda s:[s.sl(r.randrange(0,BS),r.randrange(0,BS))for _ in range(100)],'sl':(lambda s,x,y:[s.sw(x+dx,y+dy)for dx,dy in((0,0),(0,-1),(0,1),(-1,0),(1,0))if((0<=(x+dx)<BS)and(0<=(y+dy)<BS))]),'sw':lambda s,x,y:(__(s,'b',[[c if((cx!=x)or(cy!=y))else(not(s.b[y][x]))for cx,c in enumerate(l
import os
from github import Github
BASE_DIR = '...'
GITHUB_TOKEN = '...'
CWD = os.getcwd()
@Sigmanificient
Sigmanificient / style.css
Last active August 9, 2022 09:34
Stylus dark theme for HŸPE dashboard
/* */
body {
background: #0b0815;
}
header {
background-color: #0b0815 !important;
}
@Sigmanificient
Sigmanificient / hashmap.py
Created August 1, 2022 20:58
Implementation of a hahmap in python (dict equivalent)
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Optional, List, Generic, TypeVar, NoReturn, Callable, Union, Tuple
_K = TypeVar('_K')
_V = TypeVar('_V')
@dataclass
@Sigmanificient
Sigmanificient / benchmark.txt
Created July 31, 2022 13:26
A slow... very slow sorting algorithm
1 => 1 ------------------------------------------------------
< Min 0.00001 | 1 | 0.00x
> Max 0.00003 | 1 | 0.00x
~ Avg 0.00001 | 1.0 | 0.00x
2 => 1 ------------------------------------------------------
< Min 0.00001 | 1 | 1.00x
> Max 0.00030 | 30 | 29.07x
~ Avg 0.00004 | 8.48 | 4.17x
3 => 1 ------------------------------------------------------
< Min 0.00003 | 2 | 0.61x
@Sigmanificient
Sigmanificient / Makefile
Last active June 22, 2022 19:47
Makefile for python & pytest package
all: start
PKG =
VENV = venv
VBIN = $(VENV)/bin
TEST = tests
$(VBIN)/python:
python3 -m venv venv