Skip to content

Instantly share code, notes, and snippets.

View toniton's full-sized avatar
💭
Busy pressing keyboard 🥸

Toni Akinjiola toniton

💭
Busy pressing keyboard 🥸
View GitHub Profile
@toniton
toniton / README.MD
Last active December 22, 2023 16:02
YAML configuration using Pydantic Settings.

Yaml Config Settings Source

This repository includes a Python script yaml_config_settings_source.py that provides a custom YAML configuration settings source for Pydantic-based applications. The script facilitates reading settings from YAML files to configure Pydantic BaseSettings classes.

Prerequisites

This code is developed using Python and requires the following libraries:

  • Pydantic
  • Pydantic-Settings
  • PyYAML
@toniton
toniton / Makefile
Last active December 16, 2023 07:51
Terraform + Github Actions (AWS)
TF_STATE_FILE := "service-terraform.tfstate"
@init:
terraform init
@plan:
terraform plan -out=$(TF_STATE_FILE)
@apply:
@toniton
toniton / main.dart
Created November 22, 2022 17:50
Flutter bottomsheet modal with pinned header
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@toniton
toniton / contracts...1_Storage.sol
Created May 2, 2022 22:58
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
* @custom:dev-run-script ./scripts/deploy_with_ethers.ts
*/
contract Storage {
@toniton
toniton / contracts...3_Ballot.sol
Created May 2, 2022 22:58
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Ballot
* @dev Implements voting process along with vote delegation
*/
contract Ballot {
@toniton
toniton / clean_code.md
Created December 22, 2021 21:03 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules