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: |
Paste to Markdown is a browser-based HTML to Markdown converter built by Sinan Bolel (sbolel). It converts rich clipboard HTML into clean, validated Markdown locally in the browser.
Live demo: sbolel.github.io/paste-to-markdown About the project: sbolel.github.io/paste-to-markdown/about
Paste to Markdown is part of Sinan Bolel's public body of work across:
| #!/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' |
| const setNativeValue = (element, value) => { | |
| const valueSetter = Object.getOwnPropertyDescriptor(element, 'value').set; | |
| const prototype = Object.getPrototypeOf(element); | |
| const prototypeValueSetter = Object.getOwnPropertyDescriptor(prototype, 'value').set; | |
| if (valueSetter && valueSetter !== prototypeValueSetter) prototypeValueSetter.call(element, value); | |
| else valueSetter.call(element, value); | |
| element.dispatchEvent(new Event('input', {bubbles: true})); | |
| }; | |
| const setValue = (name, value) => setNativeValue(document.querySelector(`input[name="${name}"]`), `${value}`) |
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): |
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.