Skip to content

Instantly share code, notes, and snippets.

View drodriguez's full-sized avatar

Daniel Rodríguez Troitiño drodriguez

View GitHub Profile
@drodriguez
drodriguez / Spec.m
Created August 14, 2014 23:47
Better Kiwi?
#import "Kiwi.h"
#define KWPasteX(x, y) x ## y
#define KWPaste(x, y) KWPasteX(x, y)
#define KWMetaMacro(...) \
if (0) \
KWPaste(finished, __LINE__): ; \
else \
for (KWVoidBlock KWPaste(block, __LINE__) = nil;;) \
@drodriguez
drodriguez / gist:64c470cf59eae85767b1
Created December 6, 2014 00:10
Computed variable to return type conforming protocol.
protocol TestProtocol {
}
class TestClass : TestProtocol {
}
class TestClass2 {
}
struct Test {
@drodriguez
drodriguez / test-array-signature.c
Created December 24, 2014 11:34
TIL about arrays in signatures in C
#include <stdlib.h>
int test1(int32_t (*array)[10]) {
return 1;
}
int test2(int32_t (*array)[5]) {
return 2;
}
@import Foundation;
NS_ASSUME_NONNULL_BEGIN
@interface NewClass : NSObject
- (instancetype)initWithString:(NSString *)string NS_DESIGNATED_INITIALIZER;
@end
{
"name": "ReactiveCocoa",
"version": "4.2.1",
"summary": "A framework for composing and transforming streams of values.",
"description": "ReactiveCocoa (RAC) is an Objective-C framework for Functional Reactive Programming.\nIt provides APIs for composing and transforming streams of values.",
"homepage": "https://github.com/ReactiveCocoa/ReactiveCocoa",
"license": {
"type": "MIT",
"file": "LICENSE.md"
},
@drodriguez
drodriguez / preset_compare.fish
Created March 18, 2019 22:03
Testing the dry-run of the Swift presets
for pre in *.pre.txt
diff -urN \
(sed -E "s/ '--(swift|llvm)-cmake-options=[^']+'//g" $pre | psub)
(sed -E "s/ '--(swift|llvm)-cmake-options=[^']+'//g" (string replace -r '\.pre\.' '.output.' $pre) | psub)
or read
end