This file contains 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
FROM node:12-slim | |
WORKDIR /usr/src/app | |
COPY package.json package*.json ./ | |
RUN npm install only=production | |
copy . . | |
CMD ["npm", "start"] |
This file contains 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
const rateOf = rate => amount => amount * rate | |
const forInterval = (min, max) => amount => Math.max(Math.min(max || amount, amount) - min, 0) | |
const taxBracket = (rate, interval) => amount => rate(interval(amount)) | |
const taxCollect = (amount) => (sum, tax) => sum + tax(amount); | |
const netAmountOf = tax => amount => amount - tax(amount) | |
const taxApply = (amount, tax) => tax(amount) | |
const bracket0 = taxBracket(rateOf(0), forInterval(0, 9807)) | |
const bracket14 = taxBracket(rateOf(0.14), forInterval(9807, 27086)) | |
const bracket30 = taxBracket(rateOf(0.30), forInterval(27086, 72617)) |
This file contains 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
[color] | |
ui = true | |
[core] | |
autocrlf = input | |
safecrlf = true | |
[alias] | |
co = checkout | |
ci = commit | |
st = status -s | |
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short |
This file contains 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
const {compose, pipe, map, sum, curry} = require('ramda'); | |
const rateOf = curry((rate, amount) => amount * rate) | |
const forInterval = (min, max) => amount => Math.max(Math.min(max || amount, amount) - min, 0) | |
const taxApply = amount => tax => tax(amount) | |
const tax = taxBrackets => amount => compose(sum, map)(taxApply(amount), taxBrackets) | |
const netAmountOf = curry((tax, amount) => amount - tax(amount)) | |
const taxCollect = amount => (sum, tax) => sum + tax(amount) // deprecated | |
const taxBracket = (rate, min, max) => compose(rateOf(rate), forInterval(min, max)) // deprecated |
This file contains 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
/** convert Degrees Minutes Seconds to Decimal Degrees*/ | |
function convertDMStoDd (deg, min, sec, ref) { | |
let mm = min + sec/60 | |
dd = mm/60; | |
let C = ref === 'S' || ref === 'W' ? -1 : 1; | |
return C * (deg + dd).toFixed(7); | |
} | |
/** convert latitude/longitude DMS coord to Decimal degrees*/ | |
function convertLatLngDMStoDd(lat, lng) { |