- (void)viewDidLoad
{
[super viewDidLoad];
@weakify(self);
// Add a gesture recognizer to a view
UITapGestureRecognizer *tap = [UITapGestureRecognizer new];
[tap.rac_gestureSignal subscribeNext:^(id x) {
@strongify(self);
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
// Just copy the fllowing code into a .m file, and include the XAspect to you project. | |
// Then you'll see console log messages when objects of specific classes were deallocated. | |
// The block `AspectPatch(-, void, dealloc)` will be invoked just before `-dealloc` aka 'before advise'. | |
// Using XAspect | |
#import <XAspect/XAspect.h> | |
// Headers for classes you want to track | |
#import <CMDPUserLogin/UAMLoginViewController.h> | |
#import <CMDPUserLogin/UAMLoginTableViewController.h> |
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
// Release under MIT | |
// Copyright (C) 2015 Xaree Lee | |
#import <Foundation/Foundation.h> | |
/* Get property name for the class (C string or NSSting). */ | |
#define keypathForClass(Klass, PropertyName) \ | |
(((void)(NO && ((void)[Klass _nullObjectForCheckingPropertyName].PropertyName, NO)), # PropertyName)) | |
#define keypathStringForClass(Klass, PropertyName) \ | |
@keypathForClass(Klass, PropertyName) |
參考並 fork saetia's gist 的工作安裝教學,更多內容可以參考 Awesome OSX
most of these require logout/restart to take effect
# Enable character repeat on keydown
Sublime 是個簡單,強大,跨平台的編輯器。這邊介紹開發 ReactNative 時的設置。
安裝 Package Controller (for Sublime)
A better async/reactive function design in JS (or any other languages) — the Universal Currying Callback (UCC) Design
For the principle "Don't call us, we'll call you", the modern function design uses callbacks, Promise, or monad/stream-based techniques (e.g. Rx) to let you subscribe the async results.
The following is a usual JS function implementation using the callback for async:
function register(username, password, email, callback) {
// processing async work
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
[tool.poetry] | |
name = "pythonpro" | |
version = "0.1.0" | |
description = "" | |
authors = ["Hello <[email protected]>"] | |
[tool.poetry.dependencies] | |
python = "^3.10" | |
[tool.poetry.dev-dependencies] |
OlderNewer