Install brew and pip (sudo easy_install pip)
brew update
brew install homebrew/science/openblas
| #* | |
| Via <http://kennbrodhagen.net/2015/12/06/how-to-create-a-request-object-for-your-lambda-event-from-api-gateway/>. | |
| This mapping template formats most information that API Gateway receives, for easy use in a Lambda function (or whatever). | |
| Not sure why the same effect isn't achieved with the "Input passthrough" option! | |
| *# | |
| { | |
| "method": "$context.httpMethod", | |
| "body" : $input.json('$'), | |
| "headers": { | |
| #foreach($param in $input.params().header.keySet()) |
| loadSamples: (urls, callback) -> | |
| loaded = [] | |
| requests = [] | |
| decode = (_raw) => | |
| @audio.decodeAudioData _raw, (sample) -> | |
| loaded.push sample | |
| callback(loaded) if loaded.length is urls.length |
| if location.protocol is "http:" | |
| window.location = window.location.toString().replace("http:", "https:") |
Install brew and pip (sudo easy_install pip)
brew update
brew install homebrew/science/openblas
| .vcenter { | |
| display: inline-block; | |
| position: relative; | |
| top: 50%; | |
| transform: translateY(-50%); | |
| } |
| heroku plugins:install git://github.com/ddollar/heroku-config.git | |
| heroku config:pull --overwrite --interactive |
| # run these two commands: | |
| open http://localhost:8000/ | |
| python -m SimpleHTTPServer | |
| # I put the following in ~/.profile (OS X) so it runs every time I open a terminal window: | |
| alias phttp="open http://localhost:8000/; python -m SimpleHTTPServer" |
| # last element of array, | |
| # alternative to `my_array[my_array.length - 1]` | |
| # via http://stackoverflow.com/questions/9050345/selecting-last-element-in-javascript-array | |
| unless Array::last | |
| Array::last = -> | |
| this[@length - 1] |
| # pretty-print JSON | |
| # http://stackoverflow.com/questions/4810841/how-can-i-pretty-print-json-using-javascript | |
| ppjson = (obj) -> | |
| console.log JSON.stringify obj, undefined, 2 |
| #put this in your Gemfile: | |
| gem "rack-coffee" | |
| #(don't forget to run `bundle` on the command line) | |
| #put this in your Sinatra app: | |
| use Rack::Coffee, | |
| :root => 'public', | |
| :urls => '/coffee', | |
| :join => 'index', | |
| :bare => true |