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
View download-email.eml
Received: by with SMTP id ez6csp10837vcb;
Wed, 6 Feb 2013 02:50:28 -0800 (PST)
X-Received: by with SMTP id s2mr9987477anj.88.1360147827848;
Wed, 06 Feb 2013 02:50:27 -0800 (PST)
Return-Path: <>
Received: from ( [])
by with ESMTP id n67si25089644yhk.66.2013.;
Wed, 06 Feb 2013 02:50:27 -0800 (PST)
Received-SPF: pass ( domain of designates as permitted sender) client-ip=;
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;
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))
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 {
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

Keybase proof

I hereby claim:

  • I am danieleggert on github.
  • I am 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:

danieleggert / GPG and git on
Last active May 22, 2020
How to set up git to use the GPG Suite
View GPG and git on

GPG and git on macOS


No need for homebrew or anything like that. Works with and the command line.

  1. Install -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for
  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
danieleggert /
Created Feb 6, 2018
How to trigger a sysdiagnose on iOS

How To sysdiagnose on iOS:

  1. Hold volume up + volume down + power for 250 milliseconds.
  2. Wait (up to 5 minutes)
  3. > Privacy > Analytics > Analytics Data
  4. Select the "sysdiagnose_" file and share via AirDrop to a Mac.
You can’t perform that action at this time.