Install XCode commandline tools
$ ./install_dev_tools.sh
Install homebrew
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install XCode commandline tools
$ ./install_dev_tools.sh
Install homebrew
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
'use strict'; | |
console.log('Loading tax calculator function...'); | |
exports.handler = (event, context, callback) => { | |
console.log('Received event: ', JSON.stringify(event, null, 2)); | |
try { | |
let productPrice, taxRate, surchargeRate = null; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.concurrent.ConcurrentMap; | |
import java.util.concurrent.locks.Lock; | |
/** | |
* Striped lock impl for when proper concurrency libs (like guava) can't be used, either due to | |
* dependency issues or other reasons. | |
* | |
* Returns (creates if not exists) a unique Lock for a given K |
# if there are attachments... | |
if @email.attachments.present? | |
# ...loop over each one... | |
@email.attachments.each do |attachment| | |
# ... and upload to storage provider | |
response = storage.put_object($BUCKET_NAME, # S3 bucket | |
attachment.original_filename, # filename | |
attachment, # the ActionDispatch::Http::UploadedFile object returned by Griddler | |
$OPTIONS # things like Content-Type headers, S3 acl go here |
gem 'griddler' | |
gem 'griddler-mandrill' |
config.action_controller.asset_host = 'https://YOURKEY.cloudfront.net' |
# I don't want to manually start everything I need... so | |
# | |
# Two web processes | |
# | |
web1: bundle exec unicorn -p $PORT -c ./config/unicorn.rb | |
web2: bundle exec unicorn -p $PORT -c ./config/unicorn.rb | |
# | |
# Workers |