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
async function getExchangeRate(pair, start, end) { | |
return { | |
Satang: await getSatangExchangeRate(pair, start, end), | |
Bitkub: await getBitkubExchangeRate(pair, start, end) | |
} | |
} | |
async function getSatangExchangeRate(pair, start, end) { | |
start = start.getTime() - 86399999; | |
end = end.getTime() + 86400000; |
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
{ | |
"type": "bubble", | |
"size": "giga", | |
"body": { | |
"type": "box", | |
"layout": "vertical", | |
"contents": [ | |
{ | |
"type": "box", | |
"layout": "horizontal", |
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
{ | |
"type": "bubble", | |
"body": { | |
"type": "box", | |
"layout": "vertical", | |
"contents": [ | |
{ | |
"type": "box", | |
"layout": "vertical", | |
"contents": [ |
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
{ | |
"line": { | |
"type": "flex", | |
"altText": "Rabbit LINE Pay", | |
"contents": { | |
"type": "carousel", | |
"contents": [ | |
{ | |
"type": "bubble", | |
"hero": { |
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
module.exports = { | |
toBuddhistYear: (moment, format) => { | |
var christianYear = moment.format('YYYY') | |
var buddhishYear = (parseInt(christianYear) + 543).toString() | |
return moment | |
.format(format.replace('YYYY', buddhishYear).replace('YY', buddhishYear.substring(2, 4))) | |
.replace(christianYear, buddhishYear) | |
} | |
} |
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
/** | |
* Copyright 2019 Google LLC. | |
* SPDX-License-Identifier: Apache-2.0 | |
*/ | |
function getEnvironment() { | |
var environment = { | |
spreadsheetID: "<REPLACE WITH YOUR SPREADSHEET ID>", | |
firebaseUrl: "<REPLACE WITH YOUR REALTIME DB URL>" | |
}; |
If you're trying to do this, you came to the right place!
Watch this code work in real time: https://twitter.com/CodingDoug/status/942576182276497409
See also this gist for copying in the other direction: https://gist.github.com/CodingDoug/ffc4f050cc489a0280eb7f4cbe36af07
If you're trying to do this, you came to the right place!
Watch this code work in real time: https://twitter.com/CodingDoug/status/940022568089554944
See also this gist for copying in the other direction: https://gist.github.com/CodingDoug/44ad12f4836e79ca9fa11ba5af6955f7
NewerOlder