Initially taken by Niko Matsakis and lightly edited by Ryan Levick
- Introductions
- Cargo inside large build systems
- FFI
- Foundations and financial support
// File: contracts/child/ChildToken/ChildERC20.sol | |
pragma solidity 0.6.6; | |
contract ChildERC20 is | |
ERC20, | |
IChildToken, | |
AccessControlMixin, | |
NativeMetaTransaction, | |
ChainConstants, |
""" | |
WARNING: dont use loguru, use structlog | |
https://gist.github.com/nkhitrov/38adbb314f0d35371eba4ffb8f27078f | |
Configure handlers and formats for application loggers. | |
""" | |
import logging | |
import sys | |
from pprint import pformat |
Learning Rust
The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.
Warning
Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.
The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.
This document details some tips and tricks for creating redux containers. Specifically, this document is looking at the mapDispatchToProps
argument of the connect
function from [react-redux][react-redux]. There are many ways to write the same thing in redux. This gist covers the various forms that mapDispatchToProps
can take.
type | |
MaybeKind = enum Just, Nothing | |
Maybe[T] = object | |
case kind: MaybeKind | |
of Just: value: T | |
of Nothing: discard | |
EitherKind = enum Left, Right | |
Either[L, R] = object | |
case kind: EitherKind |
use std::boxed::Box; | |
macro_rules! Ch { | |
($x:expr, $y:expr, $z:expr) => { ($x & $y) ^ (!$x & $z) }; | |
} | |
macro_rules! Maj { | |
($x:expr, $y:expr, $z:expr) => { ($x & $y) ^ ($x & $z) ^ ($y & $z) }; | |
} |
These rules are adopted from the AngularJS commit conventions.
Add this in your ini file:
[alembic:exclude]
tables = spatial_ref_sys
In env.py
:
import re