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
import 'package:flutter/material.dart'; | |
import 'package:http/http.dart'; | |
import 'package:web3dart/web3dart.dart'; | |
void main() { | |
runApp(MaterialApp( | |
home: EthApp(), | |
theme: ThemeData( | |
primaryColor: Colors.orange, | |
typography: Typography( |
This guide is targetted at intermediate or expert users who want low-level control over their Python environments.
When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. This helps keep each workflow in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. The guide here covers one way to handle multiple Python versions and Python environments on your own (i.e., without a package manager like conda
). See the Using the workflow section to view the end result.
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
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
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
//GetTransactionsAndLinesForBidder hits the database 3 times. Let's make that fast. | |
func (db *DB) GetTransactionsAndLinesForBidder(bidderID int) ([]BidderTransaction, error) { | |
//Establish a waitgroup. This has 3 functions only. Add, Wait, and Done. You add to the WaitGroup and hit Done when you are | |
// done with a process. It will stop the function at Wait until the WaitGroup is at 0. | |
var wg sync.WaitGroup | |
//Get the transaction 'shell' | |
trans, err := db.GetTransactionsForBidder(bidderID) | |
if err != nil { |