This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
THIS SCRIPT IS FOR TESTING pg_trgm postgres extension | |
1. | |
CREATE TABLE test_text_search ( | |
id SERIAL PRIMARY KEY, | |
word TEXT | |
); | |
2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ( | |
col.table_schema, | |
col.table_name, | |
col.ordinal_position as column_id, | |
col.column_name, | |
col.udt_name, | |
string_agg(enu.enumlabel, ', ' ORDER BY enu.enumsortorder) AS enum_values | |
) | |
FROM information_schema.columns col | |
JOIN information_schema.tables tab ON tab.table_schema = col.table_schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum install git -y | |
sudo git config --global user.name "your_username" | |
sudo git config --global user.email "your_email_address@example.com" | |
sudo yum update -y | |
sudo amazon-linux-extras install docker | |
sudo yum install docker -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import os | |
import sys | |
from dotenv import load_dotenv | |
from postgres_database_utils import create_connection, PostgresCredentials | |
# constants | |
DROP_TABLE = True | |
TABLE_NAME = "boilerplate" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install hyperkit and minikube | |
brew install hyperkit | |
brew install minikube | |
# Install Docker CLI | |
brew install docker | |
brew install docker-compose | |
# Start minikube | |
minikube start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return {'test': "Hello, World!"} | |
if __name__ == '__main__': | |
app.run(debug=True, host='localhost', port=8000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
date = input("Enter a date in DD-MM-YYYY format: ") | |
url = f"https://api.coingecko.com/api/v3/coins/ethereum/history?date={date}" | |
response = requests.get(url).json() | |
price_at = round(response['market_data']['current_price']['usd'], 2) | |
print(price_at) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tokenABI = [ | |
{ | |
inputs: [ | |
{ internalType: "string", name: "name", type: "string" }, | |
{ internalType: "string", name: "symbol", type: "string" }, | |
{ internalType: "uint256", name: "maxNftSupply", type: "uint256" }, | |
{ internalType: "uint256", name: "saleStart", type: "uint256" }, | |
], | |
stateMutability: "nonpayable", | |
type: "constructor", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add all contents to git | |
git add . | |
# commit all contents to staging index | |
git commit -m 'some message goes here about the changes made' | |
# add a remote origin | |
git remote add origin https://github.com/<username>/<project-name> | |
# view branch name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const networks = { | |
polygon: { | |
chainId: `0x${Number(137).toString(16)}`, | |
chainName: "Polygon Mainnet", | |
nativeCurrency: { | |
name: "MATIC", | |
symbol: "MATIC", | |
decimals: 18 | |
}, | |
rpcUrls: ["https://polygon-rpc.com/"], |
NewerOlder