This file contains hidden or 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
void saySomethingNice(String name, int count) { | |
// aren't we nice? | |
mTextView.setText(text + " is handsome"); | |
} |
This file contains hidden or 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
// spending should be negative | |
let accountAmount = Monzo.cardPurchase.AmountInAccountCurrency; | |
let localAmount = Monzo.cardPurchase.AmountInLocalCurrency; | |
let amount = -Number(accountAmount) * 1000; | |
let date = Meta.currentUserTime.toISOString().substr(0, 10); | |
var memo = null; | |
if (localAmount && localAmount != accountAmount) { | |
memo = Monzo.cardPurchase.LocalCurrencySymbol + localAmount; |
This file contains hidden or 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
/** | |
* This executes the supplied lambda in the scope of a J2V8 MemoryManager, ensuring that all | |
* V8Object instances allocated in the scope are cleaned up on exit. | |
*/ | |
inline fun <T> V8.scope(body: () -> T) : T { | |
val scope = MemoryManager(this) | |
try { | |
return body() | |
} finally { | |
scope.release() |