Skip to content

Instantly share code, notes, and snippets.

@hlorand
hlorand / capcut-offline-installer-search-script.sh
Last active May 10, 2025 02:01
CapCut offline installers download links
#!/bin/bash
# Searches for CapCut video editor (https://capcut.com) offline installer files.
# If links not available, use https://web.archive.org to download executable.
for va in {4..5}; do
for vb in {1..20}; do
for vc in {0..20}; do
for build in {1647..3000}; do
for extension in dmg exe; do
@mpcabd
mpcabd / python-mac-set-html-clipboard.py
Created June 1, 2017 15:40
Python3 - Set Mac clipboard with HTML content
import subprocess
html = '<p><strong>Hello</strong> <em>Bob</em> <code>How</code> are you!</p>'
p_hex = subprocess.Popen(
('hexdump', '-ve', '1/1 "%.2x"'),
stdin=subprocess.PIPE,
stdout=subprocess.PIPE
)
p_hex_output = p_hex.communicate(html.encode('utf-8'))[0]
@golimpio
golimpio / egos_throttle.sh
Last active July 5, 2024 02:48
Run cputhrottle for a list of applications in order to limit their CPU usage.
#!/bin/bash
# Run cputhrottle for a list of applications in order to limit their CPU usage.
# This script needs `pidof` and `cputhrottle` installed, which can be installed from homebrew.
# NOTE: This script was tested on MacOS only.
if [[ $EUID > 0 ]]; then
echo "Please run this script as root/sudo"
exit 1
fi
@scturtle
scturtle / gist:3060332
Created July 6, 2012 14:05
python 3 语法变化