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
; https://gist.github.com/neuro-sys/b8bb7187540a17308bf0b3fe0a7836fd | |
; pasmo --cdt cpc_interrupts.asm cpc_interrupts.cdt | |
org &8000 | |
start: | |
di | |
im 1 |
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
class Welder | |
{ | |
public: | |
Welder(int pin); | |
void loop(bool welding); | |
private: | |
int welderLedPin; | |
unsigned long currentMillis = 0; | |
unsigned long previousMillisArc = 0; |
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 "OAuthRequestSigner.h" | |
#import <CommonCrypto/CommonCrypto.h> | |
@implementation OAuthRequestSigner | |
+(void)signRequestForOAuthRequest:(NSMutableURLRequest *)request | |
withOAuthParameters:(NSDictionary *)oAuthParameters | |
consumerSecret:(NSString *)consumerSecret | |
tokenSecret:(NSString *)tokenSecret | |
{ |
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
Embedding a Core Data model from a static library project | |
In one of my project, I want to share a Core Data model between 2 projects. I have a common static library project where the model and classes are defined. | |
SITUATION | |
a common project that builds a static library which contains my Core Data model (to be shared with an iOS and an OSX project) | |
my main iOS project | |
PROBLEM | |
static library cannot include resources | |
how can I give make my main project use the Core Data model ? | |
SOLUTION |
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 "NSString+Utils.h" | |
@implementation NSString (Utils) | |
- (NSString *)translateVanityPhoneNumber | |
{ | |
NSMutableString *resultString = [NSMutableString stringWithCapacity:self.length]; | |
NSScanner *scanner = [NSScanner scannerWithString:[self uppercaseString]]; | |
NSCharacterSet *set = [NSCharacterSet letterCharacterSet]; | |
while ([scanner isAtEnd] == NO) { |
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
################################ | |
### UIButton+BPBadgeButton.h ### | |
################################ | |
#import <UIKit/UIKit.h> | |
@interface UIButton (BPBadgeButton) | |
@property (nonatomic) NSUInteger badge; | |
@end |
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
on: Edit Scheme >> Test >> Post-action >> Run Script | |
script: | |
open -a coverstory ${BUILT_PRODUCTS_DIR}/../../ |
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
-(NSString*)mimeTypeForExtension:(NSString*)ext | |
{ | |
NSAssert( ext, @"Extension cannot be nil" ); | |
NSString* mimeType = nil; | |
CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, | |
(CFStringRef)ext, NULL); | |
if( !UTI ) return nil; | |
CFStringRef registeredType = UTTypeCopyPreferredTagWithClass(UTI, kUTTagClassMIMEType); |