Skip to content

Instantly share code, notes, and snippets.

View ponyjackal's full-sized avatar
🏠
Working from home

ponyjackal

🏠
Working from home
View GitHub Profile
@ponyjackal
ponyjackal / jdbc_sink_connector.json
Created February 6, 2024 00:31
JDBC Postgres Sink Connector Config
{
"name": "newuser",
"connector.class": "io.debezium.connector.jdbc.JdbcSinkConnector",
"tasks.max": "1",
"connection.url": "jdbc:postgresql://${MASTER_DB_HOST}:${MASTER_DB_PORT}/${MASTER_DB_NAME}",
"connection.username": "${MASTER_DB_USER}",
"connection.password": "${MASTER_DB_PASSWORD}",
"insert.mode": "upsert",
"delete.enabled": "true",
"primary.key.mode": "record_key",
@ponyjackal
ponyjackal / debezium_postgres_connector.json
Created February 6, 2024 00:30
Debezium postgres connector config
{
"name": "user",
"connector.class": "io.debezium.connector.postgresql.PostgresConnector",
"database.hostname": "${MASTER_DB_HOST}",
"database.port": "${MASTER_DB_PORT}",
"database.user": "${MASTER_DB_USER}",
"database.password": "${MASTER_DB_PASSWORD}",
"database.server.name": "user",
"database.dbname": "${MASTER_DB_NAME}",
"tasks.max": "1",
@ponyjackal
ponyjackal / docker-compose.yml
Created February 6, 2024 00:14
Debezium Postgres Kafka CDC
version: "3"
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
hostname: zookeeper
container_name: zookeeper
ports:
- "2181:2181"
environment:
@ponyjackal
ponyjackal / FA2_REVEAL.py
Created April 7, 2023 01:24
SmartPy NFT FA2 Contract with reveal feature
import smartpy as sp
FA2 = sp.io.import_script_from_url("https://smartpy.io/templates/fa2_lib.py")
class MyProject(
FA2.Admin,
FA2.BurnNft,
FA2.ChangeMetadata,
FA2.WithdrawMutez,
FA2.MintNft,
FA2.OnchainviewBalanceOf,
@ponyjackal
ponyjackal / LazyMint.ts
Created September 14, 2022 03:49
LazyMint using EIP712
// sign a message for LazyMintVoucher
const data = {
receiver: alice.address,
displayTypes: [
ethers.utils.hexDataSlice(ethers.utils.formatBytes32String("paint"), 0, 16),
ethers.utils.hexDataSlice(ethers.utils.formatBytes32String("wheel"), 0, 16),
ethers.utils.hexDataSlice(ethers.utils.formatBytes32String("engine"), 0, 16),
],
traitTypes: [
ethers.utils.hexDataSlice(ethers.utils.formatBytes32String("paint"), 0, 16),
@ponyjackal
ponyjackal / LazyMint.sol
Last active September 14, 2022 03:46
LazyMint using EIP712 - smart contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/utils/ERC721HolderUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
@ponyjackal
ponyjackal / MimeticMetadata.sol
Created September 14, 2022 03:19
Non-dilutive NFT metadata
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import { IMimeticMetadata } from "./IMimeticMetadata.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";
error MintExceedsMaxSupply();
@ponyjackal
ponyjackal / JackpotLottery.sol
Created September 14, 2022 03:18
Lottery contract
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.4;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IJackpotLotteryTicket.sol";
import "./interfaces/IChainlinkAggregator.sol";
@ponyjackal
ponyjackal / JackPotLotteryTicket.sol
Created September 14, 2022 03:17
Lottery ticket contract
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.4;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract JackpotLotteryTicket is ERC1155, Ownable {
address internal lotteryContract;
uint256 internal totalSupply;
uint8 public constant SIZE_OF_NUMBER = 6;
@ponyjackal
ponyjackal / ChainlinkAggregator.sol
Created September 14, 2022 03:16
ChainlinkAggregator for price oracle
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.4;
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol";
import "./interfaces/IJackpotLottery.sol";
import "./interfaces/IPancakePair.sol";