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
| loadSpecs = (paths...) -> | |
| # expand all spec paths to full cache busted file paths | |
| paths = for path in paths | |
| "spec/#{path}_spec.js?#{new Date().getTime()}" | |
| # Load the specs with head.js, and start a spec run 1 second after they load. | |
| head.js paths..., -> | |
| setTimeout -> | |
| jasmine.getEnv().addReporter(new jasmine.TrivialReporter()) | |
| jasmine.getEnv().execute() |
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 Package; | |
| var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { | |
| for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } | |
| function ctor() { this.constructor = child; } | |
| ctor.prototype = parent.prototype; | |
| child.prototype = new ctor; | |
| child.__super__ = parent.prototype; | |
| return child; | |
| }; | |
| Package = {}; |
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 Bar, Foo, bar; | |
| var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { | |
| for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } | |
| function ctor() { this.constructor = child; } | |
| ctor.prototype = parent.prototype; | |
| child.prototype = new ctor; | |
| child.__super__ = parent.prototype; | |
| return child; | |
| }; | |
| Foo = (function() { |
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::include = (otherClass) -> | |
| for name, method of otherClass:: | |
| this::[name] = method | |
| return | |
| class Bar | |
| b: -> console.log 'b' | |
| class Foo | |
| @include Bar |
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
| # Accurate Interval, guaranteed not to drift! | |
| # (Though each call can still be a few milliseconds late) | |
| window.accurateInterval = (time, fn) -> | |
| # This value is the next time the the timer should fire. | |
| nextAt = new Date().getTime() + time | |
| # Hold a reference to the timer ID so it can be canceled. | |
| timeout = null |
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
| class @A | |
| my_function: => alert 'my function!' | |
| A_Function_Alias: @::my_function | |
| usage_of_alias: => | |
| @A_Function_Alias() | |
| # some other code... |
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
| $ brew doctor | |
| Warning: gettext was detected in your PREFIX. | |
| The gettext provided by Homebrew is "keg-only", meaning it does not | |
| get linked into your PREFIX by default. | |
| If you `brew link gettext` then a large number of brews that don't | |
| otherwise have a `depends_on 'gettext'` will pick up gettext anyway | |
| during the `./configure` step. |
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
| ->{a = 123} == ->{b = 123} #=> true | |
| a = :a | |
| b = :b | |
| ->{a = 123} == ->{b = 123} #=> 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
| { | |
| "beats": [ | |
| { | |
| "start": 0.06643, | |
| "duration": 0.467, | |
| "confidence": 0.83 | |
| }, | |
| { "more": "beat data..." } | |
| ], | |
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
| # The Constructor/Class that is your layer needs | |
| # to be assigned to module.exports in node.js style. | |
| module.exports = class Example extends Echotron.Echo | |
| # Setup up the layer. Called for you when the | |
| # layer is created. | |
| initialize: -> | |
| # Make a mesh that is a simple cube. | |
| @mesh = new THREE.Mesh( |