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
// Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
// Copyright (c) 2013 Peter Steinberger. All rights reserved. | |
// Licensed under MIT (http://opensource.org/licenses/MIT) | |
// | |
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
#import <objc/runtime.h> | |
#import <objc/message.h> | |
// Compile-time selector checks. |
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
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/c_cpp");</script> | |
<!-- | |
For other language: Instead of `ace/mode/ruby`, Use | |
Python -> `ace/mode/python` | |
C/C++ -> `ace/mode/c_cpp` | |
Javscript -> `ace/mode/javascript` | |
Java -> `ace/mode/java` |
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
//打开数据库 | |
$mysql -h localhost -u leros -p密码 | |
//连接数据库表 | |
mysql> connect statusnet | |
//根据条件查看数据值 | |
mysql> select value from config where section="site" and setting="path"; | |
//根据条件设置新值 |
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
创建前先设定tableview的rowHeight,然后旋转。 | |
每个row的高度即为旋转后的宽度。然后在cellWillDisplay里旋转一下cell就可以了。 | |
- (UITableView *)payTableView { | |
if(!_payTableView){ | |
_payTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 320) style:UITableViewStylePlain]; | |
_payTableView.backgroundColor = [UIColor clearColor]; | |
_payTableView.separatorStyle = UITableViewCellSeparatorStyleNone; | |
_payTableView.showsVerticalScrollIndicator = NO; | |
_payTableView.delegate = 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
大意是说,在 ARC 中,一般outlet属性都推荐使用 weak,应该使用 strong 的 outlet 是 File's Owner连接到 nib 的顶层对象。 | |
顺便提一下ARC其他属性的规则: | |
strong:等同于"retain",属性成为对象的拥有者 | |
weak:属性是 weak pointer,当对象释放时会自动设置为 nil | |
unsafe_unretained:等同于之前的"assign",只有 iOS 4 才应该使用 | |
copy:和之前的 copy 一样,复制一个对象并创建 strong 关联 | |
assign:对象不能使用 assign,但原始类型(BOOL、int、float)仍然可以使用 | |
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
查看所有省 | |
select * from Province; | |
根据省ID查看此省的所有城市 | |
select * from City where ProID="610000"; | |
根据城市ID查看此市所有区 | |
select * from Zone where CityID="610100"; | |
给Zone表插入一个新区,顺序一直按照着表的数据列来。 |
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
装上这个faience-themes | |
还有 gnome-shell-theme-mixtured | |
lerosux: 你装好这2个主题, 删掉你的 .local/share/gnome-shell/extensions | |
再把 /etc/.skel/.config/user-first-run.sh 复制过来, 执行一下 |
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
设置xcode使用环境 | |
export DEVELOPER_DIR="/Applications/XCode.app/Contents/Developer" | |
查看当前xcode环境 | |
xcode-select --print-path | |
~/Documents/work/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash -o output.txt me.crash YinBa.app.dSYM | |
~/Documents/work/Xcode.app/Contents/Developer/usr/bin/atos -arch armv7s -o 'YinBa.app'/'YinBa' $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
[UIView transitionWithView:self.buttonA duration:0.4f options:UIViewAnimationOptionTransitionCrossDissolve animations:^{ | |
[self.buttonA setBackgroundImage:image forState:UIControlStateNormal]; | |
}completion:NULL]; |