Skip to content

Instantly share code, notes, and snippets.

View robb's full-sized avatar

Robb Böhnke robb

View GitHub Profile
@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"
import SwiftUI
struct ContentView: View {
@State var show: Bool = false
var body: some View {
ZStack {
Button {
show.toggle()
} label: {
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 {

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 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
}
Running 136 tests:
........................................................................................................................................
# ----- XCode (OCUnit) Test Output --------------------
Test Case '-[AsyncSpecTest testAsyncSpec]' started.
Test Case '-[AsyncSpecTest testAsyncSpec]' passed (0.036 seconds).
Test Case '-[AsyncSpecTest2 testBeforeAllAndAfterAllHooks]' started.
Test Case '-[AsyncSpecTest2 testBeforeAllAndAfterAllHooks]' passed (0.000 seconds).

Mantle

Mantle makes it easy to write a simple model layer for your Cocoa or Cocoa Touch application.

Getting Started

To start building the framework, clone this repository and then run script/bootstrap. This will automatically pull down any dependencies.

// MTLManagedObjectAdapter.m
- (NSPredicate *)uniquingPredicateForModel:(MTLModel<MTLManagedObjectSerializing> *)model {
NSSet *propertyKeys = nil;
if ([self.modelClass respondsToSelector:@selector(propertyKeysForManagedObjectUniquing)]) {
propertyKeys = [self.modelClass propertyKeysForManagedObjectUniquing];
}
NSPredicate *predicate = nil;
for (NSString *propertyKey in propertyKeys) {
Pod::Spec.new do |s|
s.name = "ReactiveCocoa"
s.version = "2.0.0rc3"
s.summary = "A framework for composing and transforming sequences of values."
s.homepage = "https://github.com/blog/1107-reactivecocoa-is-now-open-source"
s.author = { "Josh Abernathy" => "josh@github.com" }
s.source = { :git => "https://github.com/ReactiveCocoa/ReactiveCocoa.git", :tag => 'v2.0-RC3' }
s.license = 'Simplified BSD License'
s.description = "ReactiveCocoa offers:\n" \
"1. The ability to compose operations on future data.\n" \
//
// Example.m
// Partial
//
// Created by Robert Böhnke on 5/23/13.
// Copyright (c) 2013 Robert Böhnke. All rights reserved.
//
#import "Partial.h"