Skip to content

Instantly share code, notes, and snippets.

View Olusamimaths's full-sized avatar

Olusola Olusamimaths

View GitHub Profile
@Olusamimaths
Olusamimaths / superversor-appointment.js
Last active December 19, 2022 18:03
CSC415 Project Schemas
// Create Availability Schedule
// Doesn't allow overlaps in time slots
{
semesterStart: "2021-01-01",
semesterEnd: "2021-06-30"
}
{
semesterId: string,
daysOfWeekAvailable: [
@Olusamimaths
Olusamimaths / midnights.js
Last active September 7, 2022 06:37
Javascript Date comparision, midnights
const yesterday = new Date();
yesterday.setHours(0, 0, 0, 0);
console.log(new Date() > yesterday) // true
console.log(`Yesterday: ${yesterday}`)
const today = new Date()
today.setHours(24, 0, 0, 0);
console.log(`Today: ${today}`)
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract Ballot {
struct Voter {
uint weight; // weight is accumulated by delegation
bool voted; // if true, that person already voted
address delegate; // person delegated to
uint vote; // index of the voted proposal
@Olusamimaths
Olusamimaths / contracts...stakingtoken.sol
Created April 9, 2022 06:45
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.13+commit.abaa5c0e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol";
contract StakingToken is ERC20, Ownable {
using SafeMath for uint256;
@Olusamimaths
Olusamimaths / contracts...tokencontract.sol
Created April 8, 2022 16:00
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;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.0.0/contracts/token/ERC20/ERC20.sol";
contract MyToken is ERC20 {
uint256 public unitsPerEth = 10;
address public tokenOwner;
@Olusamimaths
Olusamimaths / contracts...decentradoc.sol
Created April 8, 2022 15:59
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;
contract DecentraDoc {
string public name;
uint public documentCount = 0;
mapping(uint => Document) public documents;
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
// The name of the contract
contract HelloWorld {
// the number to store
uint storedNumber;
// sets storedNumber to the number provided
@Olusamimaths
Olusamimaths / Blockgames Task - How Blockchain Can Help Guaranty Privacy of Data on the Cloud - by Samuel Olusola - olusamimaths.md
Last active April 7, 2022 13:43
Blockgames Task - How Blockchain Can Help Guaranty Privacy of Data on the Cloud - by Samuel Olusola - olusamimaths

Introduction

I strongly believe that Blockchain Technology can help guaranty the privacy of data stored on the cloud.

Currently, there are different services that provide storage for individuals and companies to their files on the cloud, this includes Google Drive, DropBox etc. The files stored on these platforms leave in facilities provided and managed by the Companies that run them. Though, this companies promise that the privacy of your files and data is guaranteed, with the right incentive, they can still tamper with the files stored on their servers if they want to.

This means that the users of these platforms need to continue to hope that the wrong people with the incentive to tamper with their data stored by these companies never get into the position to do that. They are not in control of their data neither are they in control of the people managing it.

using System;
using System.Collections.Generic;
using System.Text;
namespace Person
{
public class Person
{
private int id;
private static int numberOfPersons = 0;
import React from "react";
import "./styles.css";
function FirstComponent({ children }) {
return (
<div>
<h3>I am the first component</h3>;
{ children }
</div>
);