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
| // Fix iOS Audio Context by Blake Kus https://gist.github.com/kus/3f01d60569eeadefe3a1 | |
| // MIT license | |
| (function() { | |
| window.AudioContext = window.AudioContext || window.webkitAudioContext; | |
| if (window.AudioContext) { | |
| window.audioContext = new window.AudioContext(); | |
| } | |
| var fixAudioContext = function (e) { | |
| if (window.audioContext) { | |
| // Create empty buffer |
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
| var ctx = null, usingWebAudio = true; | |
| try { | |
| if (typeof AudioContext !== 'undefined') { | |
| ctx = new AudioContext(); | |
| } else if (typeof webkitAudioContext !== 'undefined') { | |
| ctx = new webkitAudioContext(); | |
| } else { | |
| usingWebAudio = false; | |
| } |
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
| 如何把一个字符串,用特定的符号有序的连接,列出所有连接可能。 | |
| 如:'ab' -> a-b, | |
| 'abc' -> a-bc, a-b-c, ab-c, | |
| 'abcd' -> a-bcd, ab-cd, abc-d,a-b-cd, ab-c-d,a-bc-d,a-b-c-d | |
| PS: | |
| 1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
| ```javascript | |
| // you code | |
| ``` |