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
// | |
// ViewController.m | |
// stackVIewtest | |
// | |
// | |
#import "ViewController.h" | |
@interface ViewController () | |
@property UILabel *titleLabel; |
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
#import <UIKit/UIKit.h> | |
@interface UITableView (Helper) | |
- (void)registerClass:(_Nonnull Class)cellClass; | |
- (void)registerClassList:(NSArray <Class> *_Nonnull)cellClassList; | |
- (__kindof UITableViewCell *_Nonnull)dequeueReusableCellWithClass:(_Nonnull Class)cellClass forIndexPath:(NSIndexPath *_Nonnull)indexPath; | |
@end |
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
{ | |
"greeting": "Hello!", | |
"message": "Tap on the buttons below to switch languages", | |
"glory": "Glory Glory, %name%!", | |
"mustache": "mustache", | |
"lovely-mustache": "What a wonderful {{mustache}} you have!" | |
} |
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
{ | |
"en": { | |
"greeting": "Hello!", | |
"message": "Tap on the buttons below to switch languages", | |
"glory": "Glory Glory, %name%!", | |
"mustache": "mustache", | |
"lovely-mustache": "What a wonderful {{mustache}} you have!" | |
}, | |
"ru": { | |
"greeting": "Привет!", |
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
{ | |
"dev" : { | |
"translation" : { | |
"key" : "value dev" | |
} | |
}, | |
"en" : { | |
"translation" : { | |
"key" : "value en" | |
} |
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
[{"id": 1, "title": "Al Gore On Averting Climate Crisis", "url": "http://www.ted.com/talks/al_gore_on_averting_climate_crisis"}, | |
{"id": 10, "title": "Dean Ornish On The World S Killer Diet", "url": "http://www.ted.com/talks/dean_ornish_on_the_world_s_killer_diet"}, | |
{"id": 1000, "title": "Gero Miesenboeck", "url": "http://www.ted.com/talks/gero_miesenboeck"}, | |
{"id": 1001, "title": "Andrew Bird S One Man Orchestra Of The Imagination", "url": "http://www.ted.com/talks/andrew_bird_s_one_man_orchestra_of_the_imagination"}, | |
{"id": 1002, "title": "Emily Pilloton Teaching Design For Change", "url": "http://www.ted.com/talks/emily_pilloton_teaching_design_for_change"}, | |
{"id": 1003, "title": "Stefan Wolff The Path To Ending Ethnic Conflicts", "url": "http://www.ted.com/talks/stefan_wolff_the_path_to_ending_ethnic_conflicts"}, | |
{"id": 1004, "title": "Aaron Huey", "url": "http://www.ted.com/talks/aaron_huey"}, | |
{"id": 1005, "title": "Auret Van Heerden Making Global Labor Fair", "url": "http://www.ted.com/talks/auret_van_he |
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
// | |
// ViewController.m | |
// scrollveiwtes | |
// | |
// Created by willard on 2017/5/9. | |
// Copyright © 2017年 willard. All rights reserved. | |
// | |
#import "ViewController.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
// source : https://github.com/TerryCK/Protocol-Oriented-Programming | |
extension Collection where Iterator.Element == Int { | |
func countOddEven() -> (odd: Int, even: Int) { | |
return self.reduce((0, 0)) { (tuple, number) -> (odd: Int, even: Int) in | |
return (number % 2 == 0) ? | |
(tuple.0, tuple.1 + 1) : | |
(tuple.0 + 1,tuple.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
// | |
// ViewController.m | |
// GifEncoderTest | |
// | |
// Created by willard on 2017/10/18. | |
// Copyright © 2017年 willard. All rights reserved. | |
// | |
#import "ViewController.h" | |
#import <Photos/Photos.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
const WebSocket = require('ws'); | |
const wss = new WebSocket.Server({ port: 8080 }); | |
wss.on('connection', function connection(ws) { | |
ws.on('message', function incoming(data) { | |
console.log("reveice : " + data) |
OlderNewer