Skip to content

Instantly share code, notes, and snippets.

View m-jacobi's full-sized avatar

Matthias Jacobi m-jacobi

View GitHub Profile
@pchhetri
pchhetri / README.md
Last active May 6, 2025 15:07
OS X iMessage (Messages) database merger

OS X iMessage (Messages) database merger

Use it at your own risk! You might end up worse than before. Backup everything beforehand. Twice.

If you have the Messages app setup in multiple Macs with the same Apple ID you may end up with iMessages (or SMS) scattered around all of these Macs. This is because after a certain time the new iMessages (or SMS) recevied will cease to push to devices afer a certain time has elapsed. Thus, if a computer has been offline for some period of time it won't get the new iMessages.

Each Messages instance stores the information in a SQLite database, to consolidate all these databases run the script below. This is where the Messages app stores the SQLite database under ~/Library/Messages, the folder contents will look like as follows:

  • chat.db
@tdpsk
tdpsk / Primzahlen.c
Created October 24, 2012 14:58
Ermitteln von Primzahlen nach dem Sieb des Eratosthenes
#include "Primzahlen.h"
// Lege ein globales Array an für die Daten. Dank moderner Rechner darf man
// davon ausgehen, dass das Array mit den Werten 0 initialisiert wird
// Es ist ausreichend, die Hälfte des Maximalwertes zu nehmen, da wir nur
// die ungeraden Werte prüfen und in diesem Array ablegen, ob sie Primzahlen
// sind oder nicht
unsigned char ppz[SIZE + 1];
HANDLE hThreads[ANZ_THREADS];