Skip to content

Instantly share code, notes, and snippets.

View gongfan99's full-sized avatar

Sam Gong gongfan99

  • Kitchener, Ontario
View GitHub Profile
@gongfan99
gongfan99 / find-hotels-within-500-meters.js
Created May 27, 2023 16:47
Find all hotels within 500 meters from my location with Node.js
import { createPool } from 'mysql2/promise'
import 'dotenv/config'
const pool = createPool({
host: process.env.DB_HOST,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE,
waitForConnections: true,
connectionLimit: 5,
@gongfan99
gongfan99 / save-embeddings-as-BLOB-in-MySQL.py
Created May 27, 2023 03:53
save embeddings as BLOB in MySQL with Python
import numpy as np
import mysql.connector
cnx = mysql.connector.connect(
host="HOST",
port=3306,
user="USERNAME",
password="PASSWORD",
database="DATABASE NAME",
pool_name="mypool",
@gongfan99
gongfan99 / save-embeddings-as-BLOB-in-MySQL.js
Last active September 17, 2023 04:49
save embeddings as BLOB in MySQL with Node.js
import { createPool } from 'mysql2/promise'
import 'dotenv/config'
const pool = createPool({
host: process.env.DB_HOST,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE,
waitForConnections: true,
connectionLimit: 5,