Skip to content

Instantly share code, notes, and snippets.

View junkblocker's full-sized avatar

Manpreet Singh junkblocker

View GitHub Profile
@junkblocker
junkblocker / init.lua
Created April 25, 2025 03:08 — forked from miroshQa/init.lua
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 <[email protected]>
# 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}"
@junkblocker
junkblocker / meld_hotfix_sonoma.sh
Created December 20, 2023 05:29 — forked from syneart/meld_hotfix_sonoma.sh
Meld hotfix on MacOS with Sonoma(14) Intel / M1 & M2 & M3 (Apple silicon) CPU [with Rosetta]
### Test on https://github.com/yousseb/meld/releases/tag/osx-20
### OSX - 3.21.0 (r4) Sonoma
#!/bin/zsh
#Fix libpng16.16.dylib not found
install_name_tool -change /usr/local/opt/libpng/lib/libpng16.16.dylib @executable_path/../Frameworks/libpng16.16.dylib /Applications/Meld.app/Contents/Frameworks/libfreetype.6.20.0.dylib
#Fix libbrotlidec.1.dylib not found
install_name_tool -change /usr/local/opt/brotli/lib/libbrotlidec.1.dylib @executable_path/../Frameworks/libbrotlidec.1.dylib /Applications/Meld.app/Contents/Frameworks/libfreetype.6.20.0.dylib
@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
@junkblocker
junkblocker / notify-desktop
Last active May 19, 2024 17:19 — forked from digitaltrails/notify-desktop
notify-desktop - linux find and notify desktop session
#!/usr/bin/env bash
# Provides a way for a root process to perform a notify send for each
# of the local desktop users on this machine.
#
# Intended for use by cron and timer jobs. Arguments are passed straight
# to notify send. Falls back to using wall. Care must be taken to
# avoid using this script in any potential fast loops.
#
# X11 users should already have a dbus address socket at /run/user/<userid>/bus
# and this script should work without requiring any initialisation. Should
@junkblocker
junkblocker / wordle.md
Created February 3, 2022 02:51 — forked from huytd/wordle.md
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@junkblocker
junkblocker / obsidian-web-clipper.js
Created January 12, 2022 01:01 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */