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
$("a[href*='magnet']").map(function() {return this.href}).get().join("\n") |
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
@interface ViewController () | |
@property (strong, nonatomic) UIScrollView* vScrollView; | |
@end | |
@implementation ViewController | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
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
<script> | |
/*! | |
*** prettyPre ***/ | |
(function( $ ) { | |
$.fn.prettyPre = function( method ) { | |
var defaults = { | |
ignoreExpression: /\s/ // what should be ignored? |
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
[\x{4e00}-\x{9fa5}] // used for match Chinese character | 用来匹配中文 |
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
UIImage *image = [UIImage imageNamed:@"name.png"]; | |
view.layer.contents = (id) image.CGImage; | |
// 如果需要背景透明加上下面这句 | |
view.layer.backgroundColor = [UIColor clearColor].CGColor; |
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
//| ---------------------------------------------------------------------------- | |
// Called when the view is about to be displayed. May be called more than | |
// once. | |
// | |
- (void)willMoveToWindow:(UIWindow *)newWindow { | |
// Use the layer shadow to draw a one pixel hairline under this view. | |
[self.layer setShadowOffset:CGSizeMake(0, 1.0f/UIScreen.mainScreen.scale)]; | |
[self.layer setShadowRadius:0]; | |
// UINavigationBar's hairline is adaptive, its properties change with |
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
// test code that generate the error | |
for (int i = 0; i < 1000; i++) { | |
NSDate *date= [NSDate date]; | |
NSString *queueName = [NSString stringWithFormat:@"queue%i", i]; | |
dispatch_queue_t testqueue = dispatch_queue_create([queueName cStringUsingEncoding:NSUTF8StringEncoding], NULL); | |
dispatch_async(testqueue, ^{ | |
NSDateFormatter *ndf = [BXAppDelegate dateFormatter]; | |
DDLogInfo(@"%@", [ndf stringFromDate:date]); | |
}); | |
} |
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
// pls check http://t.cn/z8ncg24 | |
[CATransaction begin]; | |
[CATransaction setCompletionBlock:^{ | |
[weakself.tableView reloadData]; | |
}]; | |
[weakself.tableView beginUpdates]; | |
[weakself.tableView deleteSections:indexSet withRowAnimation:UITableViewRowAnimationFade]; | |
[weakself.tableView endUpdates]; | |
[CATransaction commit]; |
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
NSArray *images = @[@"http://example.com/image1.png", | |
@"http://example.com/image2.png", | |
@"http://example.com/image3.png", | |
@"http://example.com/image4.png"]; | |
dispatch_queue_t imageQueue = dispatch_queue_create("Image Queue",NULL); | |
for (NSString *urlString in images) { | |
dispatch_async(imageQueue, ^{ | |
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
// | |
// SpacemanBlocks.h | |
// | |
// Created by Jerry Jones on 12/11/11. | |
// Copyright (c) 2011 Spaceman Labs. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
typedef void(^SMDelayedBlockHandle)(BOOL cancel); |
NewerOlder