Skip to content

Instantly share code, notes, and snippets.

View CeoFred's full-sized avatar
🌎
Global

Johnson-Awah Alfred CeoFred

🌎
Global
View GitHub Profile
@CeoFred
CeoFred / token.sol
Created June 24, 2024 19:10
BEP20 Token
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/token/ERC20/ERC20.sol";
contract BEP20Token is ERC20 {
uint256 private constant INITIAL_SUPPLY = 4444444444 * 10**18; // 4,444,444,444 tokens
address constant COMMUNITY_ADDRESS = address(0x0);
constructor() ERC20("Meegle", "$MEEGLE") {
// Mint the entire supply to the deployer
@CeoFred
CeoFred / QuadarticVoting.sol
Last active June 7, 2024 18:34
Quadratic Voting (QV) is a decision-making process that allows individuals to express the intensity of their preferences rather than just the direction of their vote. This smart contract implements the barest minimum expected for a quadratic voting system.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.2 <0.9.0;
contract QV {
struct VoteEntry {
address voter;
uint256 votes;
}
@CeoFred
CeoFred / update.js
Created March 18, 2023 16:33
Send PUT request to PHP server using fetch API
var urlencoded = new URLSearchParams()
urlencoded.append('first_name', "alfred")
urlencoded.append('last_name', "johnson")
urlencoded.append('gender', "1")
urlencoded.append('email', "myemail@gmail.com")
urlencoded.append('phone_number', "08159")
const url = '/update.php'
@CeoFred
CeoFred / main.go
Created January 4, 2023 16:41
Log errors to a file in golang
package main
import "fmt"
import "os"
import "log"
func main() {
logfile,err := os.Create("log.txt")
@CeoFred
CeoFred / contracts...Season2.sol
Created July 21, 2022 19:25
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: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "erc721a/contracts/ERC721A.sol";
// TODO: Change name for production!!
contract PhatMan is ERC721A, Pausable, Ownable {
using Strings for uint256;
/**
*Submitted for verification at Etherscan.io on 2021-09-05
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// [MIT License]
/// @title Base64
Here are some products that you can use to build your fintech app
## SMS
Termii
Twilio
Interswitch Digital (Vanso)
## Card and account charge
@CeoFred
CeoFred / cert.conf
Last active December 19, 2020 21:02
The following files are used in one of my blog post which talks about setting up ssl for apache server found here https://blog.codemon.me/fix-request-redirecting-to-https-secured-connection-on-local-codeigniter-3
[ req ]
default_bits = 2048
default_keyfile = server-key.pem
distinguished_name = subject
req_extensions = req_ext
x509_extensions = x509_ext
string_mask = utf8only
[ subject ]
@CeoFred
CeoFred / 1_Storage.sol
Created October 31, 2020 19:51
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.5.11+commit.c082d0b4.js&optimize=false&gist=
pragma solidity >=0.4.22 <0.7.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
uint256 number;
@CeoFred
CeoFred / solution.js
Created July 23, 2020 21:34 — forked from gitfaf/solution.js
Solves lycanthrope's log problem from eloquent javascript.
/* Data from http://eloquentjavascript.net/code/#4 */
/* phi logic from http://www.pmean.com/definitions/phi.htm */
var JOURNAL = [
{"events":["carrot","exercise","weekend"],"squirrel":false},
{"events":["bread","pudding","brushed teeth","weekend","touched tree"],"squirrel":false},
{"events":["carrot","nachos","brushed teeth","cycling","weekend"],"squirrel":false},
{"events":["brussel sprouts","ice cream","brushed teeth","computer","weekend"],"squirrel":false},
{"events":["potatoes","candy","brushed teeth","exercise","weekend","dentist"],"squirrel":false},
{"events":["brussel sprouts","pudding","brushed teeth","running","weekend"],"squirrel":false},