Skip to content

Instantly share code, notes, and snippets.

@l3nz
l3nz / README.md
Last active June 7, 2025 16:18
NOT Fixed: accountsd using 400% CPU on MacOS Catalina 10.15.7 (19H2)

accountsd using 400% CPU on MacOS Catalina 10.15.7 (19H2)

TL;DR: Still open - see below.

This morning I woke up to some not-so-nice surprise - my 2018 MPB 13" would be kind of totally unusable. The accountsd process was stable at 400%, battery was going like ice-cream in the Sahara, and opening up LibreOffice was like a major achievement.

I did check the logs (that were growing at like 500 lines per second) and I saw a lot of lines at FAULT level:

fault 07:54:04.271342+0200 accountsd Unentitled access by client 'CallHistoryPlugi' (selector: accountsWithAccountType:handler:)

@mwahlig
mwahlig / ZipManyPublisher.swift
Last active February 17, 2024 02:15
a Combine Publisher that allows for zipping an array of publishers while maintaining their index
extension Publishers {
private struct IndexedResult<T> {
let index: Int
let result: T
}
private struct IndexedPublisher<Upstream>: Publisher where Upstream: Publisher {
typealias Output = IndexedResult<Upstream.Output>
typealias Failure = Upstream.Failure
private var cellViewModels: [PhotoListCellViewModel] = [PhotoListCellViewModel]() {
didSet {
self.reloadTableViewClosure?()
}
}
var numberOfCells: Int {
return cellViewModels.count
}
func getCellViewModel( at indexPath: IndexPath ) -> PhotoListCellViewModel
@thorikawa
thorikawa / matching_sift.cpp
Created August 19, 2012 23:37
SIFT keypoint matcher using OpenCV C++ interface
#include <opencv2/opencv.hpp>
#include <opencv2/nonfree/nonfree.hpp>
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
using namespace cv;
const double THRESHOLD = 400;