Skip to content

Instantly share code, notes, and snippets.

View Adophilus's full-sized avatar
💭
Learning 🤓

Uchenna Ofoma Adophilus

💭
Learning 🤓
View GitHub Profile
@Adophilus
Adophilus / Crowdfund.sol
Created March 30, 2024 20:46
A basic crowdfunding smart contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
// AGENDA
// Develop a crowdfund smart contract
// Adhere to best practices
// Transfer & withdrawal support
// Support for locked deposits
// Support for pull out window
// Multiple/concurrent funding
@Adophilus
Adophilus / Restaurant.sol
Created March 23, 2024 20:06
a smart contract powering a restaurant
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
contract Ownable {
address owner;
constructor (){
owner = msg.sender;
@Adophilus
Adophilus / UseHandler.js
Created January 28, 2024 17:06 — forked from bogordesaincom/UseHandler.js
Hono Sample Upload using Middleware
import upload from "../lib/upload";
// const UPLOADS_DIR = "./public";
// const indexUser = async (c) => {
// return c.json({ message: "User Index" });
// };
const storeUser = async (c) => {
const body = await c.req.parseBody();

Here's the current error:

UnimplementedFeatureError: Copying of type struct Cont.Question memory[] memory to storage not yet supported.


Error HH600: Compilation failed

For more info go to https://hardhat.org/HH600 or run Hardhat with --show-stack-traces
error: "hardhat" exited with code 1 (SIGHUP)
@Adophilus
Adophilus / union-vs-intersection.ts
Created August 28, 2023 07:41
some code to analyse the difference between the union (|) and intersection (&) operates in typescript
type Product = {
price: number
sku: string
brands: {
_ref: string
}
categories: {
_ref: string
}
}
@Adophilus
Adophilus / flutter.md
Created August 23, 2023 14:41 — forked from jb0gie/flutter.md
Flutter Cheatsheet

Flutter

A quick cheatsheet of useful snippet for Flutter

Widget

A widget is the basic type of controller in Flutter Material. There are two type of basic Widget we can extend our classes: StatefulWidget or StatelessWidget.

Stateful

StatefulWidget are all the widget that interally have a dynamic value that can change during usage. It can receive an input value in the constructor or reference to functions. You need to create two classes like:

@Adophilus
Adophilus / rome.json
Created August 20, 2023 21:13
Sample Rome config file
{
"$schema": "./node_modules/rome/configuration_schema.json",
"formatter": {
"enabled": true
},
"javascript": {
"formatter": {
"semicolons": "asNeeded",
"trailingComma": "none"
}
@Adophilus
Adophilus / alpine_edge_testing_tag.md
Created August 13, 2023 06:26
Enabling installation of packages from the edge/testing repo in Alpine Linux

Add the following line of code to /etc/apk/repositories to enable the @testing tag to install packages from the edge/testing repo

@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing
@Adophilus
Adophilus / komorebi.log
Created July 31, 2023 21:10
komorebi log
2023-07-31T20:29:10.914426Z  INFO komorebi: creating window manager from static configuration file: C:\Users\hp\.config\komorebi\komorebi.json
2023-07-31T20:29:10.922855Z  INFO init: komorebi::window_manager: initialising
2023-07-31T20:29:10.991718Z  INFO komorebi::process_command: listening on komorebi.sock
2023-07-31T20:29:10.992115Z  INFO komorebi::process_event: listening
2023-07-31T20:29:19.837998Z  INFO process_command{FocusWorkspaceNumber(0)}:focus_monitor{idx=0}: komorebi::window_manager: focusing monitor
2023-07-31T20:29:19.838078Z  INFO process_command{FocusWorkspaceNumber(0)}:focus_workspace{idx=0}: komorebi::window_manager: focusi