Creating a custom Combine Publisher to extend UIKit: https://www.avanderlee.com/swift/custom-combine-publisher/
let button = UIButton()
button
.publisher(for: .touchUpInside)
.sink{ control in print("touch up inside")}
// Custom Date Decoding | |
jsonDecoder.dateDecodingStrategy = .custom({ (decoder) -> Date in | |
let data = try decoder.singleValueContainer().decode(String.self) | |
//perform your operation on obtained string | |
let disturbance = "01-07-1977" | |
let formatter = DateFormatter() | |
formatter.dateFormat = "dd-MM-yyyy" | |
if data == "First disturbance in force" { | |
return formatter.date(from: disturbance) ?? Date() | |
} else { |
// Manual set-up | |
// click: ▼ at top-right | |
// Newsfeed preferences | |
// "Unfollow people to hide their posts" (also includes all Pages, which are not real "people") | |
// Scroll to the bottom of that so they are all listed | |
// Open console (f12, or whatever the fuck on MacOS) and paste these two lines: | |
var e = document.querySelectorAll("._5u3n"); | |
e.forEach(function(elem){ elem.click() }); |
Creating a custom Combine Publisher to extend UIKit: https://www.avanderlee.com/swift/custom-combine-publisher/
let button = UIButton()
button
.publisher(for: .touchUpInside)
.sink{ control in print("touch up inside")}
This gist has graduated to a full-fledged project! All future updates will happen in the repo; this gist is no longer maintained.
Daily systemd timer to backup the contents of my filesystem to Backblaze B2. As-written, it will keep up to a year's worth of backups, performing one full backup every month. This script was tested with duplicity 3.0.3.