steve lee
Ruby - Job scheduling lock with Redis
Introduction
In a Rails app, sometimes you need to execute a long-running job and have to run it in the background. You might run into some special requirements to avoid duplicate jobs
Problem 1
You must delete the user and all related data in CleanupDataJob job. It will take a long time, and to avoid some problems, such as database-locking, you need to keep only one user deleted at a time.
Problem 2
You have the ProductSalesJob to fetch the sales data of the product and calculate some numbers. What if you had 100 of these jobs? Your…
busylog
iPhone Shortcuts tips
Generate QR Code (from Clipboard, Show in Quick Look)
Great way to transfer short text/url between devices.
Extract Text from Images (OCR, from Clipboard, Show in Quick Look)
Automation: When NFC card is detected (set some Speak? action)
Note that it is the most quick way to confirm NFC functionality is working, without 3rd party apps.
check SEID in Settings. if it is available then the secure element is working. the antenna may not be connected correctly (NFC antenna is a loop, one connect to small antenna, and one connect to rare case).
iPhone does NOT support reading / connecting…
busylog
Some simple ideas that can be done in minutes with any chat AI
simple progress and deliverables are important for programming/ai beginners.
1 expand script
curl supports [1-99] like number enumeration, and bash supports {a,b,c,d} list expand.
write a python script that expand argv[1]. (seq -f "%g" number also works though)
2 pastebin
note that in python 3.14, there is no more multipart parser to accept file upload easily.
save the file/text under upload-timestamp-randomnumber.txt
and use Content-Type application/octet-stream for any file/text display.
3 line joiner or slot joiner(if all keyword appeared, display in order)
script filename a…
busylog
Notes for migrating to new iPhone
keep the old phone until finance/banking apps are successfully tested, and record related info first.
but delete the app wont actually hurt as long as you dont wipe the phone to reset device id.
remove most cards from Apple Pay, it will be saved to the cloud but some needs cvv / sms / phone verification later. you cant receive SMS until the entire transfer ends so you wont be successful re-enable those cards, so do it later.
delete those Chinese apps that could simply re-login with mobile number and SMS (unless chats/files are valuable), it saves time…
busylog
Celebrate HLS support on Chrome 142+
You can use more browsers than players?
Requirements: the Header Editor extension from https://he.firefoxcn.net/
if something can play on ffmpeg/mpv but not browser?
"headers": {
"user-agent": "Lavf/58.29.100",
"referer": "_header_editor_remove_"
}
if something triggered direct downloads (application/octet-stream)?
"condition": {
"regex": "\\.m3u8"
},
"headers": {
"content-type": "application/vnd.apple.mpegurl"
},
this might be useful as well.
%{start msedge -argumentlist ("-inprivate", $_)}
other interesting redirection:
(.*)/flutter_bootstrap\.js(.*) -> $1/main.dart.js$2
Domains:
font.googleapis.com -> font.googleapis.cn
ajax.googleapis.com -> cdnjs.cloudflare.com