Skip to content

Instantly share code, notes, and snippets.

@networkextension
networkextension / diag.img4.report.txt
Created October 9, 2021 01:00
M1 iPad Pro WIFI diags
Type | Subtype | Offset | Size | CRC32 | Name
Image | UEFI | 00000000 | 0299AA15 | F1D51BF8 | UEFI image
Padding | Non-empty | 00000000 | 000E0027 | D0F8A5FF | - Padding
Volume | FFSv2 | 000E0027 | 00008000 | A28B90B1 | - 8C8CE578-8A3D-4F1C-9935-896185C32DD3
Free space | | 000E006F | 00007FB8 | 425AB2D9 | -- Volume free space
Volume | FFSv2 | 000E8027 | 028B0000 | 25F96F5F | - 8C8CE578-8A3D-4F1C-9935-896185C32DD3
File | Freeform | 000E806F | 0000013C | C3B1AD8F | -- FC510EE7-FFDC-11D4-BD41-0080C73C8881 | DXE apriori file
Section | Raw | 000E8087 | 00000124 | 103B4756 | --- Raw section
File | Pad | 000E81AF | 00007E60 | D21642FD | -- Pad-file
@mattgallagher
mattgallagher / AppDelegate.swift
Last active May 18, 2022 17:42
Animated circle views in SwiftUI and AppKit/CoreAnimation
//
// AppDelegate.swift
// SwiftUITestApp
//
// Created by Matt Gallagher on 4/6/24.
// Copyright © 2019 Matt Gallagher. All rights reserved.
//
import Cocoa
import SwiftUI
//
// ContentView.swift
// TestingMoreSwiftUI
//
// Created by Chris Eidhof on 04.06.19.
// Copyright © 2019 Chris Eidhof. All rights reserved.
//
import SwiftUI
import Combine
@woachk
woachk / AAPL.md
Last active May 17, 2021 03:44
Apple in 2018: what's new

Apple devices in 2018

Notes

Both iPhone and Watch ship with a Secure Enclave processor. Both are also H11-class SoCs. As such, there are broad similarities between the different blocks. Embedded cores present on-die use firmware written with RTKit, which is Apple's own broadly-used RTOS on cores codenamed Chinook. The codename for the eSIM platform on both the iPhone and Watch is Vinyl. The NFC (+Apple Pay?) controller is named Stockholm, and the Apple Watch Series 4 + iPhone Xs and Xr ship with version 5.

@ty60
ty60 / test_udp.c
Last active July 20, 2024 23:45
C program to send raw UDP packet
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdint.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <linux/if_ether.h>
#include <arpa/inet.h>
@rudelm
rudelm / autofs.md
Last active November 5, 2024 01:57
Use autofs on Mac OS X to mount network shares automatically during access

Autofs on Mac OS X

With autofs you can easily mount network volumes upon first access to the folder where you want to mount the volume. Autofs is available for many OS and is preinstalled on Mac OS X so I show you how I mounted my iTunes library folder using this method.

Prepare autofs to use a separate configuration file

autofs needs to be configured so that it knows where to gets its configuration. Edit the file /etc/auto_master and add the last line:

#
# Automounter master map
#

+auto_master # Use directory service

@steipete
steipete / PSPDFEnvironment.m
Last active March 5, 2024 09:15
Example for DISPATCH_SOURCE_TYPE_MEMORYPRESSURE (Mac only, since 10.9) ... Since we share code between iOS and mac, I'm trying to be a good system citizen and reimplement the equivalent of UIApplicationDidReceiveMemoryWarningNotification on the Mac.
NSString *const PSPDFApplicationDidReceiveMemoryWarningNotification = @"PSPDFApplicationDidReceiveMemoryWarningNotification";
// Test with sudo memory_pressure -l critical. Don't forget to re-set afterwards!
__attribute__((constructor)) static void PSPDFInstallLowMemoryNotificationWarningMac(void) {
static dispatch_source_t source;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYPRESSURE, 0, DISPATCH_MEMORYPRESSURE_WARN|DISPATCH_MEMORYPRESSURE_CRITICAL, dispatch_get_main_queue());
dispatch_source_set_event_handler(source, ^{
dispatch_source_memorypressure_flags_t pressureLevel = dispatch_source_get_data(source);
@rodionovd
rodionovd / ssd.c
Last active July 6, 2023 05:15
ssd -- Socket Server demo by Apple
// Copyright (C) 2010 Apple Inc. All Rights Reserved.
#include <launch.h>
#include <libkern/OSAtomic.h>
#include <vproc.h>
#include "shared.h"
static bool g_is_managed = false;
static bool g_accepting_requests = true;
static dispatch_source_t g_timer_source = NULL;