Skip to content

Instantly share code, notes, and snippets.

View robb's full-sized avatar

Robb Böhnke robb

View GitHub Profile
import SwiftUI
struct ContentView: View {
@State var show: Bool = false
var body: some View {
ZStack {
Button {
show.toggle()
} label: {

Sensor Watch: Kurzanleitung

Die Platine der «Sensor Watch» ist so konzipiert, dass sie in eine Casio F-91W oder A158 Armbanduhr passt. Beachten Sie, dass sie nicht mit Fälschungen kompatibel ist! Sie benötigen eine echte Casio F-91W Armbanduhr als Spenderuhr für diesen Platinentausch.

Werkzeug

Sie benötigen mindestens einen kleinen Kreuzschlitzschraubendreher, um diesen Platinentausch durchzuführen. Eine Pinzette ist ebenfalls nützlich.

Optional können Sie mit einem Lötkolben eine kleine Metalllasche von der Originalplatine des F-91W entfernen und auf die Platine der «Sensor Watch» löten. Diese Änderung ist notwendig, damit der Summer funktionieren kann. Beachten Sie, dass die «Sensor Watch» mit Ausnahme des Summers auch ohne diese Änderung funktioniert.

import SwiftUI
struct ContentView: View {
@State var pictureExpanded = false
var body: some View {
VStack(alignment: .leading, spacing: 20.0) {
Text("Once upon a time there was a turtle named George who made friends with a giraffe at the local water park and then they went on lots of adventures together.")
Button {
@robb
robb / Example.m
Last active January 9, 2024 14:38
A macro to convert nullable references to nonnull references while triggering an assert if the expression is actually true. Think of this as unsafe unwrap for Objective-C.
NS_ASSUME_NONNULL_BEGIN
void Log(NSString *foo) {
NSLog(@"%@", foo);
}
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSDictionary *stuff = @{
@"a": @"Test"
{
"name": "SBJson",
"version": "4.0.2",
"license": {
"type": "BSD",
"text": " Copyright (C) 2007-2015 Stig Brautaset. All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n * Neither the name of the author nor the names of its contributors may be used\n to endorse or promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT L
import Foundation
typealias JSONDictionary = [String: AnyObject]
/// Attempts to load a data from a given URL.
func loadData(URL: NSURL) -> Either<NSError, NSData> {
if let data = NSData(contentsOfURL: URL) {
return Either.Right(Box(data))
} else {
// In a real world scenario, we'd have a more useful error :-)
import Prelude
public struct Lens<A, B> {
private let get: A -> B
private let set: (A, B) -> A
public init(get: A -> B, set: (A, B) -> A) {
self.get = get
self.set = set
}
Inbefore: im wald, morgen
@robb
robb / underscore.m
Last active August 29, 2015 13:56 — forked from rnapier/underscore.m
// No blocks-as-properties, just classic arguments
NSArray *tweets = [[[[[Underscore
array:results]
filter:Underscore.isDictionary]
reject:^(NSDictionary *tweet) {
return [tweet[@"iso_language_code"] isEqualToString:@"en"];
}]
map:^(NSDictionary *tweet) {
NSString *name = tweet[@"from_user_name"];
@robb
robb / gist:8777652
Created February 3, 2014 01:26
boolean operators for matchers
@interface FooTests : XCTestCase
@end
@implementation FooTests
- (void)testAnd {
expect(@"foo")
.to.beKindOfClass(NSString.class)
.and.equal(@"foo");