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
/* | |
assuming a rather standard requirejs script tag referring to main(.js) | |
<script type="text/javascript" data-main="main" src="js/require.min.js"></script> | |
*/ | |
var w = newRequireWorker({ | |
shim: { three: { exports: 'THREE' } }, | |
baseUrl: 'js', | |
paths: { three: 'three.min' } | |
}, |
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
request.onload = function () { | |
context.decodeAudioData(request.response, function (buf) { | |
// store as forward buffer | |
buffer = buf; | |
// create a reversed copy | |
bufferReversed = context.createBuffer(buf.numberOfChannels, buf.length, buf.sampleRate); | |
for (var i = 0; i < buf.numberOfChannels; i++) | |
bufferReversed.getChannelData(i).set( | |
Array.prototype.reverse.call(new Float32Array(buf.getChannelData(i))) | |
); |
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
<script type="text/x-handlebars" id="components/chat-input"> | |
{{input id="tiChatInput" action="chatInputEnter"}} | |
</script> | |
MyApp.ChatInputComponent = Ember.Component.extend({ | |
didInsertElement: function () { | |
var self = this, | |
ctx = this.$('input').keydown(function (event) { | |
if (event.which === 9) { | |
// [TAB] |
OlderNewer