Skip to content

Instantly share code, notes, and snippets.

View weekwood's full-sized avatar
๐ŸŽฏ
Focusing

Di Wu weekwood

๐ŸŽฏ
Focusing
View GitHub Profile
{
"type": "success",
"data": {
"id": "3cdcd5b0-d1b9-11e7-aeee-07c46f347778",
"plate": "ๆต™H19800",
"plate_type": null,
"brand": null,
"category": null,
"model": "H02",
"province": null,
extension UIView {
@discardableResult
func fromNib<T : UIView>() -> T? {
guard let view = Bundle.main.loadNibNamed(String(describing: type(of: self)), owner: self, options: nil)?[0] as? T else {
return nil
}
return view
}
}
//
// NSURL+YZThumbnail.m
// YuanZi
//
// Created by di wu on 5/4/15.
// Copyright (c) 2015 Yuanzi. All rights reserved.
//
#import "NSURL+YZThumbnail.h"
{
"createdAt": "2015-06-16T09:10:40.274Z",
"readStatus": false,
"noticeType": "systemNotice",//็ณป็ปŸๆถˆๆฏ
"system": [//็ณป็ปŸๆถˆๆฏ
{
"noticeMaster": {
"nickname": "admin",
"baby": {
"gender": "n",
{
data={
cards=({
"_id"=549f70766b0760c934a07df2;"comment_count"=2;cover="http://img.iyuanzi.net/cardCover/2014-12/b23ebe43-27b1-4941-8838-aa2ce9691d34";"create_at"="1\U4e2a\U6708\U524d";description="";"favorite_count"=4;id=549f70766b0760c934a07df2;index=0;isFavorited=0;isPraised=0;isTop=1;owner={
"_id"=549d1d2e566d41e412eef816;avatar="http://img.iyuanzi.net/userAvatar/2014-12/d5cb4c03-10ff-45d2-adbd-5871e724898e";id=549d1d2e566d41e412eef816;"nick_name"="\U852c\U83dc\U5988\U5988";
};"praise_count"=10;"shared_count"=4;title="\U7ed9\U7238\U7238\U7684\U543b";"update_at"="16\U5929\U524d";
},
{
"_id"=549f70736b0760c934a07dec;"comment_count"=4;cover="http://img.iyuanzi.net/cardCover/2014-12/8657281e-978f-470f-92c0-7f7a8ab926fb";"create_at"="1\U4e2a\U6708\U524d";description="";"favorite_count"=2;id=549f70736b0760c934a07dec;index=0;isFavorited=0;isPraised=0;isTop=1;owner={
"_id"=549d1d2e566d41e412eef816;avatar="http://img.iyuanzi.net/userAvatar/2014-12/d5cb4c03-10ff-45d2-adbd-5871e724898e";id=
static NSDictionary *titleMapping = nil;
if (!titleMapping) {
NSString *(^const format)(NSUInteger, NSString *, NSString *) = ^(NSUInteger value, NSString *singular, NSString *plural) {
return [NSString stringWithFormat:@"%d %@", value, (value == 1 ? singular : plural)];
};
titleMapping = @{
@"Scratches" : ^(MyClass *target) {
return format([target numberOfScratches], @"Scratch", @"Scratches");
},
_MimeTypes = @{
@"text/plain": @{ @"icon": @"txt-big", @"ext" : @[@"txt", @"text", @"conf", @"def", @"log", @"list", @"ini"] },
@"text/css": @{ @"icon": @"css-big", @"ext" : @[@"css"] },
@"text/javascript": @{ @"icon": @"js-big", @"ext" : @[@"js"] },
@"text/html": @{ @"icon": @"ie-big", @"ext" : @[@"html", @"htm"] },
@"text/xml": @{ @"icon": @"xml-big", @"ext" : @[@"xml", @"xsl", @"xslt"] },
@"text/csv": @{ @"icon": @"csv-big", @"ext" : @[@"csv"] },
@"text/x-vcard": @{ @"icon": @"vcf-big", @"ext" : @[@"vcf"] },
@"text/calendar":
@weekwood
weekwood / thumbnail.m
Last active August 29, 2015 14:09
AVURLAsset Thumbnail
AVURLAsset *asset1 = [[AVURLAsset alloc] initWithURL:[info objectForKey:@"UIImagePickerControllerMediaURL"] options:nil];
AVAssetImageGenerator *generate1 = [[AVAssetImageGenerator alloc] initWithAsset:asset1];
generate1.appliesPreferredTrackTransform = YES;
NSError *err = NULL;
CMTime time = CMTimeMake(1, 2);
CGImageRef oneRef = [generate1 copyCGImageAtTime:time actualTime:NULL error:&err];
UIImage *one = [[UIImage alloc] initWithCGImage:oneRef];
NSMutableArray *resultArray = [NSMutableArray new];
NSArray *groups = [self.survey.questions valueForKeyPath:@"@distinctUnionOfObjects.type"];
for (NSString *groupId in groups)
{
NSMutableDictionary *entry = [NSMutableDictionary new];
[entry setObject:groupId forKey:@"type"];
NSArray *groupNames = [self.survey.questions filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"type = %@", groupId]];
[entry setObject:groupNames forKey:@"values"];
{ "channel" : 1,
"content" : "์šฐ๋ฆฌ ์ฃผ๋ณ€์˜ ๋‹ค์–‘ํ•œ ์‚ฌ๋žŒ๋“ค์˜ ์‚ถ์„ ์ง„์†”ํ•˜๊ฒŒ ๋ณด์—ฌ์ฃผ๋Š” ๋‹คํ๋ฉ˜ํ„ฐ๋ฆฌ๋กœ 2001๋…„ 2์›” 13์ผ์— ์ฒซ ๋ฐฉ์†ก์„ ์‹œ์ž‘ํ•ด์„œ ์›”์š”์ผ๋ถ€ํ„ฐ ๊ธˆ์š”์ผ๊นŒ์ง€ ๋งค์ผ ๋ฐฉ์†ก์„ ํ•˜๊ณ  ์žˆ๋Š” ์žฅ์ˆ˜ ํ”„๋กœ๊ทธ๋žจ์ด๋‹ค. ๋‹ค์–‘ํ•œ ์‚ฌ๋žŒ๋“ค์˜ ๋งค์šฐ ์ง„์†”ํ•œ ๋ชจ์Šต์„ ๋‹ด์•„๋‚ด๋Š” ๊ฒƒ์ด ํŠน์ง•์ด๋‹ค. ใ€Š์ธ๊ฐ„๊ทน์žฅใ€‹์€ ๋งค์ฃผ ์›” ~ ๊ธˆ ์•„์นจ 7์‹œ 50๋ถ„์—์„œ 8์‹œ 25๋ถ„๊นŒ์ง€ KBS ์ œ1TV์—์„œ ๋ฐฉ์†ก๋˜๊ณ  ์žˆ๋Š” ํ…”๋ ˆ๋น„์ „ ํ”„๋กœ๊ทธ๋žจ์ด๋‹ค. 2000๋…„ 5์›” 1์ผ์— ๋ฐฉ์†ก์„ ์‹œ์ž‘ํ•˜์—ฌ ํ˜„์žฌ๊นŒ์ง€ ๋ฐฉ์†ก๋˜๊ณ  ์žˆ๋‹ค.",
"cover_img" : "http://tv1009.anydev.net/uploads/tv_info/2013072410074133367.jpg",
"create_time" : "2013-07-17 18:53:56",
"hit" : 2040,
"hour_minute" : 28200,
"id" : 472,
"is_over" : 0,
"last_term" : "20140327",
"last_update" : 1395923383,