Skip to content

Instantly share code, notes, and snippets.

Daniel Eggert danieleggert

Block or report user

Report or block danieleggert

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@danieleggert
danieleggert / iOS_sysdiagnose.md
Created Feb 6, 2018
How to trigger a sysdiagnose on iOS
View iOS_sysdiagnose.md

How To sysdiagnose on iOS:

  1. Hold volume up + volume down + power for 250 milliseconds.
  2. Wait (up to 5 minutes)
  3. Settings.app > Privacy > Analytics > Analytics Data
  4. Select the "sysdiagnose_" file and share via AirDrop to a Mac.
@danieleggert
danieleggert / GPG and git on macOS.md
Last active Oct 23, 2019
How to set up git to use the GPG Suite
View GPG and git on macOS.md

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
View keybase.md

Keybase proof

I hereby claim:

  • I am danieleggert on github.
  • I am danielboedewadt (https://keybase.io/danielboedewadt) on keybase.
  • I have a public key whose fingerprint is A529 F8B6 3037 F7F8 AA11 0849 FA00 7047 A6B1 67E1

To claim this, I am signing this object:

View main.c
//
// main.c
// pausehandle
//
// Created by Daniel Eggert on 12/04/16.
//
// Run an HTTP server like so:
// % echo "Hello" > hello.txt
// % python -m SimpleHTTPServer
// The code expects to be able to get a text file at
View KeyValueObserver.swift
import Foundation
/// A type-safe Key-Value-Observer (KVO).
///
/// Extend the class to be observed to implement `KeyCodable`, e.g.
/// ```
/// extension WKWebView: KeyCodable {
/// enum Key: String {
@danieleggert
danieleggert / NSData+hexadecimal.swift
Created Aug 30, 2015
Hexadecimal string from NSDate
View NSData+hexadecimal.swift
import Foundation
extension NSData {
var hexadecimalString: String {
var result = ""
enumerateByteRangesUsingBlock { (pointer, range, _) in
let pointerToBytes = UnsafePointer<UInt8>(pointer)
let bytes = UnsafeBufferPointer(start: pointerToBytes, count: range.length)
for v in bytes {
result.appendContentsOf(String(format:"%02x", v))
@danieleggert
danieleggert / teardown.m
Created Dec 4, 2014
Tear Down for async code
View teardown.m
@implementation Foo
{
BOOL _needsTearDown;
}
- (instancetype)init;
{
self = [super init];
if (self) {
_needsTearDown = YES;
View download-email.eml
Delivered-To: daniel+test@helloclue.com
Received: by 10.220.201.70 with SMTP id ez6csp10837vcb;
Wed, 6 Feb 2013 02:50:28 -0800 (PST)
X-Received: by 10.101.40.2 with SMTP id s2mr9987477anj.88.1360147827848;
Wed, 06 Feb 2013 02:50:27 -0800 (PST)
Return-Path: <bounce-md_15131679.51123572.v1-2a00d47e46b0457fb24993692ada811c@mail263.us4.mandrillapp.com>
Received: from mail263.us4.mandrillapp.com (mail263.us4.mandrillapp.com. [205.201.137.7])
by mx.google.com with ESMTP id n67si25089644yhk.66.2013.02.06.02.50.27;
Wed, 06 Feb 2013 02:50:27 -0800 (PST)
Received-SPF: pass (google.com: domain of bounce-md_15131679.51123572.v1-2a00d47e46b0457fb24993692ada811c@mail263.us4.mandrillapp.com designates 205.201.137.7 as permitted sender) client-ip=205.201.137.7;
You can’t perform that action at this time.