Name | Pattern | Description | Example |
---|---|---|---|
Positive Lookahead | q(?=u) |
q followed by u |
q in absquatulate |
Negative Lookahead | q(?!u) |
q not followed by u |
q in qwerty |
Positive Lookbehind | (?<=q)u |
u preceded by q |
u in question |
Negative Lookbehind | `(? |
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
git clone --no-hardlinks OLD_FLDR NEW_FLDR | |
cd NEW_FLDR | |
git filter-branch --prune-empty --subdirectory-filter ‘FLDR_TO_KEEP’ master | |
git remote rm origin | |
git update-ref -d refs/original/refs/heads/master | |
git reflog expire --expire=now --all | |
git repack -ad | |
git reset --hard | |
git gc --aggressive --prune=now |
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
git filter-branch --index-filter 'git rm --cached --ignore-unmatch FILE' HEAD | |
git filter-branch --index-filter 'git rm -rf --cached --ignore-unmatch FLDR' HEAD |
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
#define SYNTHESIZE_SINGLETON_FOR_CLASS_WITH_CUSTOM_METHOD(className, methodName) \ | |
\ | |
+ (className *) methodName \ | |
{ \ | |
static className *shared ## className; \ | |
static dispatch_once_t token; \ | |
dispatch_once(&token, ^{ \ | |
shared ## className = [[className alloc] init]; \ | |
}); \ | |
\ |
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
// | |
// A2Casting.h | |
// | |
// Created by Alexsander Akers on 10/6/11. | |
// Copyright (c) 2011 Pandamonia LLC. All rights reserved. | |
// | |
// These are some basic macros for making down-casting safer in Objective C. | |
// They are loosely based on the same cast types with similar names in C++. | |
// A typical usage would look like this: |
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
for f in *; | |
do | |
echo "$f"; | |
if [ -d "$f" ]; | |
then | |
cd "$f"; | |
if [ -d ".git" ]; | |
then | |
git pull --all; | |
else |
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
// NB: Using undefined constants can not only make the indicator appear blank, | |
// but it can also run a slew of nasty NSLog statements about missing image files. | |
// That being said, the following constants are guaranteed to work on the | |
// latest builds of iOS 4 and iOS 5 as indicated by the pragma directive. | |
enum { | |
UIActivityIndicatorViewStyleWhiteSmall = 3, // small network activity indicator glyph | |
UIActivityIndicatorViewStyleGraySmall = 4 // same as '3' but white color on black status bar | |
#ifdef __IPHONE_5_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
// Don't forget to #import <objc/runtime.h> | |
void A2Swizzle(Class cls, SEL oldSel, SEL newSel, BOOL isClassMethod) | |
{ | |
if (isClassMethod) cls = object_getClass(cls); | |
Method origMethod = class_getInstanceMethod(cls, oldSel); | |
Method newMethod = class_getInstanceMethod(cls, newSel); | |
if (class_addMethod(cls, oldSel, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) | |
class_replaceMethod(cls, newSel, method_getImplementation(origMethod), method_getTypeEncoding(origMethod)); |
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
Pod::Spec.new do |s| | |
s.name = "ChimpKit2" | |
s.version = "0.1.1" | |
s.homepage = "https://github.com/mailchimp/ChimpKit2" | |
s.summary = "MailChimp API Wrapper with support for API 1.3." | |
s.license = 'MIT' | |
s.author = { "Amro Mousa" => "[email protected]" } | |
s.source = { :git => "https://github.com/mailchimp/ChimpKit2.git", :branch => "master" } | |
s.platform = :ios, '5.0' | |
s.source_files = 'Core/Classes/*.{h,m}' |
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 StoreKit; | |
@interface SKHandleInvalidReceiptRequest : SKRequest | |
- (void)_sendXPCMessage; | |
@end | |
extern void SKTerminateForInvalidReceipt(void); |
OlderNewer