Show Menu
Cheatography

General Cheat Sheet (DRAFT) by

Please enter at least 20 characters.

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Claude Code

/init
Initia­lizes a new Claude.md file
@Path­\to\file
Specifies your prompt context
Shift + Tab
Change Claude's mode
Thinking Modes
Changes token alloca­tion. Ascends from Think, Think More, Think a Lot, Think Longer, Ultra Think
/compact
Summarizes the session, saving tokens
/clear
Resets the conver­sation
/loop
Sets a time based action loop
/simplify
Simplifies the context of a file.
/batch
Makes changes to batches of files at the same time.

sql

\dt
list tables
'SELECT * FROM table`
INSERT INTO table
DELETE FROM table WHERE column='v'
UPDATE table SET column='v' WHERE coloum­n='v';

postgres

\dt
\l
\d
\d+
*
= all
SELECT c, c1 FROM table;
SELECT * FROM table ORDER BY c ASC OFFSET 3 LIMIT 2;
SELECT COUNT(*) FROM table;
INSERT INTO table (c,c1) VALUES ('v','­v1');
DELETE FROM table WHERE c='v';
`DELETE FROM table WHERE c LIKE '%term%';
UPDATE table SET c='v' WHERE c1='v1';
`UPDATE table SET c='v' WHERE c NOT LIKE 'te_m';
DROP TABLE table;
id SERIAL
or
PRIMARY KEY (id)
\d table
\c database

fields

TEXT
CHAR(x)
The length that any value in the column will be
VARCHAR(x)
The maximum amount of rows the tuna be stored in this table
BYTEA
Stores up to 1GB.
TIMESTAMP
YYYY-DD-MM HH:MM:SS
DATE
YYYY-DD-MM
TIME
HH:MM:SS
 

Python Operations

+, -, *, /
Basic math operations
**
Exponent
%
Remainder
//
Floor Division; divides and rounds down
import statistics
statis­tic­s.m­ean()
Finds the mean/avg of input
statis­tic­s.f­mean()
Finds the mean of input and outputs as a float
statis­tic­s.m­edian()
Finds the median of input
statis­tic­s.m­ode()
Finds the mode of the input
[a:b]
Value range between a and b
[a:b:c]
Every c value between a and b
[-a]
A values from the end

Python Lists

list = []
Creates list
list.a­ppend()
Adds value to the list
list.e­xtend()
Append, but can add multiple individual values
list.i­nse­rt(a, value)
Appends value at 'a' in the set
list.r­emove()
Removes value from the list
list.p­op(­value)
Removes value and tells you what value's
value
is
list.c­lear()
Removes ALL values from the list
list2 = list.c­opy()
Duplicates the list
list.c­ount()
Outputs the amount of times the value appears in the list
list.i­nde­x(v­alue, a, b)
Outputs the earliest 'value' in the list between the range a-b
list.r­eve­rse()
Reverses the order of the list
list.s­ort()
Sorts from least to greatest