git status --short
Show staged, changed, and untracked files.
Search Git, Docker, Next.js 16, and PyTorch commands. Copy a command to adapt it to your project.
38 commands
git status --short
Show staged, changed, and untracked files.
git switch -c feature/my-change
Create and switch to a branch.
git add path/to/file
Stage a file for the next commit.
git commit -m "feat: add feature"
Commit the staged changes.
git diff
Inspect changes outside the staging area.
git diff --cached
Inspect changes queued for commit.
git log --oneline --graph -15
Show recent commits and branches.
git fetch --prune
Refresh references and remove deleted remote branches.
git stash push -u -m "work in progress"
Stash changes, including untracked files.
git revert <commit>
Create a new commit reversing a previous change.
docker build -t my-app:latest .
Build from the current Dockerfile.
docker run --rm -p 3000:3000 my-app:latest
Run an image and expose its port.
docker ps
Show running containers.
docker logs -f <container>
Follow standard output and error.
docker exec -it <container> sh
Open a shell in a running container.
docker compose up -d
Start services in the background.
docker compose down
Stop and remove the stack containers.
docker volume ls
Show persistent volumes.
docker image inspect my-app:latest
Inspect image metadata.
npm run dev
Start the project development script.
npm run build
Build and prerender eligible pages.
npm run start
Serve the previously built app.
'use client';
Place at the top of interactive browser components.
const { slug } = await params;Read App Router dynamic parameters in Next.js 16.
export function generateStaticParams() { return [{ slug: "intro" }]; }Enumerate dynamic pages for build-time generation.
return Response.json({ ok: true });Return JSON from an App Router route handler.
export function proxy(request) { /* authorize or rewrite */ }Next.js 16 uses proxy.ts in place of middleware.ts.
export const metadata = { title: "My page" };Define metadata in a server page or layout.
x = torch.tensor([1.0, 2.0, 3.0])
Create a float tensor.
x.shape
Inspect dimensions.
device = "cuda" if torch.cuda.is_available() else "cpu"
Use an available GPU, otherwise CPU.
model = model.to(device)
Place model parameters on the selected device.
x = torch.tensor([1.0], requires_grad=True)
Enable automatic differentiation.
loss.backward()
Calculate gradients from a scalar loss.
optimizer.zero_grad() loss.backward() optimizer.step()
Clear gradients, backpropagate, and update parameters.
model.eval()
with torch.inference_mode():
output = model(x)Evaluate without gradient tracking.
torch.save(model.state_dict(), "weights.pt")
Persist model parameter tensors.
model.load_state_dict(torch.load("weights.pt", weights_only=True))Load trusted weights into the matching model.