Skip to content

Instantly share code, notes, and snippets.

View bswck's full-sized avatar
😃

Bartosz Sławecki bswck

😃
View GitHub Profile
@henryiii
henryiii / LICENSE
Last active February 7, 2024 03:21
Download all pyproject.tomls
MIT License
Copyright (c) 2023 Françoise CONIL
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@adulau
adulau / http2-rapid-reset-ddos-attack.md
Last active June 27, 2024 16:52
HTTP/2 Rapid Reset DDoS Attack

Introduction

This Gist aims to centralise the most relevant public sources of information related to the HTTP/2 Rapid Reset vulnerability. This vulnerability has been disclosed jointly by Google, Amazon AWS, and Cloudflare on 10 October 2023 at 12:00 UTC.

Please help us make this page as comprehensive as possible by contributing relevant references, vendor advisories and statements, mitigations, etc.

References

@qexat
qexat / one4all.py
Last active May 7, 2023 22:34
One for all - one call, every method
from __future__ import annotations
from collections.abc import Callable, Iterable
import sys
from typing import (
Any,
Generic,
Literal,
LiteralString,
SupportsIndex,
@qexat
qexat / bf_hello_world_one_line.py
Created September 2, 2022 22:23
One-liner hello world program written in Brainfuck but in a Python f-string
f'{(hw:="++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.")}{(bf:=lambda prgm:print(((pc:=0),(ti:=0),(t:=[0]*30000),(rs:=[]),(o:=""),(*(((char:=prgm[pc]),(((ti:=ti+1),(pc:=pc+1))if char==">"else(((ti:=ti-1),(pc:=pc+1))if char=="<"else(((t.__setitem__(ti,(t[ti]+1)&0xFF)),(pc:=pc+1))if char=="+"else(((t.__setitem__(ti,(t[ti]-1)&0xFF)),(pc:=pc+1))if char=="-"else(((o:=o+chr(t[ti])),(pc:=pc+1))if char=="."else(((t.__setitem__(ti,ord(input())%0xFF)),(pc:=pc+1))if char==","else(((rs.append(pc),(pc:=pc+1))if t[ti]!=0 else((bc:=1),(*(((pc:=pc+1),((bc:=bc+1)if prgm[pc]=="["else(bc:=bc-1)if prgm[pc]=="]"else...),(pc:=pc+1))for _ in iter(lambda:bool(bc),False)),)))if char=="["else((pc:=rs.pop())if char=="]"else...)))))))))for _ in iter(lambda:pc<len(prgm),False)),))[-1][-1][-1][0]))}{(bf(hw))}'
@andelf
andelf / common.gypi
Created April 3, 2022 15:24
openssl_fips fix
{
'variables': {
'configuring_node%': 0,
'asan%': 0,
'werror': '', # Turn off -Werror in V8 build.
'visibility%': 'hidden', # V8's visibility setting
'target_arch%': 'ia32', # set v8's target architecture
'host_arch%': 'ia32', # set v8's host architecture
'want_separate_host_toolset%': 0, # V8 should not build target and host
'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
@quackbarc
quackbarc / fizzbuzz_regex.md
Last active July 1, 2024 13:37
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.
@roycewilliams
roycewilliams / pwnedpasswords-v6-top20k.txt
Last active July 6, 2024 12:37
pwnedpasswords-v6-top20k.txt
This file has been truncated, but you can view the full file.
#------------------------------------------------------------------------------
# Top 20K hashes from the Troy Hunt / haveibeenpwned Pwned Passwords list v6 (2020-06-19)
# with frequency count and cracked plaintext passwords
#
# The latest version of this file can be found here:
# https://gist.github.com/roycewilliams/226886fd01572964e1431ac8afc999ce
# The equivalent of this file, but based on v2 of the Pwned Passwords, is here:
# https://gist.github.com/roycewilliams/281ce539915a947a23db17137d91aeb7
#------------------------------------------------------------------------------
# Notes and references:
@tau0
tau0 / tags distribution for codeforses
Last active April 29, 2024 18:44
tags distribution for codeforses
import json
import operator
# Original version by tau0 and st3v3n on codeforces
# Go the URL below on your browser and download the file to the same directory as this script
# https://codeforces.com/api/problemset.problems
data = json.load(open("/Users/tau0/Downloads/problemset.problems.json"))
counter = dict()
problems = data["result"]["problems"]
@Albert221
Albert221 / JetBrains-Mono.css
Last active May 7, 2024 00:30
CSS for using JetBrains Mono on the Web. Simply copy&paste it to your stylesheet.
@font-face {
font-family: 'JetBrains Mono';
src: url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff2/JetBrainsMono-Bold-Italic.woff2') format('woff2'),
url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff/JetBrainsMono-Bold-Italic.woff') format('woff');
font-weight: 700;
font-style: italic;
font-display: swap;
}
@font-face {
@jhrcook
jhrcook / common-github-badges.md
Last active July 6, 2024 14:57
A list of GitHub badges I usually add to me README files.

GitHub Badges

Social

jhc github jhc twitter jhc website

Code