- Tweetbot
- Pastebot
- 1Password
- Spark
- Things
- Bear
- Slack
- Annotate
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
// Ensures the shake is strong enough on at least two axes before declaring it a shake. | |
// "Strong enough" means "greater than a client-supplied threshold" in G's. | |
static BOOL L0AccelerationIsShaking(UIAcceleration* last, UIAcceleration* current, double threshold) { | |
double | |
deltaX = fabs(last.x - current.x), | |
deltaY = fabs(last.y - current.y), | |
deltaZ = fabs(last.z - current.z); | |
return | |
(deltaX > threshold && deltaY > threshold) || |
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
using System; | |
using System.Collections.Generic; | |
using Android.Content.Res; | |
using System.Resources; | |
using System.IO; | |
using Android.Content; | |
using Android.App; | |
namespace AndroidSandbox | |
{ |
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
<!DOCTYPE project> | |
<project name="SEIS785Project" default="main" basedir="."> | |
<!-- load properties file --> | |
<property file="build.properties" /> | |
<!-- Sets variables which can later be used. --> | |
<!-- The value of a property is accessed via ${} --> | |
<property name="src.dir" location="src" /> | |
<property name="build.dir" location="build" /> | |
<property name="dist.dir" location="dist" /> |
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
// clang -fobjc-arc -framework Foundation runtime-class.m | |
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
@interface Person : NSObject | |
- (id)initWithFirstName: (NSString *)firstName lastName: (NSString *)lastName age: (NSUInteger)age; |
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
#import <objc/runtime.h> | |
- (BOOL) objectsAreEqual:(NSObject *)o1 objectTwo:(NSObject *)o2 { | |
if([o1 class] != [o2 class]) return NO; | |
NSUInteger property_count; | |
objc_property_t * property_list = class_copyPropertyList([o1 class], &property_count); // Must Free, later | |
for (int i = 0; i <= property_count ; i++) { // Reverse order, to get Properties in order they were defined |
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
#import "UIViewController+RecursiveDescription.h" | |
@implementation UIViewController (RecursiveDescription) | |
-(NSString*)recursiveDescription | |
{ | |
NSMutableString *description = [NSMutableString stringWithFormat:@"\n"]; | |
[self addDescriptionToString:description indentLevel:0]; | |
return description; | |
} |
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
// As a local variable. | |
returnType (^blockName)(parameterTypes) = ^returnType(parameters) {...}; | |
// As a property. | |
@property (nonatomic, copy) returnType (^blockName)(parameterTypes); | |
// As a method parameter. | |
- (void)someMethodThatTakesABlock:(returnType (^)(parameterTypes))blockName {...} | |
// As an argument to a method call. |
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
/* | |
* Example usage | |
* | |
* id<MyProtocol> mockProtocol = [DynamicObject new]; | |
* | |
* mockProtocol.mockProperty = SomeEnum; | |
* mockProtocol.mockString = @"Foo"; | |
* | |
*/ |
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
{"version":1,"resource":"file:///Users/ekerber/dev/slack/slack-objc/bazel/tests.bzl","entries":[{"id":"BP4O.bzl","timestamp":1658882739917}]} |
OlderNewer