Skip to content

Instantly share code, notes, and snippets.

View szerintedmi's full-sized avatar

Peter Petrovics szerintedmi

  • Equal Experts
  • London, UK
View GitHub Profile
Web3 e2e tests
Web3 integration tests for: http://ganache:8545
✓ should be able to make a web3 instance
✓ should be able to get a list of accounts (157ms)
Web3 integration tests for: http://geth:8545
✓ should be able to make a web3 instance
✓ should be able to get a list of accounts
Web3 integration tests for: ws://geth:8546
✓ should be able to make a web3 instance
connection not open on send()
import BigNumber from "bignumber.js";
import { Contract } from "./Contract";
export interface ILoanProduct {
id: number;
termInSecs: number;
termInDays: number;
termText: string;
@szerintedmi
szerintedmi / travis.output
Created May 18, 2019 09:32
node gyp build error
[5/5] Building fresh packages...
error /home/travis/build/Augmint/augmint-web/node_modules/sha3: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /home/travis/build/Augmint/augmint-web/node_modules/sha3
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
@szerintedmi
szerintedmi / jest.config.js
Created April 19, 2021 17:39
jest.config.js : TypeScript with jest-environment-puppeteer
/* Setup with ts-jest preset then overwrite the rest with jest-environment-puppeteer
* so we can use typescript for puppeteer tests.
*/
module.exports = {
preset: "ts-jest",
globalSetup: "jest-environment-puppeteer/setup",
globalTeardown: "jest-environment-puppeteer/teardown",
testEnvironment: "jest-environment-puppeteer",
setupFilesAfterEnv: ["expect-puppeteer"],
};
@szerintedmi
szerintedmi / embed_openAI.py
Created June 9, 2023 07:50
Embedding with openai text-embedding-ada-002
import pandas as pd
import openai
import os
from openai.embeddings_utils import get_embedding
from transformers import GPT2TokenizerFast
import streamlit as st
# Based on openai cookbook example:
# https://github.com/openai/openai-cookbook/blob/838f000935d9df03e75e181cbcea2e306850794b/examples/Obtain_dataset.ipynb
@szerintedmi
szerintedmi / embed_SentenceTransformer.py
Created June 9, 2023 07:52
embedding with multi-qa-mpnet-base-dot-v1
from sentence_transformers import SentenceTransformer
from transformers import AutoTokenizer
import torchUtils
import pandas as pd
torch_device = torchUtils.getDevice()
def get_embeddings(df: pd.DataFrame):
"""