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
CMD ["tail", "-f", "/dev/null"] |
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
nvm current > .nvmrc | |
yarn dlx @yarnpkg/sdks vscode | |
yarn add --dev eslint-config-airbnb eslint-config-airbnb-typescript eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks @typescript-eslint/eslint-plugin @typescript-eslint/parser husky lint-staged @next/eslint-plugin-next @tailwindcss/postcss postcss autoprefixer yarn-upgrade-all | |
yarn yarn-upgrade-all | |
Prompt for Aider: | |
This is a frontend repo, scaffolded with Next.JS (page router), with typescript, eslint, tailwindcss support. It is using `yarn` as package manager. |
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
// Use this code snippet in your app. | |
// If you need more information about configurations or implementing the sample code, visit the AWS docs: | |
// https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/getting-started.html | |
import { | |
SecretsManagerClient, | |
GetSecretValueCommand, | |
} from "@aws-sdk/client-secrets-manager"; | |
const secret_name = "docdb/master/password"; |
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 { getLogger } from '@core-ui/lib/logger'; | |
import { NextApiRequest, NextApiResponse } from 'next'; | |
import { apiHandler } from '@core-ui/lib/apiHandler'; | |
import { internal_runWithWaitUntil as waitUntil } from 'next/dist/server/web/internal-edge-wait-until'; | |
// WARNING: This api handler uses next internal function that is not designed for production | |
// https://github.com/vercel/next.js/issues/50522#issuecomment-1838593482 | |
const getHandler = async (req: NextApiRequest, res: NextApiResponse): Promise<NextApiResponse> => { | |
const logger = getLogger('/api/sitemap.ts:GET'); |
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 requests | |
import asyncio | |
from timeit import default_timer | |
from concurrent.futures import ThreadPoolExecutor | |
START_TIME = default_timer() | |
def request(session, i): | |
url = "http://localhost:3100/expert/?searchQuery=product+management&limit=20&offset=0&sortBy=recommended&sortOrder=DESC&responseTime=48&categories=Marketing&topics=Product+Marketing&domains=Venture Capital&countries=Singapore" | |
with session.get(url) as response: |
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
# fuzzy_removal will scan through the text and replace the text with replacement if the text is similar to the target | |
# default replacement is <Patient Name> | |
# default similarity score is 80 | |
def fuzzy_removal( | |
text: str, | |
target: str, | |
replacement: str='<Patient Name>', | |
min_score: int=80, | |
debug: bool=False, | |
) -> str: |
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
# replace all punctuations with spaces in plain_text and store in `cleaned` variable | |
cleaned = re.sub(r'[^\w\s]', ' ', plain_text) | |
# replace all whitespace with single space in `cleaned` variable | |
cleaned = re.sub(r'\s+', ' ', cleaned) | |
# split the cleaned text into a list of words | |
words = cleaned.split() | |
# create a list to store bigrams |
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
SELECT GROUP_CONCAT(CONCAT("'", COLUMN_NAME, "'")) | |
FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE TABLE_NAME = 'patient' | |
AND TABLE_SCHEMA = 'db2' | |
order BY ORDINAL_POSITION | |
INTO OUTFILE '/Users/leongkui/Downloads/db2-header.csv' | |
FIELDS TERMINATED BY ',' | |
OPTIONALLY ENCLOSED BY '"' | |
LINES TERMINATED BY '\n'; |
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
#!/bin/bash | |
# | |
# credit to machupicchubeta/dotfiles/bin/enable_to_sudo_authenticate_with_touch_id.sh | |
set -eu | |
set -o pipefail | |
sudo chmod +w /etc/pam.d/sudo | |
if ! grep -Eq '^auth\s.*\spam_tid\.so$' /etc/pam.d/sudo; then | |
( set -e; set -o pipefail | |
# Add "pam_tid.so" to a first authentication |
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
curl -w 'nLookup time:t%{time_namelookup}nConnect time:t%{time_connect}nPreXfer time:t%{time_pretransfer}nStartXfer time:t%{time_starttransfer}nnTotal time:t%{time_total}n' -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" https://speedoc.com/sg/ |
NewerOlder