Skip to content

Instantly share code, notes, and snippets.

@Eczbek
Eczbek / java_ores.txt
Created August 27, 2022 01:48
Ore Offsets from Clay Patches in Minecraft Java Edition
1.17.x:
Overworld:
River:
Clay:
Coal: Z-3
Copper: Z-7
Diamond: Z-1
Gold: Z+6
Iron: Z+2
Lapis: Z+3
@Eczbek
Eczbek / git_rebase_preserve_date.txt
Created September 17, 2022 14:04
git rebase but preserve timestamps
git -c rebase.instructionFormat='%s%nexec GIT_COMMITTER_DATE="%cD" git commit --amend --no-edit' rebase -i --root
@Eczbek
Eczbek / main.cpp
Last active March 8, 2023 03:01
something cursed
<:<::>:>extern signed decltype(::std)::main(void)noexcept<%return<:=:><volatile const auto and...>(volatile const auto and......)noexcept<:<::>:>->auto<%return reinterpret_cast<volatile const long long unsigned>(nullptr);%>();%>
@Eczbek
Eczbek / graph.md
Created January 13, 2024 05:11
mermaid.js graph of BigInteger dependencies as of 2024-01-12
flowchart TD
	STD_ALGORITHM[algorithm]
	STD_ARRAY[array]
	STD_CMATH[cmath]
	STD_COMPARE[compare]
	STD_CONCEPTS[concepts]
	STD_CSTDDEF[cstddef]
	STD_CSTDINT[cstdint]
	STD_EXCEPTION[exception]
@Eczbek
Eczbek / doubly_linked_list.c
Created March 4, 2024 16:05
Doubly Linked List
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct node_t node_t;
struct node_t {
node_t* next;
node_t* prev;
const char* data;
};
@Eczbek
Eczbek / nowindows.h
Last active June 26, 2026 09:43
Macros to disable generally unwanted stuff from <windows.h> (from Veeloxfire)
#define NOATOM
#define NOCLIPBOARD
#define NOCOLOR
#define NOCOMM
#define NOCTLMGR
#define NODEFERWINDOWPOS
#define NODRAWTEXT
#define NOGDI
#define NOGDICAPMASKS
#define NOICONS
@Eczbek
Eczbek / resources.md
Last active January 27, 2026 14:39
C++ resources and a rearrangement of `learncpp.com`
@Eczbek
Eczbek / operators.hpp
Last active June 3, 2026 17:13
more logical and bitwise operators
template<auto f>struct A{template<class T>struct B{T x;
constexpr T operator&&(T y ){return static_cast<T>(f( x,y));}
constexpr T operator||(T y ){return static_cast<T>(f( x,y));}
constexpr T operator& (T y ){return static_cast<T>(f( x,y));}
constexpr T operator| (T y ){return static_cast<T>(f( x,y));}
constexpr T operator^ (T y ){return static_cast<T>(f( x,y));}
friend constexpr T operator&=(T y,B b){return static_cast<T>(f(b.x,y));}
friend constexpr T operator|=(T y,B b){return static_cast<T>(f(b.x,y));}
friend constexpr T operator^=(T y,B b){return static_cast<T>(f(b.x,y));}};
template<class T>friend constexpr B<T>operator&&(T x,A ){return{ x };}
@Eczbek
Eczbek / jsfck.h
Last active June 1, 2026 21:43
jsfck using the preprocessor (unoptimizing)
#define SPACE (NaN+[][a+t])[_1+[_1]]
#define EXCLAMATION atob((Infinity+[])[0]+false)[0]
#define QUOTE string[f+o+n+t+c+o+l+o+r]()[_1+[_2]]
#define HASH atob(_0+i+(NaN)+false)[_1]
#define DOLLAR atob(_0+i+S)[_1]
#define PERCENT atob(_0+[_0]+(_0)+l)[_2]
#define AND string[f+o+n+t+c+o+l+o+r](string[f+o+n+t+c+o+l+o+r]([]))[_3+[_1]]
#define APOS atob(_0+i+false)[_1]
#define LPAREN ([][a+t]+[])[_1+[_1]]
#define RPAREN ([][a+t]+[])[_1+[_2]]
const a=-3/80,e=1,f=5,g=8/3,h=9/10,i=1,l=11/3,n=3,o=1/3,r=1,s=7/3,t=10/3,u=12/5,v=1,w=9/5,x=18/7,z=0;
z*e*r*o // 0
o*n*e // 1
t*w*o // 2
t*h*r*e*e // 3
f*o*u*r // 4
f*i*v*e // 5
s*i*x // 6
s*e*v*e*n // 7