This file contains hidden or 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
| AVAudioSession* session = [AVAudioSession sharedInstance]; | |
| if ([session respondsToSelector:@selector(requestRecordPermission:)]) { | |
| [session performSelector:@selector(requestRecordPermission:) withObject:^(BOOL granted) { | |
| if (granted) { | |
| // Microphone enabled code | |
| NSLog(@"Microphone is enabled.."); | |
| dispatch_async(dispatch_get_main_queue(), ^{ | |
| if (!self.recordBtn.selected) { |
This file contains hidden or 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
| public override class func initialize() { | |
| struct Static { | |
| static var token: dispatch_once_t = 0 | |
| } | |
| if self !== RCChatListViewController.self { | |
| return | |
| } | |
This file contains hidden or 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
| public override class func initialize() { | |
| struct Static { | |
| static var token: dispatch_once_t = 0 | |
| } | |
| if self !== RCChatListViewController.self { | |
| return | |
| } | |
This file contains hidden or 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 Foundation | |
| public struct RAC { | |
| var target: NSObject | |
| var keyPath: String | |
| var nilValue: AnyObject? | |
| public init(_ target: NSObject, _ keyPath: String, nilValue: AnyObject? = nil) { |
This file contains hidden or 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
| // 迭代 | |
| function fib(n) { | |
| function fib-iter(i,n_1, n_2, n) { | |
| if 0 == n { | |
| return 0 | |
| } | |
| if 1 == n { | |
| return 1 | |
| } | |
| if i == n { |
This file contains hidden or 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
| p2p下载, | |
| 你只能向你的朋友借流量, | |
| 你可以查看你向谁借了多少流量, | |
| 你借给谁多少流量, | |
| 你的朋友可能为了你向他的朋友借流量, | |
| 当你要下载时, | |
| 你会向你的朋友借流量, | |
| 你的朋友查看本地是否有这个文件, | |
| 没有的话, | |
| 他可以帮你下载一部分文件, |
This file contains hidden or 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
| #!/bin/sh | |
| # | |
| # git autodeploy script when it matches the string "[deploy]" | |
| # | |
| # @author icyleaf <icyleaf.cn@gmail.com> | |
| # @link http://icyleaf.com | |
| # @version 0.1 | |
| # | |
| # Usage: | |
| # 1. put this into the post-receive hook file itself below |
This file contains hidden or 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
| "use strict"; | |
| var koa = require('koa'); | |
| var app = koa(); | |
| var bodyParser = require('koa-bodyparser'); | |
| var fs = require('fs'); | |
| app.use(bodyParser()); |
This file contains hidden or 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
| ;#lang planet neil/sicp | |
| #lang racket | |
| (require (planet soegaard/sicp:2:1/sicp)) | |
| (define wave einstein) | |
| (define (list-tree elements) | |
| (car (partial-tree elements (length elements)))) | |
| (define (partial-tree elts n) | |
| (if (= n 0) |
This file contains hidden or 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
| ;#lang planet neil/sicp | |
| #lang racket | |
| (require (planet soegaard/sicp:2:1/sicp)) | |
| (define wave einstein) | |
| (define (union-set set1 set2) | |
| (define (union-list l1 l2) | |
| (cond ((null? l1) l2) | |
| ((null? l2) l1) |