Discover gists
| User: ISHAAN,glaitm | |
| Key: 27R3VDEFYFX4N0VC3FRTQZX |
| # start from home directory | |
| cd $HOME | |
| # get Bazel dist from https://github.com/bazelbuild/bazel/releases | |
| $ wget https://github.com/bazelbuild/bazel/releases/download/0.4.5/bazel-0.4.5-dist.zip | |
| # unzip Bazel | |
| unzip bazel-0.4.5-dist.zip -d bazel | |
| # compile Bazel |
| # !/usr/bin/env python | |
| # coding:UTF-8 | |
| import requests, json, re | |
| from datetime import datetime | |
| html = requests.get('http://med.cgh.org.tw/unit/branch/Pharmacy/ebl/RealTimeInfoHC.html', verify=False) | |
| keys = ['pending_doctor', 'pending_bed', 'pending_ward', 'pending_icu'] | |
| pending0 = re.findall(r"<td(.*?)>(.+?)</td>", html.text) |
| #!/usr/bin/env python | |
| #coding:UTF-8 | |
| import requests, re, json, os | |
| from datetime import datetime | |
| os.environ['TZ'] = 'ROC' | |
| html = requests.get('http://med.cgh.org.tw/unit/branch/Pharmacy/ebl/RealTimeInfoHQ.html') | |
| html.encoding='big5' | |
| update_time = re.findall(u'時間:(.*)</p>',html.text) | |
| pending = re.findall(u':</td *>(.+?)</td>',html.text) |
| #!/usr/bin/env python | |
| #coding:UTF-8 | |
| import requests, re, json, os | |
| from datetime import datetime | |
| os.environ['TZ'] = 'ROC' | |
| headers = {"Accept": "*/*", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", "User-Agent": " Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36"} | |
| data = {'RadioButtonList1': '2', '__EVENTARGUMENT': '', '__EVENTTARGET': 'RadioButtonList1$1', '__EVENTVALIDATION': '/wEWBQKuhbKKAwL444i9AQL544i9AQL3jKLTDQKM54rGBiyOzv44KJOw6BT65+syY0+hyJGU', '__LASTFOCUS': '', '__VIEWSTATE': '/wEPDwUKLTg4MTI3NDI5MQ9kFgICAw9kFgQCBQ8QZGQWAWZkAgcPPCsADQEADxYEHgtfIURhdGFCb3VuZGceC18hSXRlbUNvdW50AgZkFgJmD2QWDgIBD2QWBGYPDxYCHgRUZXh0BQ/oqIrmga/mmYLplpPvvJpkZAIBDw8WAh8CBRUyMDE3LzMvMyDkuIvljYggMDI6MDlkZAICD2QWBGYPDxYCHwIFIeW3suWQkTExOemAmuWgsea7v+W6iu+8iOi8ie+8ie+8mmRkAgEPDxYCHwIFA+WQpmRkAgMPZBYEZg8PFgIfAgUV562J5b6F55yL6Ki65Lq65pW477yaZGQCAQ8PFgIfAgUBNWRkAgQPZBYEZg8PFgIfAgUV562J5b6F5o6o5bqK5Lq65pW477yaZGQCAQ8PFgIfAgUBMGRkAgUPZBYEZg8PFgIfAgUV562J |
| # !/usr/bin/env python | |
| # coding:UTF-8 | |
| import requests, json, re | |
| from datetime import datetime | |
| requests.packages.urllib3.disable_warnings() | |
| html = requests.get('https://wapps.mmh.org.tw/WebEMR/WebEMR/Default.aspx?a=HC', verify=False) | |
| keys = ['pending_doctor', 'pending_bed', 'pending_ward', 'pending_icu'] |
| blueprint: | |
| name: KNX - relative dimming for lights | |
| description: Control Home Assistant light entities from KNX switching and relative dimming (DPT 3.007) telegrams. | |
| homeassistant: | |
| # `knx.telegram` trigger and `enabled` templates require Home Assistant 2024.6.0 | |
| min_version: "2024.6.0" | |
| domain: automation | |
| input: | |
| target_lights: | |
| name: Light |
| # Ver.2024.2 | |
| import re | |
| # printTable is a helper function for formatting and printing the DP table. >>> DO NOT MODIFY <<< | |
| def printTable(table, x, y, description): | |
| print(f'\033[1m{description}\n') | |
| current_row = current_col = -1 | |
| current_row_col = re.search("^row ([0-9]+) , col ([0-9]+)$",description) | |
| if current_row_col: | |
| current_row = int(current_row_col.group(1)) | |
| current_col= int(current_row_col.group(2)) |
A pattern for building personal knowledge bases using LLMs.
This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.
Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.
