Skip to content

Instantly share code, notes, and snippets.

View junkblocker's full-sized avatar

Manpreet Singh junkblocker

View GitHub Profile
@junkblocker
junkblocker / parser.sh
Created April 3, 2026 17:13 — forked from alganet/parser.sh
Prototype sh parser written in sh
# Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
# 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;;
@junkblocker
junkblocker / c89cc.sh
Created April 3, 2026 17:01 — forked from alganet/c89cc.sh
c89cc.sh - standalone C89/ELF64 compiler in pure portable shell
#!/bin/sh
# ISC License
# Copyright (c) 2026 Alexandre Gomes Gaigalas <alganet@gmail.com>
# 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
diff --git c/.talon/user/mine/firefox_wayland.talon i/.talon/user/mine/firefox_wayland.talon
new file mode 100644
index 000000000..dbf281dbe
--- /dev/null
+++ i/.talon/user/mine/firefox_wayland.talon
@@ -0,0 +1,4 @@
+user.wayland_window_class: org.mozilla.firefox
+-
+# This activates the tag 'user.tabs'.
+tag(): user.tabs
@junkblocker
junkblocker / run-command.zsh
Created September 19, 2025 20:09 — forked from romkatv/run-command.zsh
Zsh function to run a command and capture its status, stdout and stderr
# Runs "$@" in a subshell with the caller's options, sets reply=(stdout stderr)
# and returns the status of the executed command. Both stdout and stderr are
# captured completely, including NUL bytes, incomplete UTF-8 characters and
# trailing LF, if any.
#
# Example:
#
# % zsh-run-command ls -d ~ /garbage
# % printf 'status: %s\nstdout: %s\nstderr: %s\n' $? "${(q+)reply[@]}"
# status: 2
@junkblocker
junkblocker / README.md
Created May 4, 2025 03:22 — forked from davcam/README.md
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
@junkblocker
junkblocker / init.lua
Created April 25, 2025 03:08
Neovim 0.11 config with builtin autocompletion
---[[HOW TO USE IT?
--- 0. Install neovim 0.11
--- 1. Create ~/.config/nvim-experiments directory on your machine (Assuming you are using Linux)
--- 2. Copy this init.lua into the nvim-experiments directory
--- 3. Launch neovim using `NVIM_APPNAME=nvim-experiments nvim` command
--- 4. Install requiring lsp servers via mason (type `:Mason`), relaunch neovim, and open your project to test it
--- 5. You may want to install treesitter parsers to get documentation
--- highlighting for some languages
---]]
@junkblocker
junkblocker / README.md
Created April 24, 2025 21:53 — forked from Leenuus/README.md
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
@junkblocker
junkblocker / notify.lua
Created December 13, 2024 01:38 — forked from CodingWithAnxiety/notify.lua
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.
-- @module notify
-- @author [Your Name]
-- @license [Your License]
-- @copyright [Your Copyright]
local wezterm = require 'wezterm'
@junkblocker
junkblocker / README.md
Created July 4, 2024 15:57 — forked from mbafford/README.md
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 / deviceConnect2Wifi.sh
Created December 20, 2023 05:31 — forked from syneart/deviceConnect2Wifi.sh
Android debugging over WiFi (use adb)
#!/bin/bash
# This shell script is made by SyneArt <sa@syneart.com>
# Android Studio default path on Mac
adb=~/Library/Android/sdk/platform-tools/adb
function connect() {
device_id=$1
device_ip=`${adb} -s ${device_id} shell ip -f inet addr show wlan0 | grep -e "[0-9].*\/[0-9]*" | awk '{ print $2 }' | sed 's/\/[0-9]*//'`
echo "Android device id: ${device_id}"