- Give Agents concise maps, not encyclopedias
- Keep [AGENTS.md] short (< 100 lines) and progressively disclose through references.
# CLAUDE.md# CLAUDE.md| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
If you are on a Mac, substitute command for control. Don't type the + (it means press both keys at once).
Shift + Enter run selected cell or cells - if no cells below, insert a code cell below
Ctrl + B toggle hide/show left sidebar
Ctrl + S save and checkpoint
Ctrl + Shift + S save as
The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.
However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on
| export const status = { | |
| TIMEOUT: 'timeout', | |
| SUCCESS: 'success', | |
| SKIPPED: 'skipped' | |
| }; | |
| /** | |
| * Load a JS script programmatically. | |
| * | |
| * The <script> element get inserted as the last child of <body> by default but can be customized |
| /** | |
| * NestedHistory | |
| * ------------- | |
| * | |
| * TODO: doc | |
| * | |
| */ | |
| import _ from 'underscore'; |
| import Marionette from 'backbone.marionette'; | |
| import Hammer from 'hammerjs'; | |
| import $ from 'jquery'; | |
| import _ from 'underscore'; | |
| export default Marionette.Behavior.extend({ | |
| defaults: { | |
| threshold: 30 | |
| }, |
| #### | |
| # ZSH function to auto-switch to correct Node version | |
| # https://gist.github.com/callumlocke/30990e247e52ab6ac1aa98e5f0e5bbf5 | |
| # | |
| # - Searches up your directory tree for the closest .nvmrc, just like `nvm use` does. | |
| # | |
| # - If you are already on the right Node version, IT DOES NOTHING, AND PRINTS NOTHING. | |
| # | |
| # - Works correctly if your .nvmrc file contains something relaxed/generic, | |
| # like "4" or "v12.0" or "stable". |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)