Skip to content

Instantly share code, notes, and snippets.

View RezSat's full-sized avatar
🇱🇰
I may be slow to respond.

Yehan Wasura RezSat

🇱🇰
I may be slow to respond.
View GitHub Profile
@RezSat
RezSat / simple_module.c
Created June 18, 2025 13:17
A Minimal Custom Type in C To illustrate the `PyTypeObject` in action, the following C code outlines a minimal custom type, `SimpleObject`. This type exposes a single integer member and provides a basic `__repr__` method.
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <stdio.h> // For PySys_WriteStdout
// 1. Define the instance structure (must start with PyObject_HEAD)
typedef struct {
PyObject_HEAD
long value; // Our custom data member
} SimpleObject;
@RezSat
RezSat / inspect_internals.c
Last active June 18, 2025 13:05
To illustrate the fundamental PyObject structure and its accessible fields, consider the following C extension. This example creates a Python integer object and then inspects its internal ob_refcnt and ob_type->tp_name fields using the CPython API macros. C
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <stdio.h> // For PySys_WriteStdout
// Define a simple C function that creates a Python integer
// and prints its ob_refcnt and ob_type->tp_name
static PyObject*
inspect_int_object(PyObject *self, PyObject *args) {
PyObject *py_int_obj;
long value;
@RezSat
RezSat / eclipse-hero.markdown
Created September 1, 2024 06:17
Eclipse Hero
@RezSat
RezSat / mathjs_parser.py
Created April 6, 2024 21:00
Python implementation of the mathjs expression parser
from abc import ABC, abstractmethod
from fractions import Fraction
from decimal import Decimal
"""
THIS IS A DIRECT IMPLEMENTATION OF THE MATHJS PARSER.
NOTE: THERE ARE SO MANY NOTABLE BUGS IN HERE.
IMPLEMENT PURELY FOR THE PURPOSE OF UNDERSTANDING THE MATHJS PARSER.
PLEASE TAKE A VISIT TO MATHJS FOR MORE INFORMATION: https://github.com/josdejong/mathjs
print("hello, world!")
# Keylogger didn't worked. :(
#UAC Bypass with FodHelper.exe
#save the below code as something.ps1
#run it and then use something.ps1 -program cmd
"""
function FodhelperBypass(){
Param (
@RezSat
RezSat / index.html
Created April 25, 2022 20:34
Parallax Depth Cards
<h1 class="title">Hover over the cards</h1>
<div id="app" class="container">
<card data-image="https://images.unsplash.com/photo-1479660656269-197ebb83b540?dpr=2&auto=compress,format&fit=crop&w=1199&h=798&q=80&cs=tinysrgb&crop=">
<h1 slot="header">Canyons</h1>
<p slot="content">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</card>
<card data-image="https://images.unsplash.com/photo-1479659929431-4342107adfc1?dpr=2&auto=compress,format&fit=crop&w=1199&h=799&q=80&cs=tinysrgb&crop=">
<h1 slot="header">Beaches</h1>
<p slot="content">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
@RezSat
RezSat / credit-card-form-vuejs.markdown
Created September 27, 2020 10:42
Credit Card Form - VueJs