Skip to content

Instantly share code, notes, and snippets.

View korakot's full-sized avatar

Korakot Chaovavanich korakot

  • Bangkok, Thailand
View GitHub Profile
korakot /
Created May 9, 2024 07:25
Google colab secret key userdata
from google.colab import userdata
key = userdata.get('MY_APY_KEY')
korakot /
Created February 19, 2024 09:27
Suppress stdout
import os
import sys
from contextlib import contextmanager
def suppress_stdout():
with open(os.devnull, 'w') as devnull:
original_stdout = sys.stdout
sys.stdout = devnull
korakot /
Created February 10, 2024 10:56
Using playwright in Google Colab
!pip install playwright
!playwright install
# colab need this for async
import nest_asyncio
# start browser, not to use 'with' context
from playwright.async_api import async_playwright
playwright = await async_playwright().start()
browser = await playwright.chromium.launch()
korakot /
Created February 8, 2024 11:04
ChatGPT Main Prompt

You are ChatGPT, a large language model trained by OpenAI, based on the GPT-4 architecture. Knowledge cutoff: 2023-04 Current date: 2024-02-07

Image input capabilities: Enabled



korakot /
Last active January 27, 2024 05:15
Impersonate browser with curl_cffi requests
# see
from curl_cffi import requests
korakot /
Created October 27, 2023 06:41
Use Claude API to get history
!pip install claude2
from claude import Claude
from import patch
from curl_cffi import requests
cookie = "sessionKey=sk-ant-sid01-4etj_0tI6RJKMbAAA"
claude = Claude(cookie)
korakot / formats.txt
Last active October 17, 2023 13:41
Claude's supported file upload formats
With grouping
Documents: .pdf, .doc, .docx, .rtf, .epub, .odt, .odp, .pptx,
.txt, .md, .html, .tex, .latex (13)
korakot /
Created August 13, 2023 14:46
Run gpt-2 within Code Interpreter
korakot / docker.txt
Created August 9, 2023 12:23
Google Colab docker
korakot / _install_packages.txt
Last active September 5, 2023 02:31
Installed packages in chatGPT VM, using !dpkg --get-selections and apt list --installed, get more from
adduser install
adwaita-icon-theme install
alsa-topology-conf install
alsa-ucm-conf install
antiword install
apt install
autoconf install
automake install
autotools-dev install
base-files install