This index is autogenerated using scripts/index.py
from all markdown files in how-to
.
Run python scripts/index.py
to re-generate this file.
File, title, and summary for each header in the how-to
directory.
- Swift References
- Swift and SwiftUI references
- Xcode
- General useful resources for xCode
- Xcode Shortcuts
- General Resources
- General useful resources for Swift and SwiftUI
hackingwithswift.com
- Homepage:
hackingwithswift.com
.
- Homepage:
- SwiftLint
- Linting tool for
Swift
andSwiftUI
.
- Linting tool for
- SwiftUI
- SwiftUI references
- List Selection
- Add the
selection: $selection_state
parameter intoList
.
- Add the
- Searchable
- Use
.searchable(text: $searchText)
to add a search bar to any view in aNavigationView
.
- Use
- List Row Seperator Insets
- In iOS 16, lists have different seperator behavior. Adjust this using new alignment:
listRowSeperatorLeading
and
- In iOS 16, lists have different seperator behavior. Adjust this using new alignment:
- Date Formatting
- Use
.formatted()
method in iOS 15+ to format dates into text. E.g.date.formatted(.dateTime.day().month().year())
- Use
- Python References
- Python notes and references
- Project Setup and Packaging
- Python project setup, packaging, tools.
- Project Structure
- Typical Project Structure:
- Project Setup
- Provide a
setup.py
to enable Python project setup.
- Provide a
- Builtin Modules and Functions
- Python built-in modules, functions, and tools.
- dataclass
- Provides
@dataclass
decorator for basic functionality for classes used to hold data. - Unpacking Dataclasses
- Use the
dataclasses.astuple(obj)
method to unpack a dataclass instance into a tuple. Note that this is recursive.
- Use the
- Dataclass
__post_init__
- Use the
__post_init__
method in dataclasses to run code immediately after initialization of the dataclass'
- Use the
- Dataclass
keyword-only __init__ parameters
- Introduced in Python 3.10, dataclasses can now be created in keyword-only mode.
- Provides
- namedtuple
- Tuple and Dictionary like objects to store values in both key-value and iterative patterns. Use
collections.namedtuple
- Tuple and Dictionary like objects to store values in both key-value and iterative patterns. Use
- Pathlib
- Python's built-in module for filesystem paths. See pathlib docs
- Get path of current file
- Use
pathlib.Path(__file__).resolve()
to get path to the current file.
- Use
- pathlib.resolve()
- Removes any symlinks and makes a path absolute.
- Collections
- The
collections.abc
module provides Abstract Base Classes for various containers. These containers provide various - Making an object subscriptable and iterable
- Providing the
__getitem__
and__setitem__
magic methods allows usage of subscripts directly on the object.
- Providing the
- The
- Asterisks
- The
*
and**
operators in python can be used in several ways, including tuple unpacking, iterator unpacking into
- The
- Single Line if else
- For example:
value = <value_if_true> if <expression> else <value_if_else>
- For example:
- Packages and Tools
- Useful packages and Python related tools such as
pip
,virtualenv
,pipenv
,conda
. - Pendulum
- Drop in replacement for datetime with cleaner API and better complex use-cases support.
- SqlModel
- Built on SQLAlchemy, provides ORM for Python. Works great with FastAPI.
- Conda Install and Setup
- See https://docs.conda.io/en/latest/miniconda.html for install link. Use
miniconda
as it doesn't download all packages
- See https://docs.conda.io/en/latest/miniconda.html for install link. Use
- Useful packages and Python related tools such as
- General References
- General notes and references that don't yet warrant a separate file.
- Cheat Sheets
- Shortcuts and syntax cheat sheets
- Pycharm
- Pycharm references
- Pycharm Shortcuts
- Pycharm Source Code Navigation
- Pycharm Terminal PowerShell Execution Policy (Windows)
- Run
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
in PowerShell
- Run
- Vimium Shortcuts
- See vimium shortcuts.
- Markdown Cheat Sheet
- See markdown cheat sheet.
- General Issues
- General issues and solutions
- Monorepo Frontend+Backend Project Setup With Jetbrains IDEs
- When prototyping Frontend+Backend projects, the backend might need to be placed in a subdirectory of the frontend, to
- GIT References
- General info and references for git.
- Move local repo to a fork after cloning
- Steps for changing local repo from clone of remote repo to fork of repo.
- Frontend References
- Javascript, Typescript, React, Next.JS references. For now, catch-all while I give myself a frontend
- Envrionment Setup
- Environment setup for frontend dev.
- node.js and npm
- Use nvm, a node version manager, to install node.
- next.js and React
- Use
npm install next@latest react@latest react-dom@latest
ornpx create-next-app@latest
for auto setup.
- Use
- Getting Started
- Getting started...
- next.js boilerplate
- Installing Prettier and Prettier Configuration
- To add prettier to a project, run
npm install prettier --save-dev
- To add prettier to a project, run
- Tailwind CSS
- Install prettier plugin for tailwind, to automatically sort tailwind classes.
- Storybook and NextJS integration
- When integrating Storybook with NextJS, may need to manually add the following to
.storybook/main.js
:
- When integrating Storybook with NextJS, may need to manually add the following to
- Vercel Serverless Functions
- Note: Can't seem to use both Node and non-node serverless functions in the same project.
- Libraries and Tools
- Useful libraries and tools.
- Authentication next-auth