This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <arpa/inet.h> | |
#include <netinet/in.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/_types/_socklen_t.h> | |
#include <sys/select.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TCObject.m | |
// | |
// | |
// Created by Karsten Kusche on 19.12.20. | |
// Copyright © 2020 briksoftware.com. All rights reserved. | |
// | |
// | |
// compile with -fno-objc-arc | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// compile using: clang -fobjc-arc -framework AppKit bundlelessApplication.m -o bundleLess | |
// | |
// opens a NSApplication with dock icon and menu bar. NSRunningApplication will return no bundleURL for it | |
// | |
// via http://stackoverflow.com/questions/8137538/cocoa-applications-from-the-command-line | |
// and http://casperbhansen.wordpress.com/2010/08/15/dev-tip-nibless-development/ | |
#import <Foundation/Foundation.h> | |
#import <Cocoa/Cocoa.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSUInteger pointCount = self.waypoints.count; | |
MKMapPoint* points = calloc(sizeof(MKMapPoint), pointCount); | |
CGFloat minX = CGFLOAT_MAX, minY = CGFLOAT_MAX; | |
CGFloat maxX = 0, maxY = 0; | |
{ | |
NSInteger i = 0; | |
for (CLLocation* location in self.waypoints) | |
{ | |
MKMapPoint point = MKMapPointForCoordinate(location.coordinate); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
replace _appName_ with the name of your app (i.e. Contacts.app) | |
- open Terminal window | |
find /var/folders -name _appName_ 2>/dev/null | |
- delete all folders that were found | |
- build & archive _appName_ | |
- open archive in Finder, locate _appName_ | |
- open gdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on code from http://the-useful.blogspot.de/2012/01/getting-nsstatusitem-co-ordinates.html | |
@implementation NSStatusItem (Position) | |
- (NSRect)frame | |
{ | |
if (self.view) | |
{ | |
return [[self.view window] frame]; |