Skip to content

Instantly share code, notes, and snippets.

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

Arc Angelo Ibalio gentlyawesome

🏠
Working from home
  • Philippines
View GitHub Profile
use anchor_lang::prelude::*;
declare_id!("5gaQPYyZV2EzyMEG6z2a1B5ZpdXxGmru7eEV5pNZJeNv");
#[program]
pub mod mycalculator {
use anchor_lang::solana_program::entrypoint::ProgramResult;
use super::*;
use anchor_lang::prelude::*;
declare_id!("5gaQPYyZV2EzyMEG6z2a1B5ZpdXxGmru7eEV5pNZJeNv");
#[program]
pub mod mycalculator {
use anchor_lang::solana_program::entrypoint::ProgramResult;
use super::*;
use anchor_lang::prelude::*;
declare_id!("5gaQPYyZV2EzyMEG6z2a1B5ZpdXxGmru7eEV5pNZJeNv");
#[program]
pub mod mycalculator {
use anchor_lang::solana_program::entrypoint::ProgramResult;
use super::*;
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';
import { themeColors } from 'styles/global-styles';
export const useStyles = makeStyles((theme: Theme) =>
createStyles({
main: {
// height: '84vh',
textAlign: 'left'
},
comment: {
@gentlyawesome
gentlyawesome / init.py
Created July 25, 2023 01:33
Vector DB
import numpy as np
from collections import defaultdict
from typing import List, Tuple
def cosine_similarity(v1: np.ndarray, v2: np.ndarray) -> float:
dot_product = np.dot(v1, v2)
norm_v1 = np.linalg.norm(v1)
norm_v2 = np.linalg.norm(v2)
return dot_product / (norm_v1 * norm_v2)
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.19;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.19;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.19;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
@gentlyawesome
gentlyawesome / .deps...npm...hardhat...console.sol
Created July 6, 2023 00:36
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.18+commit.87f61d96.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity >= 0.4.22 <0.9.0;
library console {
address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67);
function _sendLogPayload(bytes memory payload) private view {
uint256 payloadLength = payload.length;
address consoleAddress = CONSOLE_ADDRESS;
assembly {
pragma solidity ^0.8.0;
contract Proxy {
address private _implementation;
event Upgraded(address indexed implementation);
constructor(address implementation_) {
_implementation = implementation_;
}