Skip to content

Instantly share code, notes, and snippets.

@wangchao0802
wangchao0802 / 0_reuse_code.js
Created December 24, 2015 06:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@wangchao0802
wangchao0802 / GEM
Created December 24, 2015 14:29
GEM 国内使用
https://ruby.taobao.org/
如何使用?
$ gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
$ gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org
请确保只有 ruby.taobao.org
$ gem install rails
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[TestFlight setDeviceIdentifier:[[UIDevice currentDevice] uniqueIdentifier]];
#pragma clang diagnostic pop
@wangchao0802
wangchao0802 / UICollectionView
Created December 28, 2015 03:48
UICollectionView
-(UICollectionView *) cateCollectionView
{
if (!_cateCollectionView) {
UICollectionViewFlowLayout *flowLayout = [UICollectionViewFlowLayout new];
flowLayout.itemSize = CGSizeMake(itemWidth, self.height);
flowLayout.minimumLineSpacing = interitemSpacing; //水平方向横竖参数相反
flowLayout.sectionInset = UIEdgeInsetsMake(0,horizontalPadding, 0.0,horizontalPadding);
[flowLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal];
_cateCollectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0.0, 0.0, SCREEN_WIDTH, self.height) collectionViewLayout:flowLayout];
@wangchao0802
wangchao0802 / TableView
Last active January 1, 2016 08:22
tableview
#pragma mark - UITableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [self.tabModel.listArray count];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSObject<FinderCellModelProtocol>* model = self.tabModel.listArray[indexPath.row];