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
@emneo-dev
emneo-dev / Makefile
Created January 10, 2024 16:57
Sample makefile
TARGET_EXEC := my_binary
TARGET_EXEC_TESTS := glados
CC := clang
BUILD_DIR := ./build
SRC_DIRS := ./src
SRCS := $(shell find $(SRC_DIRS) -name '*.c')
@quackbarc
quackbarc / fizzbuzz_regex.md
Last active September 4, 2024 19:14
a fizzbuzz pattern made with pure regex
\b(?:(?<fizzbuzz>(?:(?:[369]|[258][0369]*[147]|(?:[147]|[258][0369]*[258])(?:[0369]|[147][0369]*[258])*(?:[28]|[147][0369]*[147]))*(?:0|(?:[147]|[258][0369]*[258])(?:[0369]|[147][0369]*[258])*5))+)|(?<buzz>\d*[05])|(?<fizz>(?:[0369]|[258][0369]*[147]|(?:[147]|[258][0369]*[258])(?:[0369]|[147][0369]*[258])*(?:[258]|[147][0369]*[147]))+))\b

insanity, as i'd like to call it. although it isn't fizzbuzz per se, it's the best you can get with regex. here's a regexr link to it with sample text.

this matches a number (within word boundaries) if it falls under any of the three groups:

  • fizzbuzz, which picks up numbers divisible by both 3 and 5, i.e. 15;
  • buzz, which picks up numbers divisible by 5; and
  • fizz, which picks up numbers divisible by 3.
@trag1c
trag1c / is_prime.py
Last active April 19, 2022 17:54
Primality check
(lambda _____,___=(getattr(__builtins__,dir(__builtins__)[ord(dir(__builtins__)[(_______:=(________:=__import__('math').e).__floor__() .__add__(________.__ceil__()))][_______.__add__(int().__pow__(int()))]).__sub__(_______.__floordiv__(_______))])(~(int().__pow__(int())))):[_:=[lambda _:[__:=lambda _,____=(___.__pow__(___).__add__(___.__floordiv__(___))):[___.__floordiv__(___),[__,lambda _,__:___.__sub__(___)][_____.__mod__(____).__eq__(___.__sub__(___))or(_____.__mod__(____.__add__(___)).__eq__(___.__sub__(___)))](_____,____.__add__(___).__add__(___.__pow__(___)))][____.__pow__(___).__le__(_____)],lambda _:___.__sub__(___)][_____.__mod__(___).__eq__(___.__sub__(___))or(_____.__mod__(___.__add__(___.__floordiv__(___))).__eq__(___.__sub__(___)))](_____),lambda ______:______.__gt__(___.__floordiv__(___))][_____.__le__(___.__add__(___.__floordiv__(___)))](_____),___.__floordiv__(___)][_==getattr(__builtins__,dir(__builtins__)[___.__pow__(___.__mul__(___).__add__(___.__floordiv__(___))).__add__(___.__mul__(___)._
@Arthurdw
Arthurdw / current_command_implementation.py
Created September 2, 2021 15:18
Current command implementation for Pincer
from typing import List, Dict, Any
from pincer.client import Client, middleware
from pincer.core.dispatch import GatewayDispatch
from pincer.core.http import HTTPClient
say_cmd = {
"name": "say",
"type": 1,
"description": "Send a message",
@HETHAT
HETHAT / 1_liner_linked_list.py
Last active April 11, 2022 22:53
just a normal one liner linked list
Node = type("Node",(),{'__init__': lambda self, data, _next=None: setattr(self, "data", data) or setattr(self, "next", _next),'__repr__': lambda self: f"Node<{self.data.__repr__()}>",'__gt__': lambda self, other: self.data > other.data if other.__class__ == Node else self.data > other});LinkedList = type("LinkedList",(),{'__init__': lambda self, data=None:setattr(self, "head", None) or setattr(self, "last", None)or setattr(self, "len", 0) or data is not None and self.extend(data) or None,'_ci': lambda self, index: index if index >= 0 else self.len + index,'append': lambda self, obj:(last := Node(obj))and (self.head is not None or not setattr(self, "head", last))and (self.last is None or not setattr(self.last, "next", last))and not setattr(self, "last", last) and setattr(self, "len", self.len + 1),'index': lambda self, obj, start=0, stop=None:(stop := self.len if stop is None else stop) * 0 or(start := self._ci(start), stop := self._ci(stop)) and( __loop := lambda index, item:None if item is None or index >= s
@aoirint
aoirint / gist:c977dbcea1cf5068b21776d8a5f6d3da
Created October 31, 2020 17:02
$ arduino-cli board listall
$ arduino-cli board listall
Board Name FQBN
AI Thinker ESP32-CAM esp32:esp32:esp32cam
ALKS ESP32 esp32:esp32:alksesp32
Adafruit ESP32 Feather esp32:esp32:featheresp32
BPI-BIT esp32:esp32:bpi-bit
D-duino-32 esp32:esp32:d-duino-32
DOIT ESP32 DEVKIT V1 esp32:esp32:esp32doit-devkit-v1
Dongsen Tech Pocket 32 esp32:esp32:pocket_32
ESP32 Dev Module esp32:esp32:esp32
@Prakasaka
Prakasaka / bash-colors.md
Created July 25, 2020 09:14 — forked from JBlond/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@sts10
sts10 / kitty.conf
Created January 16, 2020 20:24
My config file for Kitty Terminal Emulator
# vim:fileencoding=utf-8:ft=conf:foldmethod=marker
#: Fonts {{{
#: kitty has very powerful font management. You can configure
#: individual font faces and even specify special fonts for particular
#: characters.
font_family JetBrains Mono Medium
bold_font JetBrains Mono Bold
@sundowndev
sundowndev / GoogleDorking.md
Last active May 10, 2025 19:20
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@fnky
fnky / ANSI.md
Last active May 11, 2025 12:50
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27