-
Create a database Using createdb in Postgres.
-
Establish a connection to the database We can connect to a Postgres server from a Python web server using pyscopg2 with psycopg2.connect().
-
Define and create your data schema Execute CREATE TABLE commands to create the tables and define the schema (attributes, data types, etc) that will define what data gets housed for our web app.
-
Seed the database with initial data
This file contains hidden or 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
<ng-container *ngFor="let item of APIresponse | keyvalue: indexOrderAsc"> | |
{{item.key.replaceAll('_', ' ') | titlecase}}:{{item.value}} | |
</ng-container> |
This file contains hidden or 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
function constructEndpoint(lnRequest) { | |
if (lnRequest.includes("@")) { | |
return DECODE_LN_ADDRESS; | |
} | |
if (lnRequest.startsWith("lnurl") && lnRequest.includes("lnurl")) { | |
return DECODE_LNURL; | |
} | |
if (lnRequest.startsWith("ln")) { |
This file contains hidden or 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 { defineConfig } from "vite"; | |
import react from "@vitejs/plugin-react"; | |
// https://vitejs.dev/config/ | |
export default defineConfig({ | |
server: { | |
proxy: { | |
"/api": { | |
target: "http://localhost:3001", | |
changeOrigin: true, |
This file contains hidden or 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 bitcoinlib.wallets import Wallet | |
from bitcoinlib.mnemonic import * | |
passphrase = Mnemonic().generate() | |
print(passphrase) | |
w = Wallet.create("MyFirstWallet", witness_type='segwit', keys=passphrase, network='bitcoin') | |
WalletKeys = (w.get_keys(number_of_keys=10)) | |
for k in WalletKeys: |
This file contains hidden or 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
def setup_network(self): | |
"""Setup the test network topology""" | |
def run_test(self): | |
"""Main test logic""" | |
self.log.info("Starting test!") | |
"""Let the user know the test has started""" | |
self.sync_all(self.nodes) |
This file contains hidden or 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
class Counter extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
count: 0 | |
}; | |
this.decrement = this.decrement.bind(this); | |
this.increment = this.increment.bind(this); | |
this.reset = this.reset.bind(this); |
This file contains hidden or 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 React, { useState } from 'react'; | |
import ReactDOM from 'react-dom'; | |
const style = { | |
table: { | |
borderCollapse: 'collapse' | |
}, | |
tableCell: { | |
border: '1px solid gray', | |
margin: 0, |
This file contains hidden or 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 React, { useState } from 'react'; | |
import ReactDOM from 'react-dom'; | |
function Counter() { | |
const [count, setCount] = useState(0); | |
function increment(){ | |
setCount(count + 1) | |
} | |
return ( |
This file contains hidden or 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
class Greeter extends React.Component { | |
render() { | |
const {first, last} = this.props; | |
return <h1>Hello, {first} {last}</h1>; | |
} | |
} | |
ReactDOM.createRoot(document.getElementById("root")).render( | |
<Greeter first="Srini" last="Kata" /> | |
); |