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
| struct PieChartRows: View { | |
| var colors: [Color] | |
| var names: [String] | |
| var values: [String] | |
| var percents: [String] | |
| var body: some View { | |
| VStack{ | |
| ForEach(0..<self.values.count){ i in | |
| HStack { |
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
| var body: some View { | |
| GeometryReader { geometry in | |
| VStack{ | |
| ZStack{ | |
| ForEach(0..<self.values.count){ i in | |
| PieSliceView(pieSliceData: self.slices[i]) | |
| } | |
| .frame(width: geometry.size.width, height: geometry.size.width) | |
| Circle() |
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
| import SwiftUI | |
| struct PieChartView: View { | |
| public let values: [Double] | |
| public var colors: [Color] | |
| public let names: [String] | |
| public var backgroundColor: Color | |
| public var innerRadiusFraction: CGFloat | |
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
| if (condition) { | |
| what we should do in that case | |
| } |
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
| function CATEGORIZE(transaction) { | |
| const [card, date, description, amount] = transaction[0] | |
| if (description.toLowerCase().includes("starbucks") || | |
| description.toLowerCase().includes("taqueria")) { | |
| return "takeout" | |
| } else if (description.toLowerCase().includes("carwash") || | |
| description.toLowerCase().includes("chevron") || | |
| description.toLowerCase().includes("exxon")) { | |
| return "car" |
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
| const TELEGRAM_TOKEN = "..." | |
| export default async (req, res) => { | |
| const chat_id = req.body.message.chat.id; | |
| await respond(chat_id, "Buy Milk") | |
| res.status(200).send({}); | |
| } |
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
| const TELEGRAM_TOKEN = "..." | |
| export default async (req, res) => { | |
| const chat_id = req.body.message.chat.id; | |
| try { | |
| const sentMessage = req.body.message.text; | |
| const splitInHalf = sentMessage.split("Remind in") | |
| const firstPart = splitInHalf[0].trim() |
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
| } catch (e) { | |
| await respond(chat_id, `Your message needs to be in this format "Do X. Remind in Y minutes"`) | |
| } |
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
| pragma solidity ^0.4.20; | |
| interface ERC721 { | |
| function name() external view returns (string _name); | |
| function symbol() external view returns (string _symbol); | |
| function tokenURI(uint256 _tokenId) external view returns (string); | |
| function totalSupply() external view returns (uint256); | |
| function tokenByIndex(uint256 _index) external view returns (uint256); | |
| function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256); |
