Flatten a nested directory tree into one folder without losing path context.
| /** | |
| * This script automates the process of deleting your own Instagram comments. | |
| * It deletes comments in batches to avoid hitting rate limits or breaking the page. | |
| * | |
| * WARNING: This function directly manipulates the DOM and depends on the current HTML | |
| * structure of Instagram's website to work. If Instagram implements changes to the | |
| * activity page layout, structure, or functionality, this script may break or cause | |
| * unexpected behavior. Use at your own risk and always review code before running it. | |
| * | |
| * How to use: |
This Oh My Zsh plugin combines the contents of multiple files into a single markdown document, supporting syntax highlighting based on file extensions. If an output file is not specified, the script copies the content to the clipboard, making it easy to paste anywhere.
- Combines multiple files into one markdown document.
- Automatically adds syntax highlighting based on the file extension.
- Option to copy combined content to the clipboard if no output file is specified.
| #!/usr/bin/env zsh | |
| # ~/.macos — https://mths.be/macos | |
| # Modified by Kent C. Dodds, Sinan Bolel | |
| # Run without downloading: | |
| # curl https://raw.githubusercontent.com/<THIS_URL> | bash | |
| ### UPDATE THIS TO YOUR GITHUB NOREPLY EMAIL: | |
| __GITHUB_EMAIL__="1234567+username@users.noreply.github.com" |
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:
-
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 trueReplace
YOUR_SIGNING_KEYwith your GPG key ID. -
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 logto display your commit history. Once you have your commit hash, start the rebase:
| ;(function (d) { | |
| if (!slackDebug?.activeTeamId) { | |
| slackDebug?.enable() | |
| } | |
| const UPDATE_ACTION = 'ACTION_UPDATE_UNREAD_COUNTS' | |
| const NEW_DNM_BTN_SEL = '.c-link--button.p-unreads_view__show_newer' | |
| const NEW_BTN_SEL = '.c-button.c-button--primary.c-button--medium' | |
| const HEADER_BTN_SEL = | |
| '.c-button-unstyled.p-ia__view_header__button.p-ia__view_header__button--with_label' |
This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.
Convert .mov/.MP4 to .gif
As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.
This is not limited to developer, anyone has this need can use this method to convert the files.
| import sys | |
| import sched | |
| import time | |
| from Quartz.CoreGraphics import CGEventCreateMouseEvent, kCGMouseButtonLeft, CGEventPost, kCGHIDEventTap, kCGEventMouseMoved, kCGEventLeftMouseDown, kCGEventLeftMouseUp, CGEventCreate, CGEventGetLocation | |
| def mouseevent(type, posx, posy): | |
| event = CGEventCreateMouseEvent(None, type, (posx, posy), kCGMouseButtonLeft) | |
| CGEventPost(kCGHIDEventTap, event) | |
| def mousemove(posx, posy): |
Assorted helpful snippets for use in your shell.
extension_id=jifpbeccnghkjeaalbbjmodiffmgedin # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc"
unzip -d "$extension_id-source" "$extension_id.zip"Thx to crxviewer for the magic download URL.