Skip to content

Instantly share code, notes, and snippets.

View bet02024's full-sized avatar

BeGG2024 bet02024

  • México
  • 07:21 (UTC -06:00)
View GitHub Profile
try:
import faiss
except:
!pip install faiss-cpu -q
import faiss
# Build the index
d = embeddings.shape[1] # Dimension
index = faiss.IndexFlatL2(d)
@bet02024
bet02024 / artifacts...Address.json
Created March 2, 2022 00: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.6+commit.11564f7e.js&optimize=true&runs=200&gist=
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
@bet02024
bet02024 / Blacklistable.sol
Created December 22, 2020 16:57
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.6.2+commit.bacdbe57.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "./Ownable.sol";
/**
* @title Blacklistable Token
* @dev Allows accounts to be blacklisted by a "blacklister" role
*/
contract Blacklistable is Ownable {
@bet02024
bet02024 / Blacklistable.sol
Created December 21, 2020 22:52
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.6.0+commit.26b70077.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "./Ownable.sol";
/**
* @title Blacklistable Token
* @dev Allows accounts to be blacklisted by a "blacklister" role
*/
contract Blacklistable is Ownable {
@bet02024
bet02024 / M2Coin.sol
Created December 21, 2020 17:54
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.6.12+commit.27d51765.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.2.0/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.2.0/contracts/token/ERC721/ERC721Burnable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.2.0/contracts/token/ERC721/ERC721Pausable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.2.0/contracts/token/ERC721/ERC721Holder.sol";
import './Ownable.sol';
@bet02024
bet02024 / Blacklistable.doc.md
Created July 16, 2019 03:55
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.0+commit.1d4f565a.js&optimize=false&gist=

Blacklistable

Allows accounts to be blacklisted by a "blacklister" role

Blacklistable Token

unBlacklist - read

name type description
_account address The address to remove from the blacklist
Removes account from blacklist
@bet02024
bet02024 / SampleClient.sol
Created June 17, 2019 02:34
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.4.21+commit.dfe3193c.js&optimize=false&gist=
pragma solidity ^0.4.21;
import "./api_covoir.sol";
contract BettingContract is usingCovoirOracle {
bytes public response;
uint256 public id_response;
uint256 public minimumBet;
@bet02024
bet02024 / SampleClient.sol
Created June 17, 2019 02:20
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.4.21+commit.dfe3193c.js&optimize=false&gist=
pragma solidity ^0.4.21;
import "./api_covoir.sol";
contract SampleClient is usingCovoirOracle {
bytes public response;
uint256 public id_response;
event resultEvent(uint256 id, bytes responseIpfs);
@bet02024
bet02024 / Attention.py
Created September 18, 2017 21:35 — forked from cbaziotis/Attention.py
Keras Layer that implements an Attention mechanism for temporal data. Supports Masking. Follows the work of Raffel et al. [https://arxiv.org/abs/1512.08756]
def dot_product(x, kernel):
"""
Wrapper for dot product operation, in order to be compatible with both
Theano and Tensorflow
Args:
x (): input
kernel (): weights
Returns:
"""
#!/bin/sh
PATHDIR='/Users/beto/Downloads/test'
cd $PATHDIR
ftpSvr () {
HOST='67.222.130.110'
USER='XXXX'
PASSWD='XXXX'
ftp -n $HOST <<END_SCRIPT