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
-(void)listAllClassMethods | |
{ | |
// Iterate over the class and all superclasses | |
Class currentClass = [self class]; | |
while (currentClass) { | |
// Iterate over all instance methods for this class | |
unsigned int methodCount; | |
Method *methodList = class_copyMethodList(currentClass, &methodCount); | |
unsigned int i = 0; | |
for (; i < methodCount; i++) { |
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
Add to your Podfile: | |
platform :ios | |
# ignore all warnings from all pods | |
inhibit_all_warnings! | |
# ignore warnings from a specific pod |
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 <BILib.h> | |
#import <objc/runtime.h> | |
// customClass.m | |
// under @implementation | |
//override | |
+(void)load | |
{ | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ |
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
#include <iostream> | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
using namespace std; | |
#define ARRAY_SIZE(A) sizeof(A)/sizeof(A[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 java.util.ArrayList; | |
public class SearchMe { | |
static int[] intArrayA = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}; | |
static int[] intArrayB = {3,4,9,14}; | |
public static void main (String[] args) throws java.lang.Exception |
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
// Constants | |
#define APP_VERSION [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] | |
#define APP_NAME [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"] | |
#define APP_DELEGATE [[UIApplication sharedApplication] delegate] | |
#define USER_DEFAULTS [NSUserDefaults standardUserDefaults] | |
#define APPLICATION [UIApplication sharedApplication] | |
#define BUNDLE [NSBundle mainBundle] | |
#define MAIN_SCREEN [UIScreen mainScreen] | |
#define DOCUMENTS_DIR [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject] |
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
// Option 1: In ViewController, set the cell instance to have accessibility. | |
Cell *cell = [cv dequeueReusableCellWithReuseIdentifier:kCellID forIndexPath:indexPath]; | |
[cell setIsAccessibilityElement:YES]; | |
// Option 2: Implement the accessibility interface in the cell object: | |
// implementation file of Cusome CollectionViewCell | |
- (BOOL)isAccessibilityElement | |
{ | |
return YES; | |
} |
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
/* | |
You have to hijack the scrollView (Add yourself as a ScrollViewDelegate alongside TableViewDelegate) | |
and the table view will automatically forward scrollview events along side tableview events. | |
(self.tableView.delegate = self) is really talking to both | |
<UIScrollViewDelegate, UITableViewDelegate> | |
I have a helper function in the example that also calculates distance to the top of the cell. | |
*/ |
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
package controllers; | |
import play.mvc.*; | |
import com.google.gson.*; | |
import models.*; | |
public class Application extends Controller { |