Skip to content

Instantly share code, notes, and snippets.

@mal1kc
mal1kc / website_downloader.py
Created January 18, 2025 15:43
static website_downloader
import os
import requests
from bs4 import BeautifulSoup
from urllib.parse import urljoin, urlparse
from concurrent import futures as cfutures
def download_file(url, base_folder):
try:
response = requests.get(url)
@peppergrayxyz
peppergrayxyz / qemu-vulkan-virtio.md
Last active April 26, 2025 12:38
QEMU with VirtIO GPU Vulkan Support

QEMU with VirtIO GPU Vulkan Support

With its latest reales qemu added the Venus patches so that virtio-gpu now support venus encapsulation for vulkan. This is one more piece to the puzzle towards full Vulkan support.

An outdated blog post on clollabora described in 2021 how to enable 3D acceleration of Vulkan applications in QEMU through the Venus experimental Vulkan driver for VirtIO-GPU with a local development environment. Following up on the outdated write up, this is how its done today.

Definitions

Let's start with the brief description of the projects mentioned in the post & extend them:

@mal1kc
mal1kc / mono_to_stereo.js
Created November 5, 2024 20:10
javascript code to convert current tabs audio stream to stereo
(function() {
// Check if there is an audio or video element on the page
const mediaElements = document.querySelectorAll('audio, video');
if (mediaElements.length === 0) {
console.log('No media elements found on this page.');
return;
}
// Create an AudioContext
const audioContext = new (window.AudioContext || window.webkitAudioContext)();
@jdah
jdah / macro_explanation.c
Created January 31, 2024 14:21
explaining some C macro magic
// so a cool trick with macros in C (and C++) is that since macros inside of
// macros are stille evaluated by the preprocessor, you can use macro names as
// parameters to other macros (and even construct macro names out of out of
// parameters!) - so using this trick if we have some macro like
// this:
#include <stddef.h>
#define MY_TYPES_ITER(_F, ...) \
_F(FOO, foo, 0, __VA_ARGS__) \
@Mashpoe
Mashpoe / main.c
Last active January 25, 2025 13:25
ASCII Tesseract Rotation C Program
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <windows.h>
// width and height of screen
#define ww 100
#define wh 50
void clr(CHAR_INFO* d)
@mal1kc
mal1kc / system_hardware_info.py
Last active July 11, 2022 15:24
system hardware info with python3 ;psutil module and builtin platform,datetime modules
import psutil
import platform
from datetime import datetime
def get_size(bytes, suffix="B"):
"""
Scale bytes to its proper format
e.g:
1253656 => '1.20MB'
@orhun
orhun / arch_linux_installation.md
Last active March 15, 2025 04:07
Notes on my Arch Linux installation: UEFI/Secure Boot + systemd-boot, LUKS-encrypted root (XFS), LUKS-encrypted swap (with hibernate & unlocked via TPM)
@cart
cart / FXAA.tscn
Last active January 17, 2025 15:11
Godot Nvidia FXAA 3.11 Port
[gd_scene load_steps=3 format=2]
[sub_resource type="Shader" id=1]
code = "shader_type canvas_item;
// Godot Nvidia FXAA 3.11 Port
// Usage: Drop this in to any 3D scene for FXAA! This is a port of the \"PC High Quality Preset 39\". However the medium quality
// parameters are also included. For medium quality, just comment out sections \"PS 6\" and above and uncomment the \"med 13\" variables.
@rickyzhang82
rickyzhang82 / keycode.linux
Created September 15, 2017 22:11
Key code for Linux
# /usr/share/BasiliskII/keycodes
#
# Basilisk II (C) 1997-2005 Christian Bauer
#
# This file is used to translate the (server-specific) scancodes to
# Mac keycodes depending on the window server being used.
#
# The format of this file is as follows:
#
# sdl <driver string>
@palopezv
palopezv / dwm_config_pulseaudio.h
Last active March 30, 2025 12:16 — forked from neuro-sys/dwmconfig.h
dwm volume control with hardware multimedia keys (pipewire, pulseaudio, amixer and light as an extra)
/**
* dwmconfig.h
* Hardware multimedia keys
*/
/* Somewhere at the beginning of config.h include: */
/*
You obviously need the X11 development packages installed, X11proto in particular, but
here is the location of the keysyms header upstream copy if you can't bother
using the contents of your own hard drive. ;-P