graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
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 { Client } = require("pg"); | |
const AWS = require("aws-sdk"); | |
const { from } = require("pg-copy-streams"); | |
const stream = require("stream"); | |
// Configure AWS S3 | |
const s3 = new AWS.S3({ | |
accessKeyId: "", // Your AWS access key | |
secretAccessKey: "", // Your AWS secret key | |
region: "ap-southeast-2", // The region where your bucket is located |
start minikube using hyperv driver
- assign 4 cpus
- enable ingress
minikube start --profile hello-world --cpus 4 --vm-driver hyperv --hyperv-virtual-switch "thinkpad-k8s" --addons=ingress --embed-certs
to enable metric server
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 { test, expect } = require('@playwright/test'); | |
test('basic test', async ({ page }) => { | |
await page.goto('http://localhost:3000'); | |
await page.click('[name=login]'); | |
await page.fill('[name=email]', '<EMAIL>'); | |
await page.fill('[name=password]', '<PASSWORD>'); | |
await page.click('[name=submit]'); |
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 selenium import webdriver | |
from selenium.webdriver.common.by import By | |
driver = webdriver.Chrome() | |
driver.implicitly_wait(10) # not a good practice; just for demo purpose | |
driver.get("http://localhost:3000") | |
# Landing page | |
login_button = driver.find_element(By.NAME, "login") | |
login_button.click() |
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
g:EasyMotion_override_acejump = 0 | |
map <space> <Plug>(easymotion-bd-w) | |
set easymotion |
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 current_app, Blueprint, render_template | |
from database import db_session | |
from model import Product | |
admin = Blueprint('admin', __name__, url_prefix='/admin') | |
@admin.route('/') | |
def index(): | |
product = db_session.query(Product).first() |
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
function pyvenv_enable () { | |
ENV_NAME=$(basename $PWD) | |
VENV_DIR="${HOME}/.venv/${ENV_NAME}" | |
if [ ! -d "${VENV_DIR}" ]; then | |
python3 -m venv ${VENV_DIR} | |
echo "Created venv: ${VENV_DIR}" | |
source ${VENV_DIR}/bin/activate | |
pip3 install --upgrade pip setuptools-scm | |
else | |
source ${VENV_DIR}/bin/activate |
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
git config --global alias.a "! git add . && git status" | |
git config --global alias.aa "! git add . && git add -u . && git status" | |
git config --global alias.ac "! git add . && git commit" | |
git config --global alias.acm "! git add . && git commit -m" | |
git config --global alias.alias "! git config --list | grep 'alias\.' | sed 's/alias\.\([^=]*\)=\(.*\)/\1\ => \2/' | sort" | |
git config --global alias.au "! git add -u . && git status" | |
git config --global alias.c "commit" | |
git config --global alias.ca "commit --amend" | |
git config --global alias.cm "commit -m" | |
git config --global alias.co checkout |
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 javax.crypto.*; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.io.ByteArrayInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.security.*; |
NewerOlder