Skip to content

Instantly share code, notes, and snippets.

View junkblocker's full-sized avatar

Manpreet Singh junkblocker

View GitHub Profile
@alganet
alganet / c89cc.sh
Last active April 4, 2026 00:36
c89cc.sh - standalone C89/ELF64 compiler in pure portable shell
#!/bin/sh
# ISC License
# Copyright (c) 2026 Alexandre Gomes Gaigalas <[email protected]>
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
@thomasht86
thomasht86 / setup.sh
Last active January 3, 2026 17:12
Claude code on mobile
#!/bin/bash
#
# Mobile Claude - One-command setup for running Claude Code remotely
# Supports: Arch, Ubuntu/Debian, Fedora, macOS
#
# Usage: curl -fsSL https://gist.github.com/thomasht86/86f0f8f62db1839054abd8a7e501ff7d/raw/935bbfa0957cd5926751742189441cf10fbe2ba0/setup.sh | bash
#
set -e
@alganet
alganet / parser.sh
Created June 29, 2025 14:39
Prototype sh parser written in sh
# Copyright (c) Alexandre Gomes Gaigalas <[email protected]>
# SPDX-License-Identifier: ISC
_repeat () {
case "${2:-}" in
0|"") return;;
1) REPLY="$1"; return;;
2) REPLY="$1$1"; return;;
3) REPLY="$1$1$1"; return;;
4) REPLY="$1$1$1$1"; return;;
@davcam
davcam / README.md
Last active March 7, 2026 14:51
A zettelkasten/denote application in ad editor.

This gist describes simply/minimally how to extend the ad editor to use zettelkasten/Denote type notes using just four short bash scripts.

Below is a short description of ad, a couple of demos and the bash scripts needed to:

  • create "Denote" notes
  • create links to notes
  • open notes in ad from the links using ad's loading/plumbing mechanism
  • list notes in ad that link back (backlink) to the current one
@CodingWithAnxiety
CodingWithAnxiety / notify.lua
Last active January 23, 2025 07:09
Libnotify Wezterm
--- A notification module for WezTerm using notify-send.
-- This module provides functionality to send notifications using the 'notify-send' command,
-- which is available on most Linux distributions that implement the org.freedesktop.Notifications specification.
local wezterm = require 'wezterm'
local M = {}
--- Check if a value exists in a table.
-- @local
function jj-latest-description --description "Get latest non-empty commit description and bookmarks"
jj log -r 'latest(ancestors(@, 10) ~ (empty()~merges()))' \
--quiet --no-pager --no-graph --ignore-working-copy --color always \
-T "surround('(', ')', separate(' ', \
self.local_bookmarks(), \
coalesce(self.description().first_line(), '...'), \
self.change_id().shortest(5)\
))" 2>/dev/null
end
@Leenuus
Leenuus / README.md
Last active April 25, 2025 14:45
Display command output in neovim split window

I just implemented a simple but really powerful user command suggested by romainl in lua, running asynchronously using vim.uv API.

In short, this is a command named Redir, which redirect ex command or shell commands stdin/sterr to neovim buffers. So you can view them in split window on the fly.

With Redir, you can do:

  • A good way to inspect your neovim.
" show all your messages in split, I love this one and make it default
@mbafford
mbafford / README.md
Last active February 2, 2026 01:54
Compare two PDFs using ImageMagick - provides a visual comaprison and a perceptual hash comparison (numerical)

PDF tools for comparing PDFs visually (overlaying two PDFs to see changed areas) and using a perceptual hash (numerical value indicating visual difference between the two files).

Useful for command line review of PDFs and de-duplication. Configure git to use these tools for better PDF history / comparison in git.

These scripts require imagemagick and poppler. Both installed from homebrew.


Setup git to use a custom diff using:

@junkblocker
junkblocker / btrfs-undelete
Created November 8, 2022 15:21 — forked from Changaco/btrfs-undelete
btrfs-undelete
#!/bin/bash
# btrfs-undelete
# Copyright (C) 2013 Jörg Walter <[email protected]>
# This program is free software; you can redistribute it and/or modify it under
# the term of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or any later version.
if [ ! -b "$1" -o -z "$2" -o -z "$3" ]; then
echo "Usage: $0 <dev> <file/dir> <dest>" 1>&2
echo
@huytd
huytd / wordle.md
Last active March 26, 2026 21:25
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode: