This file contains hidden or 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
// http://stackoverflow.com/a/21806997/893945 | |
@interface MyViewController : UIViewController <UIScrollViewDelegate> | |
@end | |
@implementation MyViewController | |
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView | |
{ | |
if([scrollView.panGestureRecognizer translationInView:scrollView.superview].y < 0) { | |
// up |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
string_finder.py | |
- it searches non-localzed points in Objective-C code: | |
-- searches string literal that contains non "visible ascii(0x20~0x7F)" | |
- it only searches .m files | |
How to use: |
This file contains hidden or 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 <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
@interface DictionaryConvertable : NSObject | |
- (NSDictionary *)toDictionary; | |
@end | |
// ---------- |
This file contains hidden or 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
# http://stackoverflow.com/questions/17371150/moving-git-repository-content-to-another-repository-preserving-history | |
git clone NEW_REPO | |
cd NEW_REPO | |
git checkout master | |
git remote add old_git_remote OLD_REPO | |
git fetch old_git_remote | |
git merge old_git_remote/master | |
git remote rm old_git_remote |
This file contains hidden or 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
LOCAL_PATH := $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_MODULE := SampleCode | |
LOCAL_SRC_FILES := package_name_ToasterSample.cpp | |
include $(BUILD_SHARED_LIBRARY) |
This file contains hidden or 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 CallBackExample::getMyProfileAsync(MyProfileCallback *pfn) | |
{ | |
Profile profile; | |
(*pfn)(&profile); | |
} |
This file contains hidden or 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
// [self.tableView eachIndexPath^(NSIndexPath *indexpath) { ... }]; | |
@interface UITableView (Traverse) | |
typedef void (^iter)(NSIndexPath *indexPath); | |
- (void)eachIndexPath:(iter)iterBlock; | |
@end | |
@implementation UITableView (Traverse) |
This file contains hidden or 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
// | |
// UIView+SubView.h | |
// | |
// Created by moda | |
// Copyright (c) 2012년 moda. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIView (SubView) |
This file contains hidden or 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; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int n = 5; |