Skip to main content

Giggles&Shit documentation

Giggles&Shit (GAS for short) is a userscript for custom emojis on GitHub. It injects a small button into the formatting toolbar of GitHub's markdown editors (issues, pull requests, comments, the web file editor, ...) that opens an image picker. Picking an image inserts a 20px <img> right where your cursor is:

Giggles&Shit demo

  • Current version: 2.3.0
  • Runs on: https://github.com/* and https://gist.github.com/*
  • Permissions: none (@grant none)
  • Bundled emoji: 84, boo, bulleh, crine, fire, hmm, rose, skull, trollge, wet, woah, yeah (+ more images in the repo you can wire up yourself)
<!-- This is what gets inserted when you pick "trollge" -->
<img src="https://raw.githubusercontent.com/havaianasdestruido/Giggles-Shit/refs/heads/main/res/img/trollge.jpg" alt="trollge" width="20px">

How it works, in one paragraph​

GAS is a single file — gas.userscript.js — wrapped in an IIFE. On page load it scans the DOM for markdown editors (textarea and contenteditable elements), finds the nearest formatting toolbar, and appends a trollge button to it. A MutationObserver keeps watching for editors added later (GitHub is a single-page app), with a 100 ms debounce so it stays cheap. Clicking the button opens a lazy singleton picker positioned next to it; choosing an image splices an <img> tag into the editor using the native setter trick so GitHub's internal state stays in sync. A debug API is exposed as window.GAS. See Architecture for the full breakdown.

Where to next?​

Looking for the main website?

This site is documentation only, served under /docs. Head back to the main website for the landing page, feature overview and FAQ.