Skip to content

Instantly share code, notes, and snippets.

View chbeer's full-sized avatar

Christian Beer chbeer

View GitHub Profile

Keybase proof

I hereby claim:

  • I am chbeer on github.
  • I am chbeer (https://keybase.io/chbeer) on keybase.
  • I have a public key whose fingerprint is 955E 7830 DD98 0982 3A8C FC4E 1114 A855 051E 77B4

To claim this, I am signing this object:

@chbeer
chbeer / gist:708c696115230a0d7a56
Created October 6, 2014 22:47
Mapping of old OS X date format (as used in strftime) to unicode format (as used nowadays)
OLD NEW
--------------------------------------------------------------------
%A EEEE
%a E
%B MMMM
%b MMM
%C ??
%c ??
%D MM/dd/yy
%d dd
@chbeer
chbeer / gist:fe5e66786683786c3b75
Created October 30, 2014 15:55
strings Keys for "Display Pattern" and "Null Placeholder"
"<objectid>.ibShadowedDisplayPattern" = "Localized Text %{value1}@";
"<objectid>.ibShadowedIsNilPlaceholder" = "Null Placeholder i18n";
@chbeer
chbeer / gist:a59b655b25962dccfe02
Last active August 29, 2015 14:08
Examining Avea via gatttool

Find Avea

pi@raspberrypi ~ $ sudo hcitool lescan
LE Scan ...
…
B4:99:4C:49:4D:7B Avea_7B4D
…
@chbeer
chbeer / gist:0d02b09b3b127bf4915c
Created January 23, 2015 21:14
Crash with "Show Detail" Segue
(lldb) bt
* thread #1: tid = 0x6b9a, 0x00000001974c00a8 libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x00000001974c00a8 libobjc.A.dylib`objc_exception_throw
frame #1: 0x0000000186c53290 CoreFoundation`-[__NSArrayM insertObject:atIndex:] + 844
frame #2: 0x000000018b5b7ad0 UIKit`-[UINavigationBar pushNavigationItem:] + 268
frame #3: 0x000000018b5b78bc UIKit`-[UINavigationBar _pushNavigationItem:transition:] + 392
frame #4: 0x000000018b7fa334 UIKit`-[UINavigationBar _addItem:withEffectiveDelegate:transition:] + 152
frame #5: 0x000000018b839bfc UIKit`-[UIViewController _appendNavigationItemsToNavigationController:transition:] + 456
frame #6: 0x000000018b5b7340 UIKit`__71-[UINavigationController pushViewController:transition:forceImmediate:]_block_invoke + 292
frame #7: 0x000000018b5d114c UIKit`-[UINavigationController _startDeferredTransitionIfNeeded:] + 980
@chbeer
chbeer / Dev Links.md
Last active August 29, 2015 14:14
Developer Links
@chbeer
chbeer / gist:1312967
Created October 25, 2011 14:42
performFetchAndUpdateTableView: that performs a fetch request on NSFetchedResultsController and updates table view
// ONLY WORKS WITH ONE SECTION!!
- (BOOL) performFetchAndUpdateTableView:(NSError **)error
{
NSArray *objectsBefore = [self.fetchedResultsController.fetchedObjects retain];
BOOL result = [self.fetchedResultsController performFetch:error];
if (result) {
NSArray *objectsAfter = self.fetchedResultsController.fetchedObjects;
@chbeer
chbeer / gist:1385714
Created November 22, 2011 13:56
Small Apple Script that creates a mail with UUID of device
do shell script "system_profiler SPHardwareDataType | grep 'Hardware UUID:'"
set uuid to text ((offset of ":" in result) + 2) thru -1 of result
tell application "Mail"
set theNewMessage to make new outgoing message with properties {subject:"Mac App Beta - My UUID", content:uuid, visible:true}
tell theNewMessage
make new to recipient at end of to recipients with properties {address:"mail@test.com"}
end tell
end tell
@chbeer
chbeer / gist:1612240
Created January 14, 2012 17:46
iPad logs when it doesn't finish deleting iCloud account.
========================
ASL is here to serve you
>
Jan 14 17:31:24 unknown configd[45] <Error>: WiFi:[348251484.774721]: bootstrap_look_up of WiFiManager server failed
Jan 14 17:31:24 unknown kernel[0] <Debug>: AppleBCMWLANChipManager::withBus(): BCM4329 revision B1
Jan 14 17:31:24 unknown kernel[0] <Debug>: AppleMultitouchZ2SPI: downloaded 47160 bytes of firmware data ("0x0146.bin") in 154ms.
Jan 14 17:31:24 unknown kernel[0] <Debug>: AppleBCMWLANChipManagerSdio4329::downloadFirmware(): start
Jan 14 17:31:24 unknown kernel[0] <Debug>: Loading syscfg.
@chbeer
chbeer / NSDate ISO methods
Created June 10, 2013 09:33
Methods to create and parse ISO date strings without NSDateFormatter.
NSDate *CBCBDateFromISOString(NSString *iso)
{
struct tm tm;
time_t t;
if (iso.length == 10) {
strptime([iso cStringUsingEncoding:NSUTF8StringEncoding], "%Y-%m-%d", &tm);
tm.tm_isdst = -1;
tm.tm_sec = 0;