Skip to content

Instantly share code, notes, and snippets.

View antokne's full-sized avatar

Ant Gardiner antokne

View GitHub Profile
@antokne
antokne / HelloWorldView.swift
Created October 9, 2023 02:29
Test for colorScheme env variable.
import SwiftUI
struct ContentView: View {
@Environment(\.colorScheme) var colorScheme: ColorScheme
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
Command to enable radar data over BTLE send to char 0xE5CC02
0x57,0x09,0x01
Disable
0x57,0x09,0x00
Then set notify on 0xE5CC02
Data as follows from Radar demo mode
### Keybase proof
I hereby claim:
* I am antokne on github.
* I am antokne (https://keybase.io/antokne) on keybase.
* I have a public key ASDOlZ97witKMVmp9RE-9kMZDfxRwspWyNrK2C-W3A2aZwo
To claim this, I am signing this object:
@antokne
antokne / gist:9591536
Created March 16, 2014 23:44
keybase.md
### Keybase proof
I hereby claim:
* I am antokne on github.
* I am antokne (https://keybase.io/antokne) on keybase.
* I have a public key whose fingerprint is 1B87 58D6 F933 1917 7F2B F0E7 8DE3 7540 1EF4 BEE6
To claim this, I am signing this object:
@antokne
antokne / iPhone 5 defines
Last active December 16, 2015 00:59
iPhone 5 defines
// put these in you pch
#define isPhone568 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568)
#define iPhone568ImageNamed(image) (isPhone568 ? [NSString stringWithFormat:@"%@-568h.%@", [image stringByDeletingPathExtension], [image pathExtension]] : image)
#define iPhone568Image(image) ([UIImage imageNamed:iPhone568ImageNamed(image)])
@antokne
antokne / gist:5261551
Created March 28, 2013 08:14
components:fromDate:toDate:options: error
*** -[__NSCFCalendar components:fromDate:toDate:options:]: fromDate cannot be nil
I mean really, what do you think that operation is supposed to mean with a nil fromDate?
An exception has been avoided for now.
A few of these errors are going to be reported with this complaint, then further violations will simply silently do whatever random thing results from the nil.
Here is the backtrace where this occurred this time (some frames may be missing due to compiler optimizations):
(
0 CoreFoundation 0x33adc48f <redacted> + 86