Skip to content

Instantly share code, notes, and snippets.

View AlexJWayne's full-sized avatar
🌈

Alex Wayne AlexJWayne

🌈
View GitHub Profile
@AlexJWayne
AlexJWayne / brew config
Last active December 12, 2015 08:08
OpenSSL fails to build on 10.8.2
» brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 935f12ed6d6d4075a72cb6b973ad29c1884225ad
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.8.2-x86_64
Xcode: 4.6
CLT: 4.6.0.0.1.1358221012
@AlexJWayne
AlexJWayne / input.coffeeson
Last active December 12, 2015 02:28
Example cofeeson conversion
pre: 123
a:
b:
c: '456'
d: [
7
8
e:
f: 'g'
]
@AlexJWayne
AlexJWayne / main.coffee
Last active December 12, 2015 02:28
Example of a very simple Echotron layer
# 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(
@AlexJWayne
AlexJWayne / echnest-analyze.json
Last active December 12, 2015 02:28
Sample output of Echonest Analyze API.
{
"beats": [
{
"start": 0.06643,
"duration": 0.467,
"confidence": 0.83
},
{ "more": "beat data..." }
],
->{a = 123} == ->{b = 123} #=> true
a = :a
b = :b
->{a = 123} == ->{b = 123} #=> false
$ 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.
class @A
my_function: => alert 'my function!'
A_Function_Alias: @::my_function
usage_of_alias: =>
@A_Function_Alias()
# some other code...
@AlexJWayne
AlexJWayne / accurate_interval.coffee
Created December 4, 2011 20:30
accurateInterval() is a dop in replacement for setInterval() that does not drift over long periods of time.
# 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
Function::include = (otherClass) ->
for name, method of otherClass::
this::[name] = method
return
class Bar
b: -> console.log 'b'
class Foo
@include Bar
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() {