Skip to content

Instantly share code, notes, and snippets.

View aldehir's full-sized avatar

Aldehir Rojas aldehir

View GitHub Profile
#pragma once
// Crash handler: emits a stack trace and writes a minidump on Windows; noop on other platforms.
//
// Usage:
// #include "crashhandler.h"
// int main() { crashhandler_init(); ... }
#if defined(_WIN32)
@aldehir
aldehir / diffshub.js
Created May 21, 2026 05:30
GitHub -> DiffsHub Tampkermonkey script
// ==UserScript==
// @name GitHub PR → DiffsHub
// @namespace https://diffshub.com/
// @version 1.1.0
// @description Adds a DiffsHub tab (and Shift+D shortcut) on GitHub pull requests to open the same URL on diffshub.com
// @author you
// @match https://github.com/*/*/pull/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=diffshub.com
// @run-at document-idle
// @grant none
@aldehir
aldehir / gemma4-open-webui.jinja
Last active June 16, 2026 12:06
Gemma 4 OpenWebUI Template
{%- macro format_parameters(properties, required) -%}
{%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
{%- set ns = namespace(found_first=false) -%}
{%- for key, value in properties | dictsort -%}
{%- set add_comma = false -%}
{%- if key not in standard_keys -%}
{%- if ns.found_first %},{% endif -%}
{%- set ns.found_first = true -%}
{{ key }}:{
{%- if value['description'] -%}
<#
.SYNOPSIS
Scans for Python virtual environments and checks for litellm installation,
flagging versions affected by the TeamPCP supply chain attack (v1.82.7, v1.82.8).
.DESCRIPTION
On 2026-03-24, malicious litellm versions 1.82.7 and 1.82.8 were published to PyPI
via stolen credentials. The payload:
- Harvests SSH keys, cloud creds, API keys, crypto wallets, shell history
- Exfiltrates data (AES-256 encrypted) to models.litellm[.]cloud
@aldehir
aldehir / README.md
Last active December 26, 2025 12:05
llama.cpp pre-sveltekit webui

Install index.html into a folder such as "old-webui"

Run llama-server with --path ./old-webui

@aldehir
aldehir / exercise.php
Created October 10, 2012 00:52
Ulti's exercise
<?php
assert_options(ASSERT_ACTIVE, 1);
assert_options(ASSERT_WARNING, 0);
assert_options(ASSERT_QUIET_EVAL, 1);
function assert_handler($f, $l, $c) {
echo "Assert failed at :$f:$l: $c";
echo "\n<br />";
exit();
}
@aldehir
aldehir / ClientListExample.java
Created August 25, 2012 10:59
TS3ServerQuery Examples
package net.visualcoding.ts3serverquery.example;
import net.visualcoding.ts3serverquery.TS3ServerQueryClient;
import net.visualcoding.ts3serverquery.TS3Result;
import net.visualcoding.ts3serverquery.TS3Map;
public class ClientListExample {
public static void main(String[] args) throws Exception {
if(args.length < 4) {