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 / main.go
Created November 12, 2024 12:11
Generate paystack webhook signature using golang for testing purposes
package main
import (
"crypto/hmac"
"crypto/sha512"
"encoding/hex"
"fmt"
)
func createSignature(payload []byte, secretKey string) string {
@CeoFred
CeoFred / gist:970c720cf4e594b26524fe4aeb2122a7
Created November 12, 2024 12:11
Generate paystack webhook signature using golang for testing purposes
package main
import (
"crypto/hmac"
"crypto/sha512"
"encoding/hex"
"fmt"
)
func createSignature(payload []byte, secretKey string) string {
@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', "[email protected]")
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 ]