Skip to content

Instantly share code, notes, and snippets.

@truongduyng
truongduyng / gist:0c80dcab995dbc2a6255e506f9247899
Created March 18, 2026 05:57
macOS Quick Action that adds a random gradient background + drop shadow to images. Supports batch processing — just select multiple files in Finder, right-click, and go. Requires ImageMagick.
#!/bin/zsh
# Add Random Gradient Background + Drop Shadow - macOS Quick Action Script
# Requires: ImageMagick (brew install imagemagick)
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
for INPUT_FILE in "$@"; do
FILENAME=$(basename "$INPUT_FILE")
DIRNAME=$(dirname "$INPUT_FILE")
@shreve
shreve / tp.md
Last active March 23, 2026 18:25
TP-Link Router Config Decrypt

TP-Link Router Config

Update 2021-04-29: This may still work for you if you've got an old TP-Link router, but this is not maintained and doesn't work with newer models. If you've got a newer router, other projects like tpconf_bin_xml will likely work better for you.

TP-Link allows you to backup and restore your router's config file. For some reason, they decided to encrypt these backups so you cannot modify them. I think this is dumb. This script lets you decrypt and re-encrypt your config files so you can modify them as you see fit.

I use this to modify my reserved addresses list because editing them through the web interface is terribly slow and cumbersome.

  1. Go to the router and download the config file from the "Backup & Restore" section of "System Tools".
  2. Run ruby tp.rb config.bin
@jose-mdz
jose-mdz / README.md
Last active March 23, 2026 18:22
Orthogonal Diagram Connector

Orthogonal Connectors

This algorithm returns the points that form an orthogonal path between two rectangles.

How to Use

// Define shapes
const shapeA = {left: 50,  top: 50, width: 100, height: 100};
const shapeB = {left: 200, top: 200, width: 50, height: 100};
@gsamat
gsamat / 00-CLAUDE.md
Created March 18, 2026 20:45
Технический аудит с ИИ-помощником

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What This Is

Technical and architectural audit of a system. This is an evolving documentation vault, not a codebase.

Language

@sbolel
sbolel / sign-previous-commits.md
Created June 21, 2023 16:48
How to sign previous commits in a PR

To sign all your commits in the Git Pull Request (PR), you can use a combination of git rebase and git commit --amend. Here are the steps:

  1. Before starting, make sure you've configured Git to use your signing key. You can do this with:

    git config --global user.signingkey YOUR_SIGNING_KEY
    git config --global commit.gpgsign true

    Replace YOUR_SIGNING_KEY with your GPG key ID.

  2. Then you need to start an interactive rebase with the parent of your first commit. If you don't know what commit that is, you can use git log to display your commit history. Once you have your commit hash, start the rebase:

@ner00
ner00 / #nes_rom_unheader.ps1
Last active March 23, 2026 18:17
NES ROM UNHEADER (16 Byte Header Remover)
# NES ROM UNHEADER (16 Byte Header Remover)
# -----------------------------------------
#
# ner0
# Created: 13/04/2020
# Reviewed: 14/04/2020
#
#
#
# Usage:
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active March 23, 2026 18:17
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

---
title: "Preparing Experimental Data for Analysis"
subtitle: "R + Quarto RevealJS"
author: "Elena Peden, Lylla Turco, Chloe Lockwood, Julianna Ross"
date: "3/23/26"
format:
revealjs:
theme: simple
template-partials:
- title-slide.html
@Konano
Konano / alert.py
Created September 19, 2022 16:08
Websocket-based notificatons push service for GZCTF platform to Discord.
import time
import _thread as thread
from websocket import WebSocketApp
import websocket
import requests
import json
from log import logger
GAME_ID = 1