Skip to content

Instantly share code, notes, and snippets.

@DiyarD
DiyarD / Reddit Direct Image Data URL.js
Last active August 11, 2025 09:01
Redirect Reddit media wrapper to data URL for native browser image viewing
// ==UserScript==
// @name Reddit Direct Image Data URL
// @namespace http://tampermonkey.net/
// @version 1.1
// @description Redirect Reddit media wrapper to data URL for native browser image viewing
// @author You
// @match https://www.reddit.com/media*
// @match https://reddit.com/media*
// @grant GM_xmlhttpRequest
// @run-at document-start
@DiyarD
DiyarD / Google AI Studio Performance & UX Fixer-1.user.js
Last active August 12, 2025 20:07
A user script that fixes major performance and UX issues on Google's AI Studio. It eliminates scroll-fighting, stops content from flickering/disappearing, and removes rendering lag for a much smoother experience.
// ==UserScript==
// @name Google AI Studio Performance & UX Fixer
// @namespace http://tampermonkey.net/
// @version 1
// @description A comprehensive script to fix all major UI/UX issues in AI Studio, including scroll-fighting, content flicker, rendering lag, and edit-scroll bugs.
// @author Diyar Baban
// @match https://aistudio.google.com/prompts/*
// @grant none
// @run-at document-start
// ==/UserScript==
@DiyarD
DiyarD / Router.php
Last active July 29, 2016 10:57
A Very Simple PHP Router
<?php
class Router
{
protected $_routes;
protected $routeMethods = ['get', 'post'];
public function add($pattern, $callback, $options) {
$pattern = '/' . trim($pattern, '/');