Skip to content

Instantly share code, notes, and snippets.

View junkblocker's full-sized avatar

Manpreet Singh junkblocker

View GitHub Profile
@davcam
davcam / README.md
Last active May 4, 2025 03:22
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 March 26, 2025 16:45
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 April 1, 2025 00:28
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@junkblocker
junkblocker / disable.sh
Last active April 17, 2024 21:33
Disable bunch of #$!@ in Catalina
#!/bin/bash
############################################################################################
# WARNING: THESE SCRIPTS AND CHANGES ARE NOT MEANT FOR ANYBODY BUT ME.
# RUNNING THESE WILL MESS UP YOUR COMPUTER IN MYSTERIOUS AND USUALLY UNRECOVERABLE WAYS.
############################################################################################
if [[ "$(sw_vers -productVersion)" != 10\.15* ]]; then
echo "This is only meant to run on macOS 10.15.* Catalina" >&2
exit 1
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
"github.com/jinzhu/gorm"
# This tells kubecfg to read its config from the local directory
export KUBECONFIG=./kubeconfig
# Looking at the cluster
kubectl get nodes
kubectl get pods --namespace=kube-system
# Running a single pod
kubectl run --generator=run-pod/v1 --image=gcr.io/kuar-demo/kuard-amd64:1 kuard
kubectl get pods