Skip to content

Instantly share code, notes, and snippets.

View Adebara123's full-sized avatar

Ayomide Adebara Adebara123

View GitHub Profile
// bank
// create account (add pin)
// balance
// Withdraw balance
// Deposit amount
// security feature (Enter pin)
// account history (Track transactions)
// Implement account transfered to
// Account type (Savings, current)
// Guessing game
// difficulty levels
// random number
// time boundaries
// Highest score
use rand::Rng;
use std::cmp::Ordering;
use std::io::{self, Read};
use std::time::{Instant, Duration};
@Adebara123
Adebara123 / stellar.rs
Last active March 3, 2025 17:24
stellar assignment
fn calculate_tax(income: f64) -> f64 {
if income <= 10_000.0 {
0.0
} else if income <= 50_000.0 {
(income - 10_000.0) * 0.10
} else {
(50_000.0 - 10_000.0) * 0.10 + (income - 50_000.0) * 0.20
}
}
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report, confusion_matrix
from sklearn.preprocessing import StandardScaler
@Adebara123
Adebara123 / exercise_1.rs
Created July 24, 2024 20:39
Stellar rust exercise 1
// Question 1: Variables
// Create a mutable variable `count` with an initial value of 10.
// Increment its value by 5 and print the result.
fn main() {
// Your code here
}
// Question 2: Data Types
// Declare a tuple `person` with a name (string), age (integer), and height (float).

Milestone Delivery 📫

The delivery is according to the official milestone delivery guidelines.

Context (optional) The Me Protocol is a purpose-built exchange infrastructure for blockchain-based rewards. It provides the fundamental technology for the creation of a frictionless, limitless, and decentralised rewards ecosystem for all companies, large or small, to participate.

@Adebara123
Adebara123 / bytes.sol
Created April 3, 2024 11:39
bytes concatination
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.2 <0.9.0;
contract test {
struct Body {
// amount to be sent
uint256 amount;
// The token identifier
@Adebara123
Adebara123 / gist:5dfdfd17285205127ce0b57f4ad59318
Last active February 26, 2024 13:52
Miller Rabin and Power set assignement
use std::collections::HashSet;
use rand::Rng;
fn power_set(set: &Vec<i32>) -> Vec<Vec<i32>> {
let mut result = Vec::new();
let size = set.len();
let num_subsets = 1 << size;
for i in 0..num_subsets {
let mut subset = Vec::new();
const [days, hours, minutes, seconds] = useCountdown(Number(timeLock) * 1000);
//////////// date calculator
export const dateHelper = (period = 16545467657) => {
let timeLockPeriod;
let currentTimeDate = new Date();
if (period === "7 Days") {
timeLockPeriod = 7
} else if (period === "4 Weeks") {
@Adebara123
Adebara123 / StakingWithEth.sol
Created August 13, 2022 23:24
A staking contract to to get a different token
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
contract stake {
address owner;
struct depositor{
uint256 amountOfDays;
uint amountOfEther;