Repository: Fechin/reference
Branch: main
Commit: 21e17efe52cf
Files: 310
Total size: 2.9 MB
Directory structure:
gitextract_fq7cognz/
├── .commitlintrc.js
├── .dockerignore
├── .github/
│ ├── FUNDING.yml
│ └── ISSUE_TEMPLATE/
│ └── cheatsheet-request.md
├── .gitignore
├── .gitmessage
├── .husky/
│ ├── commit-msg
│ └── pre-commit
├── .lintstagedrc.js
├── .prettierrc.js
├── .stylelintrc.js
├── Dockerfile
├── LICENSE
├── README.md
├── _config.yml
├── eslint.config.js
├── gulpfile.js
├── nginx.conf
├── package.json
├── postcss.config.js
├── source/
│ ├── _posts/
│ │ ├── 1password.md
│ │ ├── adobe-lightroom.md
│ │ ├── adobe-photoshop.md
│ │ ├── adobe-xd.md
│ │ ├── affinity-designer.md
│ │ ├── affinity-photo.md
│ │ ├── ai.md
│ │ ├── airtable.md
│ │ ├── alan-ai.md
│ │ ├── alpine-linux.md
│ │ ├── android-studio.md
│ │ ├── apex-legends.md
│ │ ├── apple-music.md
│ │ ├── arduino-programming.md
│ │ ├── arduino.md
│ │ ├── asana.md
│ │ ├── ascii-code.md
│ │ ├── aspect-ratio.md
│ │ ├── audacity.md
│ │ ├── awk.md
│ │ ├── bash.md
│ │ ├── bear-notes.md
│ │ ├── bitbucket.md
│ │ ├── blender.md
│ │ ├── brave.md
│ │ ├── c.md
│ │ ├── canvas.md
│ │ ├── chatgpt.md
│ │ ├── chmod.md
│ │ ├── chrome-devtools.md
│ │ ├── code-editor-ios.md
│ │ ├── color-picker.md
│ │ ├── colorscreen.md
│ │ ├── conventional-commits.md
│ │ ├── cpp.md
│ │ ├── cron.md
│ │ ├── cs.md
│ │ ├── css3.md
│ │ ├── curl.md
│ │ ├── dart.md
│ │ ├── django.md
│ │ ├── docker.md
│ │ ├── ejs.md
│ │ ├── emacs.md
│ │ ├── emmet.md
│ │ ├── emoji.md
│ │ ├── es6.md
│ │ ├── express.md
│ │ ├── fastapi.md
│ │ ├── feedly.md
│ │ ├── figma.md
│ │ ├── filezilla.md
│ │ ├── find.md
│ │ ├── finder.md
│ │ ├── firefox.md
│ │ ├── flask.md
│ │ ├── fortnite.md
│ │ ├── framer-x.md
│ │ ├── gimp.md
│ │ ├── git.md
│ │ ├── github-actions.md
│ │ ├── github-cli.md
│ │ ├── github.md
│ │ ├── gitlab.md
│ │ ├── gmail.md
│ │ ├── gnome-desktop.md
│ │ ├── gnupg.md
│ │ ├── go.md
│ │ ├── google-chrome.md
│ │ ├── google-drive.md
│ │ ├── google-search.md
│ │ ├── gospinwheel.md
│ │ ├── graphql.md
│ │ ├── grep.md
│ │ ├── guitar-pro.md
│ │ ├── homebrew.md
│ │ ├── hook.md
│ │ ├── html-char.md
│ │ ├── html.md
│ │ ├── htmx.md
│ │ ├── http-status-code.md
│ │ ├── idea.md
│ │ ├── ini.md
│ │ ├── iso-639-1.md
│ │ ├── java.md
│ │ ├── javascript.md
│ │ ├── jest.md
│ │ ├── jira.md
│ │ ├── jquery.md
│ │ ├── json.md
│ │ ├── kanbanmail.md
│ │ ├── kotlin.md
│ │ ├── kubernetes.md
│ │ ├── laravel.md
│ │ ├── latex.md
│ │ ├── lsof.md
│ │ ├── lua.md
│ │ ├── markdown.md
│ │ ├── matlab.md
│ │ ├── matplotlib.md
│ │ ├── microsoft-teams.md
│ │ ├── mime.md
│ │ ├── minecraft-bedrock.md
│ │ ├── minecraft-java.md
│ │ ├── missive.md
│ │ ├── mitmproxy.md
│ │ ├── monday.md
│ │ ├── mongodb.md
│ │ ├── mysql.md
│ │ ├── nc.md
│ │ ├── neo4j.md
│ │ ├── netstat.md
│ │ ├── networkports.md
│ │ ├── nginx.md
│ │ ├── nim.md
│ │ ├── nix.md
│ │ ├── nmap.md
│ │ ├── notion.md
│ │ ├── npm.md
│ │ ├── numpy.md
│ │ ├── obsidian.md
│ │ ├── ocaml.md
│ │ ├── openssl.md
│ │ ├── origami.md
│ │ ├── outlook.md
│ │ ├── pandas.md
│ │ ├── pandoc.md
│ │ ├── perl.md
│ │ ├── php.md
│ │ ├── phpstorm.md
│ │ ├── pm2.md
│ │ ├── pocket.md
│ │ ├── postgres.md
│ │ ├── postman.md
│ │ ├── powershell.md
│ │ ├── principle.md
│ │ ├── proto-io.md
│ │ ├── putty.md
│ │ ├── python.md
│ │ ├── pytorch.md
│ │ ├── quickref.md
│ │ ├── quip.md
│ │ ├── react-test-library.md
│ │ ├── react.md
│ │ ├── reddit.md
│ │ ├── redis.md
│ │ ├── regex.md
│ │ ├── resolutions.md
│ │ ├── roam.md
│ │ ├── ruby.md
│ │ ├── rust.md
│ │ ├── sass.md
│ │ ├── screen.md
│ │ ├── sdkman.md
│ │ ├── sed.md
│ │ ├── selenium.md
│ │ ├── sequel-pro.md
│ │ ├── shopify.md
│ │ ├── sketch.md
│ │ ├── sketchup.md
│ │ ├── skype.md
│ │ ├── slack.md
│ │ ├── socket-io.md
│ │ ├── soundcloud.md
│ │ ├── spotify.md
│ │ ├── ssh.md
│ │ ├── sublime-text.md
│ │ ├── superhuman.md
│ │ ├── svelte.md
│ │ ├── swift.md
│ │ ├── symfony.md
│ │ ├── systemd.md
│ │ ├── table-plus.md
│ │ ├── taskset.md
│ │ ├── telegram.md
│ │ ├── telnet.md
│ │ ├── tensorflow.md
│ │ ├── terraform.md
│ │ ├── ticktick.md
│ │ ├── tmux.md
│ │ ├── todoist.md
│ │ ├── toml.md
│ │ ├── transmit.md
│ │ ├── trello.md
│ │ ├── twitter.md
│ │ ├── typescript.md
│ │ ├── unity-3d.md
│ │ ├── unity-shader-graph.md
│ │ ├── unreal-engine.md
│ │ ├── vhdl.md
│ │ ├── vim.md
│ │ ├── vivaldi.md
│ │ ├── vlc.md
│ │ ├── vscode.md
│ │ ├── vue.md
│ │ ├── webflow.md
│ │ ├── webstorm.md
│ │ ├── windows-cmd.md
│ │ ├── windows-shortcuts.md
│ │ ├── wordpress.md
│ │ ├── xpath.md
│ │ ├── yaml.md
│ │ ├── youtube.md
│ │ ├── zed.md
│ │ └── zoom.md
│ ├── about/
│ │ └── index.md
│ ├── assets/
│ │ └── page/
│ │ └── oops.htm
│ ├── ga_analytics_tops.json
│ ├── manifest.json
│ ├── notes/
│ │ └── index.md
│ ├── privacy/
│ │ └── index.md
│ ├── robots.txt
│ ├── sponsor/
│ │ └── index.md
│ ├── support/
│ │ └── index.md
│ ├── sw.js
│ └── widget/
│ ├── chmod.html
│ ├── color-palette-tailwind.html
│ ├── cron.html
│ └── gradient-maker.html
├── tailwind.config.js
└── themes/
└── coo/
├── _config.yml
├── languages/
│ └── default.yml
├── layout/
│ ├── _partial/
│ │ ├── buttons/
│ │ │ ├── buy-coffee.ejs
│ │ │ ├── follow-x.ejs
│ │ │ ├── github-contribute.ejs
│ │ │ └── github-star.ejs
│ │ ├── comment.ejs
│ │ ├── footer.ejs
│ │ ├── head.ejs
│ │ ├── header.ejs
│ │ ├── index/
│ │ │ ├── card.ejs
│ │ │ ├── hero-content.ejs
│ │ │ ├── hero.ejs
│ │ │ ├── logo.ejs
│ │ │ ├── recommend.ejs
│ │ │ └── request.ejs
│ │ ├── note/
│ │ │ ├── header.ejs
│ │ │ ├── tags.ejs
│ │ │ └── title.ejs
│ │ ├── pagination.ejs
│ │ ├── post/
│ │ │ ├── category.ejs
│ │ │ ├── editbar.ejs
│ │ │ ├── popular.ejs
│ │ │ ├── popular_card.ejs
│ │ │ ├── prevnext.ejs
│ │ │ ├── recent.ejs
│ │ │ ├── tag.ejs
│ │ │ └── title.ejs
│ │ ├── scripts.ejs
│ │ ├── search.ejs
│ │ ├── seo.ejs
│ │ ├── share.ejs
│ │ ├── sidebar.ejs
│ │ ├── social-buttons.ejs
│ │ ├── structured-data.ejs
│ │ └── toc.ejs
│ ├── archive.ejs
│ ├── index.ejs
│ ├── layout.ejs
│ ├── note.ejs
│ ├── notes.ejs
│ ├── page.ejs
│ └── post.ejs
├── scripts/
│ ├── add_field.js
│ ├── donation.js
│ ├── github.js
│ ├── global.js
│ ├── markdown_plugin.js
│ ├── merge_configs.js
│ ├── pagination_generator.js
│ ├── seo-enhanced.js
│ ├── seo.js
│ ├── share.js
│ └── top_generator.js
└── source/
├── css/
│ ├── components/
│ │ ├── code.css
│ │ ├── common.css
│ │ ├── custom_tag.css
│ │ ├── layer.css
│ │ ├── layout_list.css
│ │ ├── layout_note.css
│ │ ├── layout_paragraph.css
│ │ ├── layout_table.css
│ │ ├── navbar.css
│ │ ├── pagination.css
│ │ ├── search.css
│ │ ├── social-buttons.css
│ │ └── toc.css
│ └── style.tailwindcss
└── js/
├── fuse_7.1.0.js
└── main.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .commitlintrc.js
================================================
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'feat', // new feature
'fix', // bug fix
'docs', // documentation update
'style', // code formatting, no logic changes
'refactor', // code refactoring
'perf', // performance optimization
'test', // add tests
'chore', // build process or auxiliary tool changes
'ci', // CI/CD related changes
'build', // build system or external dependency changes
'revert' // revert commit
]
],
'scope-enum': [
2,
'always',
[
'search', // search functionality
'theme', // theme related
'css', // style files
'js', // JavaScript files
'content', // content files
'build', // build related
'deps', // dependency updates
'config', // configuration files
'docs', // documentation
'layout', // layout templates
'widget', // components
'gulp', // Gulp tasks
'hexo', // Hexo related
'markdown', // Markdown processing
'seo', // SEO optimization
'a11y', // accessibility
'perf' // performance related
]
],
'subject-case': [2, 'never', ['start-case', 'pascal-case', 'upper-case']],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never']
}
};
================================================
FILE: .dockerignore
================================================
node_modules/
test
*.log
Dockerfile*
README.md
LICENSE
style.tailwindcss
.idea/
.github/
.travis.yml
.eslintignore
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: Fechin # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ["https://coff.ee/cheatsheets.zip"]
================================================
FILE: .github/ISSUE_TEMPLATE/cheatsheet-request.md
================================================
---
name: Cheatsheet request
about: For request cheatsheet and reference.
title: 'Cheatsheet request: '
labels: request
assignees: Fechin
---
================================================
FILE: .gitignore
================================================
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
nohup.out
*.tmp
*.temp
# Environment files #
######################
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
.python-version
.venv
.ipynb_checkpoints
# Logs #
######################
*.log
logs/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Editor files #
######################
.idea/
.vscode/
*.swp
*.swo
*~
.vim/
.emacs.d/
.sublime-*
# Node.js #
######################
node_modules/
dist/
build/
coverage/
.nyc_output/
.cache/
.parcel-cache/
.next/
.nuxt/
.vuepress/dist/
.serverless/
.fusebox/
.dynamodb/
.tern-port
package-lock.json
# Testing #
######################
.jest/
.coverage/
junit.xml
test-results/
# Build artifacts #
######################
themes/coo/source/css/style.css
public/
db.json
*.tgz
*.tar.gz
# Security #
######################
.npmrc
.yarnrc
.pnpm-store/
# Misc #
######################
.eslintcache
.stylelintcache
.prettierignore
================================================
FILE: .gitmessage
================================================
# Blue, 18-point textProgramming
- [Bash](https://cheatsheets.zip/bash.html): This is a quick reference cheat sheet to getting started with Linux bash
shell scripting.
- [C](https://cheatsheets.zip/c.html): C quick reference cheat sheet that provides basic syntax and methods.
- [C++](https://cheatsheets.zip/cpp.html): C++ quick reference cheat sheet that provides basic syntax and methods.
- [C#](https://cheatsheets.zip/cs.html): C# quick reference cheat sheet that provides basic syntax and methods.
- [CSS 3](https://cheatsheets.zip/css.html): This is a quick reference cheat sheet for CSS goodness, listing selector
syntax, properties, units and other useful bits of information.
- [Dart](https://cheatsheets.zip/dart.html): A Dart cheat sheet with the most important concepts, functions, methods,
and more. A complete quick reference for beginners.
- [Docker](https://cheatsheets.zip/docker.html): This is a quick reference cheat sheet for
[Docker](https://docs.docker.com/get-started/). And you can find the most common Docker commands here.
- [ES6](https://cheatsheets.zip/es6.html): A quick reference cheat sheet of what’s new in JavaScript for ES2015, ES2016,
ES2017, ES2018 and beyond
- [Go](https://cheatsheets.zip/go.html): This cheat sheet provided basic syntax and methods to help you using
[Go](https://go.dev/).
- [GraphQL](https://cheatsheets.zip/graphql.html): This quick reference cheat sheet provides a brief overview of
GraphQL.
- [Hook](https://cheatsheets.zip/hook.html): The [Hook](https://github.com/hook-lang/hook/) cheat sheet is a one-page
reference sheet for the Hook programming language.
- [HTML](https://cheatsheets.zip/html.html): This HTML quick reference cheat sheet lists the common HTML and HTML5 tags
in readable layout.
- [INI](https://cheatsheets.zip/ini.html): This is a quick reference cheat sheet for understanding and writing
INI-format configuration files.
- [Java](https://cheatsheets.zip/java.html): This cheat sheet is a crash course for Java beginners and help review the
basic syntax of the Java language.
- [JavaScript](https://cheatsheets.zip/javascript.html): A JavaScript cheat sheet with the most important concepts,
functions, methods, and more. A complete quick reference for beginners.
- [jQuery](https://cheatsheets.zip/jquery.html): This [jQuery](https://jquery.com/) cheat sheet is a great reference for
both beginners and experienced developers.
- [Kubernetes](https://cheatsheets.zip/kubernetes.html): This page contains a list of commonly used kubectl commands and
flags.
- [LaTeX](https://cheatsheets.zip/latex.html): This cheat sheet summarizes a reference list of
[LaTeX](https://www.latex-project.org/) commonly used display math notation and some application examples of
[KaTeX](https://katex.org/).
- [Laravel](https://cheatsheets.zip/laravel.html): [Laravel](https://laravel.com/docs/8.x/) is an expressive and
progressive web application framework for PHP. This cheat sheet provides a reference for common commands and features
for Laravel 8.
- [MATLAB](https://cheatsheets.zip/matlab.html): This quick reference cheat sheet provides an example introduction to
using the [MATLAB](https://mathworks.cn/) scientific computing language to get started quickly
- [Markdown](https://cheatsheets.zip/markdown.html): This is a quick reference cheat sheet to the Markdown syntax.
- [PHP](https://cheatsheets.zip/php.html): This [PHP](https://www.php.net/manual/en/) cheat sheet provides a reference
for quickly looking up the correct syntax for the code you use most frequently.
- [Python](https://cheatsheets.zip/python.html): The [Python](https://www.python.org/) cheat sheet is a one-page
reference sheet for the Python 3 programming language.
- [Rust](https://cheatsheets.zip/rust.html): The Rust quick reference cheat sheet that aims at providing help on writing
basic syntax and methods.
- [Sass](https://cheatsheets.zip/sass.html): This is a quick reference cheat sheet that lists the most useful features
of [SASS](https://sass-lang.com).
- [TOML](https://cheatsheets.zip/toml.html): This is a quick reference cheat sheet to the TOML format configuration file
syntax.
- [VHDL](https://cheatsheets.zip/vhdl.html): VHDL (VHSIC Hardware Description Language) cheat sheet - A comprehensive reference for digital hardware design and simulation.
- [YAML](https://cheatsheets.zip/yaml.html): This is a quick reference cheat sheet for understanding and writing YAML
format configuration files.
Toolkit
- [ChatGPT](https://cheatsheets.zip/chatgpt.html): This cheat sheet lists out prompts and tips from all over the world
on how to use ChatGPT effectively
- [VSCode](https://cheatsheets.zip/vscode.html): This VSCode (Visual Studio Code) quick reference cheat sheet shows its
keyboard shortcuts and commands.
- [Mitmproxy](https://cheatsheets.zip/mitmproxy.html): [Mitmproxy](https://mitmproxy.org/) is a free and open source
interactive HTTPS proxy. This is a quick reference cheat sheet to the Mitmproxy.
- [XPath](https://cheatsheets.zip/xpath.html): This is an [XPath](https://en.wikipedia.org/wiki/XPath) selectors cheat
sheet, which lists commonly used XPath positioning methods and CSS selectors
- [Emacs](https://cheatsheets.zip/emacs.html): [Emacs](https://www.gnu.org/software/emacs) is the extensible,
customizable, self-documenting real time display text editor. This reference was made for Emacs 27.
- [Emmet](https://cheatsheets.zip/emmet.html): [Emmet](https://emmet.io/) is a web-developer’s toolkit for boosting HTML
& CSS code writing, which allows you to write large HTML code blocks at speed of light using well-known CSS selectors.
- [RegEX](https://cheatsheets.zip/regex.html): A quick reference for regular expressions (regex), including symbols,
ranges, grouping, assertions and some sample patterns to get you started.
- [Vim](https://cheatsheets.zip/vim.html): A useful collection of [Vim](http://www.vim.org/) 8.2 quick reference cheat
sheets to help you learn vim editor faster.
Linux Command
- [Curl](https://cheatsheets.zip/curl.html): This [Curl](https://github.com/curl/curl) cheat sheet contains commands and
examples of some common Curl tricks.
- [PM2](https://cheatsheets.zip/pm2.html): [PM2] is a daemon process manager that will help you manage and keep your
application online. Getting started with PM2 is straightforward, it is offered as a simple and intuitive CLI.
- [Chmod](https://cheatsheets.zip/chmod.html): This quick reference cheat sheet provides a brief overview of file
permissions, and the operation of the chmod command
- [Tmux](https://cheatsheets.zip/tmux.html): The tmux cheat sheet quick reference of most commonly used shortcuts and
commands
- [Lsof](https://cheatsheets.zip/lsof.html): This quick reference cheat sheet provides various for using lsof command.
- [SSH](https://cheatsheets.zip/ssh.html): This quick reference cheat sheet provides various for using SSH.
- [Netstat](https://cheatsheets.zip/netstat.html): This quick reference cheat sheet provides various for using netstat
command.
- [Screen](https://cheatsheets.zip/screen.html): This is a quick reference guide cheat sheet for the screen command.
- [Awk](https://cheatsheets.zip/awk.html): This is a one page quick reference cheat sheet to the
[GNU awk](https://www.gnu.org/software/gawk/manual/gawk.html), which covers commonly used awk expressions and
commands.
- [Find](https://cheatsheets.zip/find.html): This is a quick reference list of cheat sheet for Linux find command,
contains common options and examples.
- [Sed](https://cheatsheets.zip/sed.html): [Sed](https://www.gnu.org/software/sed/manual/sed.html) is a stream editor,
this sed cheat sheet contains sed commands and some common sed tricks.
- [Cron](https://cheatsheets.zip/cron.html): [Cron](https://en.wikipedia.org/wiki/Cron) is most suitable for scheduling
repetitive tasks. Scheduling one-time tasks can be accomplished using the associated at utility.
- [Git](https://cheatsheets.zip/git.html): This cheat sheet summarizes commonly used Git command line instructions for
quick reference.
- [Grep](https://cheatsheets.zip/grep.html): This cheat sheet is intended to be a quick reminder for the main concepts
involved in using the command line program grep and assumes you already understand its usage.
- [Netcat](https://cheatsheets.zip/nc.html): This cheat sheet provides various for using netcat on both Linux and Unix.
- [Taskset](https://cheatsheets.zip/taskset): This quick reference cheat sheet for tasket command.
- [GnuPG](https://cheatsheets.zip/gnupg): A cheatsheet for GnuPG, the encryption and signing software.
Python
- [NumPy](https://cheatsheets.zip/numpy.html): [NumPy](https://numpy.org/) is the fundamental package for scientific
computing with Python. This cheat sheet is a quick reference for NumPy beginners.
- [Pandas](https://cheatsheets.zip/pandas.html): [Pandas](https://pandas.pydata.org/) is a powerful data analysis and
manipulation library for Python. This quick reference cheat sheet provides an overview of essential Pandas functions,
methods, and DataFrame operations.
Database
- [MySQL](https://cheatsheets.zip/mysql.html): The SQL cheat sheet provides you with the most commonly used SQL
statements for your reference.
- [Neo4j](https://cheatsheets.zip/neo4j.html): A Neo4j cheat sheet with getting started resources and information on how
to query the database with Cypher.
- [PostgreSQL](https://cheatsheets.zip/postgres.html): The [PostgreSQL](https://www.postgresql.org/docs/current/) cheat
sheet provides you with the common PostgreSQL commands and statements.
- [Redis](https://cheatsheets.zip/redis.html): This is a [Redis](https://redis.io/) quick reference cheat sheet that
lists examples of redis commands
Keyboard Shortcuts
- [Adobe Photoshop](https://cheatsheets.zip/adobe-photoshop.html): A visual cheat-sheet for the 283 keyboard shortcuts
found in Adobe Photoshop
- [Apex Legends](https://cheatsheets.zip/apex-legends.html): A visual cheat-sheet for the 27 default keyboard shortcuts
found in Apex Legends
- [Figma](https://cheatsheets.zip/figma.html): A visual cheat-sheet for the 119 keyboard shortcuts found in Figma
- [Microsoft Teams](https://cheatsheets.zip/microsoft-teams.html): A visual cheat-sheet for the 38 keyboard shortcuts
found in Microsoft Teams
- [TablePlus](https://cheatsheets.zip/table-plus.html): A visual cheat-sheet for the 34 keyboard shortcuts found in
TablePlus
- [Bear](https://cheatsheets.zip/bear-notes.html): A visual cheat-sheet for the 66 keyboard shortcuts found in Bear.
This application is MacOS-only.
- [Feedly](https://cheatsheets.zip/feedly.html): A visual cheat-sheet for the 25 keyboard shortcuts found on the Feedly
app
- [FileZilla](https://cheatsheets.zip/filezilla.html): A visual cheat-sheet for the 30 keyboard shortcuts found on the
FileZilla program
- [Reddit](https://cheatsheets.zip/reddit.html): A visual cheat-sheet for the 17 keyboard shortcuts found on Reddit.com
- [Slack](https://cheatsheets.zip/slack.html): A visual cheat-sheet for the 62 keyboard shortcuts found in Slack
- [SoundCloud](https://cheatsheets.zip/soundcloud.html): A visual cheat-sheet for the 22 keyboard shortcuts found on
SoundCloud
- [Twitter](https://cheatsheets.zip/twitter.html): A visual cheat-sheet for the 26 keyboard shortcuts found on Twitter
- [Android Studio](https://cheatsheets.zip/android-studio.html): A visual cheat-sheet for the 130 keyboard shortcuts
found in the Android Studio software
- [Github](https://cheatsheets.zip/github.html): A visual cheat-sheet for the 80 keyboard shortcuts found on Github.com
- [Shopify](https://cheatsheets.zip/shopify.html): A visual cheat-sheet for the 50 keyboard shortcuts found on the
Shopify website
- [Zoom](https://cheatsheets.zip/zoom.html): A visual cheat-sheet for the 32 keyboard shortcuts found in Zoom. These
shortcuts are for MacOS, for Windows visit /zoom-windows.
- [Adobe XD](https://cheatsheets.zip/adobe-xd.html): A visual cheat-sheet for the 97 keyboard shortcuts found in Adobe
XD
- [Firefox](https://cheatsheets.zip/firefox.html): A visual cheat-sheet for the 116 keyboard shortcuts found in Firefox
- [PhpStorm](https://cheatsheets.zip/phpstorm.html): A visual cheat-sheet for the 96 keyboard shortcuts found in
JetBrains PhpStorm
- [Postman](https://cheatsheets.zip/postman.html): A visual cheat-sheet for the 23 keyboard shortcuts found in Postman
- [Webflow](https://cheatsheets.zip/webflow.html): A visual cheat-sheet for the 41 keyboard shortcuts found in Webflow
- [Adobe Lightroom CC](https://cheatsheets.zip/adobe-lightroom.html): A visual cheat-sheet for the 251 keyboard
shortcuts found in Adobe Lightroom CC
- [1Password](https://cheatsheets.zip/1password.html): A cheat sheet for 1password's keyboard shortcuts in Mac, Windows,
iOS, Linux.
- [Affinity Designer](https://cheatsheets.zip/affinity-designer.html): A visual cheat-sheet for the 108 keyboard
shortcuts found in Affinity Designer
- [Pocket](https://cheatsheets.zip/pocket.html): A visual cheat-sheet for the 36 keyboard shortcuts found on Pocket for
Web
- [Trello](https://cheatsheets.zip/trello.html): A visual cheat-sheet for the 29 keyboard shortcuts found on Trello
- [Audacity](https://cheatsheets.zip/audacity.html): A visual cheat-sheet for the 135 default keyboard shortcuts found
in Audacity
- [Framer X](https://cheatsheets.zip/framer-x.html): A visual cheat-sheet for the 45 keyboard shortcuts found in Framer
X. This application is MacOS-only.
- [Google Drive](https://cheatsheets.zip/google-drive.html): A visual cheat-sheet for the 54 keyboard shortcuts found in
Google Drive on the web
- [PuTTy](https://cheatsheets.zip/putty.html): A visual cheat-sheet for the 32 keyboard shortcuts found on the PuTTy app
- [Sequel Pro](https://cheatsheets.zip/sequel-pro.html): A visual cheat-sheet for the 71 keyboard shortcuts found in
Sequel Pro. This application is MacOS-only.
- [Apple Music](https://cheatsheets.zip/apple-music.html): A visual cheat-sheet for the 62 keyboard shortcuts found in
the Apple Music app. This application is MacOS-only.
- [Blender](https://cheatsheets.zip/blender.html): A visual cheat-sheet for the 187 keyboard shortcuts found in Blender
- [Obsidian](https://cheatsheets.zip/obsidian.html): A visual cheat-sheet for the 17 keyboard shortcuts found in the
Obsidian knowledge base app.
- [Telegram Desktop](https://cheatsheets.zip/telegram.html): A visual cheat-sheet for the 37 keyboard shortcuts found on
the Telegram Desktop app
- [YouTube](https://cheatsheets.zip/youtube.html): A visual cheat-sheet for the 18 keyboard shortcuts found on
YouTube.com
- [Airtable](https://cheatsheets.zip/airtable.html): A visual cheat-sheet for the 36 keyboard shortcuts found in
Airtable
- [Bitbucket](https://cheatsheets.zip/bitbucket.html): A visual cheat-sheet for the 35 keyboard shortcuts found on
Bitbucket
- [Fortnite](https://cheatsheets.zip/fortnite.html): A visual cheat-sheet for the 26 default keyboard shortcuts found in
Fortnite
- [Gmail](https://cheatsheets.zip/gmail.html): A visual cheat-sheet for the 90 keyboard shortcuts found on Gmail
- [Sketch](https://cheatsheets.zip/sketch.html): A visual cheat-sheet for the 149 keyboard shortcuts found in Sketch.
This application is MacOS-only.
- [Spotify](https://cheatsheets.zip/spotify.html): A visual cheat-sheet for the 23 keyboard shortcuts found in Spotify
- [Brave Browser](https://cheatsheets.zip/brave.html): A visual cheat-sheet for the 64 keyboard shortcuts found in the
Brave browser
- [KanbanMail](https://cheatsheets.zip/kanbanmail.html): A visual cheat-sheet for the 29 keyboard shortcuts found in
KanbanMail
- [Microsoft Outlook](https://cheatsheets.zip/outlook.html): A visual cheat-sheet for the 210 keyboard shortcuts found
in Microsoft Outlook
- [Principle](https://cheatsheets.zip/principle.html): A visual cheat-sheet for the 30 keyboard shortcuts found in
Principle. This application is MacOS-only.
- [Skype](https://cheatsheets.zip/skype.html): A visual cheat-sheet for the 31 keyboard shortcuts found in Skype
- [Arduino IDE](https://cheatsheets.zip/arduino.html): A visual cheat-sheet for the 12 keyboard shortcuts found in the
Arduino IDE
- [Asana](https://cheatsheets.zip/asana.html): A visual cheat-sheet for the 40 keyboard shortcuts found in Asana
- [Code Editor for iOS](https://cheatsheets.zip/code-editor-ios.html): A visual cheat-sheet for the 43 keyboard
shortcuts found in the Code Editor for iOS app. This application is MacOS-only.
- [Jira](https://cheatsheets.zip/jira.html): A visual cheat-sheet for the 44 keyboard shortcuts found in Jira
- [Quip.com](https://cheatsheets.zip/quip.html): A visual cheat-sheet for the 52 keyboard shortcuts found in Quip
- [WordPress](https://cheatsheets.zip/wordpress.html): A visual cheat-sheet for the 34 keyboard shortcuts found in the
WordPress visual editor
- [Chrome Developer Tools](https://cheatsheets.zip/chrome-devtools.html): A visual cheat-sheet for the 56 keyboard
shortcuts found in Chrome's Developer Tools
- [GIMP](https://cheatsheets.zip/gimp.html): A visual cheat-sheet for the 97 keyboard shortcuts found in GIMP
- [Google Chrome](https://cheatsheets.zip/google-chrome.html): A visual cheat-sheet for the 65 keyboard shortcuts found
in Google Chrome
- [Todoist](https://cheatsheets.zip/todoist.html): A visual cheat-sheet for the 37 keyboard shortcuts found in Todoist
- [TickTick](https://cheatsheets.zip/ticktick.html): A visual cheat-sheet for the 25 keyboard shortcuts found in the
TickTick desktop app
- [VLC Player](https://cheatsheets.zip/vlc.html): A visual cheat-sheet for the 82 keyboard shortcuts found in VLC Player
- [Missive](https://cheatsheets.zip/missive.html): A visual cheat-sheet for the 83 keyboard shortcuts found in Missive
- [Origami Studio](https://cheatsheets.zip/origami.html): A visual cheat-sheet for the 71 keyboard shortcuts found in
Origami Studio. This application is MacOS-only.
- [Sublime Text](https://cheatsheets.zip/sublime-text.html): A visual cheat-sheet for the 49 keyboard shortcuts found in
Sublime Text
- [Transmit](https://cheatsheets.zip/transmit.html): A visual cheat-sheet for the 62 keyboard shortcuts found in
Transmit. This application is MacOS-only.
- [Affinity Photo](https://cheatsheets.zip/affinity-photo.html): A visual cheat-sheet for the 177 keyboard shortcuts
found in Affinity Photo
- [Monday.com](https://cheatsheets.zip/monday.html): A visual cheat-sheet for the 24 keyboard shortcuts found on
Monday.com
- [Proto.io](https://cheatsheets.zip/proto-io.html): A visual cheat-sheet for the 48 keyboard shortcuts found in
Proto.io
- [Superhuman](https://cheatsheets.zip/superhuman.html): A visual cheat-sheet for the 105 keyboard shortcuts found in
Superhuman. This application is MacOS-only.
- [Vivaldi Browser](https://cheatsheets.zip/vivaldi.html): A visual cheat-sheet for the 69 default keyboard shortcuts
found in the Vivaldi browser
- [Finder](https://cheatsheets.zip/finder.html): A visual cheat-sheet for the 55 keyboard shortcuts found in Finder.
This application is part of MacOS.
- [GitLab](https://cheatsheets.zip/gitlab.html): A visual cheat-sheet for the 58 keyboard shortcuts found in GitLab
- [Guitar Pro](https://cheatsheets.zip/guitar-pro.html): A visual cheat-sheet for the 129 keyboard shortcuts found in
Guitar Pro
- [Roam Research](https://cheatsheets.zip/roam.html): A visual cheat-sheet for the 45 keyboard shortcuts found on Roam
Research
- [SketchUp Pro](https://cheatsheets.zip/sketchup.html): A visual cheat-sheet for the 135 default keyboard shortcuts
found in SketchUp Pro
- [Unity 3D](https://cheatsheets.zip/unity-3d.html): A visual cheat-sheet for the 50 keyboard shortcuts found in Unity
3D
- [IntelliJ IDEA](https://cheatsheets.zip/idea.html): IntelliJ IDEA is a very good Java IDE, most of its commands have
shortcuts to keep your hands from leaving the keyboard
- [WebStorm](https://cheatsheets.zip/webstorm.html): This quick reference cheat sheet lists the default keyboard
shortcuts for WebStorm running on Windows/Linux or Mac
Shaders
- [Unity Shader Graph](https://cheatsheets.zip/unity-shader-graph.html): This is a visual cheat-sheet for the Unity
Shader Graph. This tool is used to create custom shaders material in Unity, a popular game engine.
Game
- [Minecraft Java](https://cheatsheets.zip/minecraft-java.html): A comprehensive reference for Minecraft Java Edition (1.20.x) commands.
- [Minecraft Bedrock](https://cheatsheets.zip/minecraft-bedrock.html): A comprehensive reference for Minecraft Bedrock Edition (1.20.x) commands.
Other
- [ASCII Code](https://cheatsheets.zip/ascii-code.html): This cheat sheet is a complete list of ASCII Code Table with
their numbers and names.
- [Aspect Ratio](https://cheatsheets.zip/aspect-ratio.html): This cheat sheet lists some common aspect ratios and their
pixel resolutions. Always confirm your final delivery ratio when shooting.
- [CheatSheets](https://cheatsheets.zip/quickref.html): This is the magic syntax variant manual that you can use on
CheatSheets.zip, It’s a good practice for contributors.
- [Emoji](https://cheatsheets.zip/emoji.html): Some of the emoji codes are not super easy to remember, so here is a
little cheat sheet.
- [Google Search](https://cheatsheets.zip/google-search.html): This quick reference cheat sheet lists of Google advanced
search operators.
- [HTML Characters Entities](https://cheatsheets.zip/html-char.html): This cheat sheet is a complete list of HTML
entities with their numbers and names. Also included is a full list of ASCII characters that can be represented in
HTML.
- [ISO 639-1 Language Code](https://cheatsheets.zip/iso-639-1.html): This is a list of the ISO language codes that
conform to the ISO 639-1 standard, it provide reference for multi-language website.
- [HTTP Status Code](https://cheatsheets.zip/http-status-code.html): The http status codes cheat sheet. A quick
reference to every HTTP status code.
- [MIME types](https://cheatsheets.zip/mime.html): This cheat sheet lists some common MIME types for the Web. You can
look in the [IANA/MIME Media Types registry](http://www.iana.org/assignments/media-types/index.html) which contains
all registered MIME types.
- [Resolutions](https://cheatsheets.zip/resolutions.html): This cheat sheet lists screen sizes, viewport size and CSS
media queries for popular Phones, Tablets, Laptops and Watches
## 🐦 Follow us on Twitter
[](https://twitter.com/FechinLi)
Stay up-to-date with our project by following us on Twitter! Get all the latest news and updates right in your feed.
It's the perfect way to stay in the loop.
## 📃 License
The project is licensed under the [GPL-3.0](https://github.com/Fechin/reference/blob/main/LICENSE) License and is
maintained by [Fechin](https://github.com/Fechin).
================================================
FILE: _config.yml
================================================
# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/
# Site
title: CheatSheets.zip
subtitle: "Ultimate Cheat for Developers"
description: "Share quick reference and cheat sheet for developers"
keywords: cheat,sheet,cheatsheets,reference,programming,code table,snippets,linux,command,shortcuts,developers
author: Fechin
language: en
timezone: "UTC"
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://cheatsheets.zip
root: /
permalink: :name.html
permalink_defaults:
pretty_urls:
trailing_index: false # Set to false to remove trailing 'index.html' from permalinks
trailing_html: true # Set to false to remove trailing '.html' from permalinks
# Directory
source_dir: source
public_dir: public
#tag_dir: tag
archive_dir: archives
#category_dir: node
#code_dir: downloads/code
i18n_dir: :lang
skip_render:
- "assets/**/*"
# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link:
enable: true # Open external links in new tab
field: site # Apply to the whole site
exclude: ""
filename_case: 1
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
syntax_highlighter: # empty to disable built-in syntax highlighting
highlight:
enable: false
# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
path: ""
per_page: 0
order_by: -date
# Category & Tag
default_category: uncategorized
category_map: {}
tag_map: {}
# Metadata elements
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
meta_generator: false
# SEO configuration
seo:
# Default image for social sharing
default_image: "/assets/image/preview.png"
# Author information
author_name: "Fechin"
author_url: "https://cheatsheets.zip"
# Social media configuration
social:
twitter: "Fechin"
github: "Fechin/reference"
# Site type
site_type: "Educational Technology Platform"
# Target audience
target_audience: "Developers, Programmers, System Administrators"
# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
## Use post's date for updated date unless set in front-matter
updated_option: "date"
# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page
# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include: []
exclude:
- ".github"
ignore: []
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: coo
nofollow:
enable: true
field: site
exclude:
- "tableconvert.com"
- "dorefer.com"
- "fionaai.com"
- "github.com"
- "gospinwheel.com"
- "colorscreen.co"
- "sshkeygenerator.com"
- "x.com"
excerpt:
depth: 2
excerpt_excludes: []
more_excludes: []
hideWholePostExcerpts: true
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
- type: cjh_bing_url_submitter
- type: cjh_baidu_url_submitter
# hexo-server configuration
server:
# Solve the problem that occasional real-time refresh is invalid and long articles are truncated
compress: true
# https://github.com/hexojs/hexo-generator-sitemap#options
sitemap:
path: sitemap.xml
tags: false
categories: false
# Markdown-it configuration
## Docs: https://github.com/celsomiranda/hexo-renderer-markdown-it/wiki
markdown:
render:
html: true
xhtmlOut: false
breaks: false
linkify: false
typographer: false
quotes: "“”‘’"
langPrefix: "hljs language-"
anchors:
level: 2
collisionSuffix: ""
permalink: true
permalinkClass: h-anchor
permalinkSymbol: "#"
case: 1
separator: "-"
# Browsersync configuration
browsersync:
ui: false # disable ui
notify: false # disable notification
logLevel: silent # set log level to silent
================================================
FILE: eslint.config.js
================================================
const js = require('@eslint/js');
const globals = require('globals');
module.exports = [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node
}
},
rules: {
'no-unused-vars': 'warn',
'no-console': 'off'
}
},
{
files: ['**/*.js'],
languageOptions: {
sourceType: 'script',
globals: {
...globals.node,
...globals.browser
}
}
},
{
files: ['source/sw.js'],
languageOptions: {
globals: {
...globals.serviceworker
}
}
},
{
files: ['themes/coo/scripts/**/*.js'],
languageOptions: {
globals: {
...globals.node,
hexo: 'readonly'
}
}
},
{
files: ['themes/coo/source/js/main.js'],
languageOptions: {
globals: {
...globals.browser,
Fuse: 'readonly'
}
}
},
{
ignores: [
'node_modules/**',
'public/**',
'db.json',
'.deploy_git/**',
'themes/coo/source/js/fuse_*.js'
]
}
];
================================================
FILE: gulpfile.js
================================================
const gulp = require('gulp');
const htmlmin = require('gulp-htmlmin');
const htmlclean = require('gulp-htmlclean');
const version = require('gulp-version-number');
const terser = require('gulp-terser');
// Compress js files
gulp.task('js', function () {
return gulp
.src(['./public/js/main.js'])
.pipe(
terser({
compress: true
})
)
.pipe(gulp.dest('./public/js'));
});
// Build html files
gulp.task('html', function () {
return gulp
.src('./public/**/*.html')
.pipe(htmlclean())
.pipe(
htmlmin({
removeComments: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true
})
)
.pipe(
version({
append: {
key: '_v',
cover: 1,
to: ['css', 'js', 'png', 'jpg', 'woff2']
}
})
)
.pipe(gulp.dest('./public'));
});
gulp.task('default', gulp.parallel('js', 'html'));
================================================
FILE: nginx.conf
================================================
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log ;
error_log /var/log/nginx/error.log;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
server {
listen 80;
listen [::]:80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# error_page
error_page 404 403 500 502 503 504 /assets/page/oops.htm;
# Rename cheatsheet
rewrite ^/golang$ /go permanent;
rewrite ^/css$ /css3 permanent;
location / {
try_files $uri $uri/ @html;
}
location @html {
# remove .html extension
rewrite ^(.*)\.html$ $1 permanent;
try_files $uri.html $uri/ =404;
}
}
}
================================================
FILE: package.json
================================================
{
"name": "CheatSheets.zip",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "run-p dev:*",
"dev:hexo": "npx hexo clean && npx hexo server",
"dev:css": "npx postcss themes/coo/source/css/style.tailwindcss -o themes/coo/source/css/style.css --watch",
"build": "run-s build:*",
"build:clean": "npx hexo clean",
"build:rm-db.json": "rm db.json || exit 0",
"build:css": "npx postcss themes/coo/source/css/style.tailwindcss -o themes/coo/source/css/style.css",
"build:generate": "npx hexo generate",
"build:gulp": "npx gulp --max-old-space-size=4096",
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "eslint themes/coo/source/js/**/*.js --fix",
"lint:check": "eslint themes/coo/source/js/**/*.js",
"lint:css": "stylelint **/*.css --fix",
"test": "run-s lint:check format:check",
"audit": "pnpm audit --audit-level moderate",
"audit:fix": "pnpm audit --fix",
"security:check": "pnpm audit && pnpm outdated",
"deps:check": "npx npm-check-updates",
"deps:update": "npx npm-check-updates -u && pnpm install",
"prepare": "husky",
"commit": "cz"
},
"hexo": {
"version": "7.3.0"
},
"dependencies": {
"gulp": "^5.0.1",
"gulp-cli": "^3.1.0",
"gulp-ext-replace": "^0.3.0",
"gulp-htmlclean": "^2.7.22",
"gulp-htmlmin": "^5.0.1",
"gulp-minify-css": "^1.2.4",
"gulp-postcss": "^10.0.0",
"gulp-uglify-es": "^3.0.0",
"gulp-version-number": "^0.2.4",
"hexo": "^7.3.0",
"hexo-browsersync": "^0.3.0",
"hexo-excerpt": "^1.3.1",
"hexo-filter-nofollow": "^2.0.2",
"hexo-fs": "^5.0.0",
"hexo-generator-index": "^4.0.0",
"hexo-generator-sitemap": "^3.0.1",
"hexo-log": "^4.1.0",
"hexo-pagination": "^4.0.0",
"hexo-related-popular-posts": "^5.0.1",
"hexo-renderer-ejs": "^2.0.0",
"hexo-renderer-markdown-it": "^5.0.0",
"hexo-renderer-stylus": "^3.0.1",
"hexo-server": "^3.0.0",
"hexo-util": "^3.3.0",
"highlight.js": "^11.11.1",
"markdown-it-abbr": "^2.0.0",
"markdown-it-anchor": "^9.2.0",
"markdown-it-attrs": "^4.3.1",
"markdown-it-checkbox": "^1.1.0",
"markdown-it-emoji": "^3.0.0",
"markdown-it-footnote": "^4.0.0",
"markdown-it-highlight-lines": "^1.0.2",
"markdown-it-highlightjs": "^4.2.0",
"markdown-it-ins": "^4.0.0",
"markdown-it-shortcode-tag": "^1.1.0",
"markdown-it-sub": "^2.0.0",
"markdown-it-sup": "^2.0.0",
"markdown-it-task-lists": "^2.1.1"
},
"devDependencies": {
"@commitlint/cli": "^19.8.1",
"@commitlint/config-conventional": "^19.8.1",
"autoprefixer": "^10.4.21",
"commitizen": "^4.3.1",
"cssnano": "^7.0.7",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^9.29.0",
"eslint-config-prettier": "^10.1.5",
"gulp-clean-css": "^4.3.0",
"gulp-filesize": "^0.0.6",
"gulp-javascript-obfuscator": "^1.1.6",
"gulp-replace": "^1.1.4",
"gulp-rev": "^11.0.0",
"gulp-terser": "^2.1.0",
"husky": "^9.1.7",
"lint-staged": "^16.1.2",
"npm-run-all2": "^8.0.4",
"postcss": "^8.5.6",
"postcss-cli": "^11.0.1",
"postcss-import": "^16.1.1",
"prettier": "^3.5.3",
"prettier-plugin-tailwindcss": "^0.6.12",
"stylelint": "^16.20.0",
"stylelint-config-standard": "^38.0.0",
"tailwindcss": "^3.4.14",
"tailwindcss-animate": "^1.0.7"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
================================================
FILE: postcss.config.js
================================================
module.exports = {
plugins: {
'postcss-import': { path: 'themes/coo/source/css' },
tailwindcss: { config: './tailwind.config.js' },
autoprefixer: {},
...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {})
}
};
================================================
FILE: source/_posts/1password.md
================================================
---
title: 1Password
date: 2022-11-23 16:23:31.702312
background: bg-[#397fe4]
label:
tags:
- tools
-
categories:
- Keyboard Shortcuts
intro: |
A cheat sheet for 1password's keyboard shortcuts in Mac, Windows, iOS, Linux.
---
## 1Password Keyboard Shortcuts for Mac
### Global keyboard shortcuts
| `Shortcut` | Action |
| ------------------------ | ------------------ |
| Enter your own shortcut. | Show 1Password. |
| `Shift` `cmd` `Space` | Show Quick Access. |
| `Shift` `cmd` `L` | Lock 1Password. |
| `cmd` `\` | Autofill. |
{.shortcuts}
### 1Password app {.row-span-2}
| `Shortcut` | Action |
| ------------------ | -------------------------------------------------------------------------------------------- |
| `cmd` `/` | View keyboard shortcuts. |
| `cmd` `,` | Open preferences. |
| `cmd` `F` | Search for items. |
| `Option` `cmd` `F` | Find items in the current list. |
| `Esc` | Clear the search field. |
| `cmd` `1` | Switch to All Accounts. |
| `cmd` `2...9` | Switch accounts and collections. |
| `cmd` `[` | Go back. |
| `cmd` `]` | Go forward. |
| `Down Arrow` | Focus next row. |
| `Up Arrow` | Focus previous row. |
| `Right Arrow` | Focus right section. |
| `Left Arrow` | Focus left section. |
| `Return or Space` | Activate focused element. |
| `cmd` `C` | Copy the username or primary field of the selected. |
| `Shift` `cmd` `C` | Copy the password of the selected. |
| `Option` `cmd` `C` | Copy the one-time password of the selected. |
| `Shift` `cmd` `F` | Open the website for the selected login in your browser and fill your username and password. |
| `cmd` `O` | Open the selected in a new window. |
| `cmd` `N` | Create a new item. |
| `cmd` `E` | Edit the selected. |
| `cmd` `S` | Save changes to an item. |
| `Esc` | Cancel an edit. |
| `cmd` `R` | Reveal or conceal secure fields in the selected. |
| `Option` | Temporarily reveal all secure fields in the selected.\* |
| `Delete` | Move the selected(s) to the Archive. |
| `cmd` `Delete` | Delete the selected(s). |
| `Shift` `cmd` `D` | Collapse or expand the sidebar. |
| `cmd` `+` | Zoom in. |
| `cmd` `-` | Zoom out. |
| `cmd` `0` | Revert to actual size. |
| `cmd` `M` | Minimize the app to the Dock. |
| `cmd` `W` | Close the current window. |
{.shortcuts}
### 1Password in the browser {.row-span-2}
| `Shortcut` | Action |
| --------------------------- | ----------------------------------------------------------------------------------------- |
| `Shift` `cmd` `X` | Open or close the 1Password pop-up in Chrome, Edge, Brave, or Safari. |
| `cmd` `.` | Open or close the 1Password pop-up in Firefox. |
| `cmd` `F` | Search for items. |
| `Esc` | Clear the search field. |
| `cmd` `D` | Show the list of vaults. |
| `cmd` `Down Arrow` | Open or close the category menu. |
| `Down Arrow` | Select the next category, item, or field. |
| `Up Arrow` | Select the previous category, item, or field. |
| `Right Arrow` | Select the item details. |
| `Left Arrow` | Select the item list. |
| `Space` | Expand item overview banners. |
| `Return` | Copy the selected detail.Perform the default action for the selected. |
| `cmd` `C` | Copy the username of the selected. |
| `Shift` `cmd` `C` | Copy the password of the selected. |
| `Control` `Shift` `cmd` `C` | Copy the one-time password of the selected. |
| `cmd` `Return` | Open the website for the selected login in a new tab and fill your username and password. |
| `cmd` `O` | Open the selected in a separate window. |
| `cmd` `I` | Create a new item. |
| `cmd` `E` | Edit the selected. |
| `Control` `Option` | Temporarily reveal all secure fields in the selected. |
| `cmd` `G` | Show the password generator. |
| `cmd` `C` | Copy a password from the password generator. |
| `Shift` `cmd` `L` | Lock 1Password. |
| `Esc` | Close the 1Password pop-up. |
{.shortcuts}
### Quick Access
| `Shortcut` | Action |
| --------------------- | ----------------------------------------------------------------------------------- |
| `Shift` `cmd` `Space` | Open or close Quick Access. |
| `Esc` | Clear the search field. |
| `cmd` `1...9` | Switch accounts or collections. |
| `Right Arrow` | View all available actions. |
| `cmd` `C` | Copy username or primary field. |
| `Shift` `cmd` `C` | Copy password. |
| `Option` `cmd` `C` | Copy one-time password. |
| `cmd` `O` | Open item details in new window. |
| `Option` `Return` | Open the website for the login in your browser and fill your username and password. |
| `Shift` `Return` | Fill the item in the currently focused app. |
| `Shift` `cmd` `O` | Open the item in the app. |
{.shortcuts}
## 1Password Keyboard Shortcuts for iOS
### 1Password app (I)
| `Shortcut` | Action |
| ------------- | -------------------------------- |
| `cmd` `,` | Open settings. |
| `cmd` `F` | Search for items. |
| `cmd` `.` | Clear the search field. |
| `cmd` `1` | Switch to All Accounts. |
| `cmd` `2...9` | Switch accounts and collections. |
| `cmd` `[` | Go back. |
| `cmd` `]` | Go forward. |
| `Down Arrow` | Focus next item. |
{.shortcuts}
### 1Password app (II)
| `Shortcut` | Action |
| ------------------ | --------------------------------------------------- |
| `Up Arrow` | Focus previous item. |
| `Space` | Activate focused item. |
| `cmd` `C` | Copy the username or primary field of the selected. |
| `Shift` `cmd` `C` | Copy the password of the selected. |
| `Option` `cmd` `C` | Copy the one-time password of the selected. |
| `cmd` `O` | Open the selected in a separate window. |
| `cmd` `E` | Edit the selected. |
{.shortcuts}
### 1Password app (III)
| `Shortcut` | Action |
| ----------------- | ------------------------------------ |
| `cmd` `S` | Save changes to an item. |
| `cmd` `.` | Cancel an edit. |
| `cmd` `D` | Add the selected to your favorites. |
| `Delete` | Move the selected(s) to the Archive. |
| `cmd` `Delete` | Delete the selected(s). |
| `Shift` `cmd` `D` | Collapse or expand the sidebar. |
| `Shift` `cmd` `L` | Lock 1Password. |
{.shortcuts}
## 1Password Keyboard Shortcuts for Windows
### Global keyboard shortcuts
| `Shortcut` | Action |
| -------------------------- | ------------------ |
| `Enter your own shortcut.` | Show 1Password. |
| `Ctrl` `Shift` `Space` | Show Quick Access. |
| `Ctrl` `Shift` `L` | Lock 1Password. |
| `Ctrl` `\` | Fill in Browser. |
{.shortcuts}
### 1Password app {.row-span-2}
| `Shortcut` | Action |
| ------------------- | -------------------------------------------------------------------------------------------- |
| `Ctrl` `Shift` `/` | View keyboard shortcuts. |
| `Ctrl` `,` | Open settings. |
| `Ctrl` `F` | Search for items. |
| `Ctrl` `Alt` `F` | Find items in the current list. |
| `Esc` | Clear the search field. |
| `Ctrl` `1` | Switch to All Accounts. |
| `Ctrl` `2...9` | Switch accounts and collections. |
| `Alt` `Left Arrow` | Go back. |
| `Alt` `Right Arrow` | Go forward. |
| `Down Arrow` | Focus next row. |
| `Up Arrow` | Focus previous row. |
| `Right Arrow` | Focus right section. |
| `Left Arrow` | Focus left section. |
| `Space` | Activate focused element. |
| `Ctrl` `C` | Copy the username or primary field of the selected. |
| `Ctrl` `Shift` `C` | Copy the password of the selected. |
| `Ctrl` `Alt` `C` | Copy the one-time password of the selected. |
| `Ctrl` `Shift` `F` | Open the website for the selected login in your browser and fill your username and password. |
| `Ctrl` `O` | Open the selected in a new window. |
| `Ctrl` `N` | Create a new item. |
| `Ctrl` `E` | Edit the selected. |
| `Ctrl` `S` | Save changes to an item. |
| `Esc` | Cancel an edit. |
| `Ctrl` `R` | Reveal or conceal secure fields in the selected. |
| `Ctrl` `Alt` | Temporarily reveal all secure fields in the selected.\* |
| `Delete` | Move the selected(s) to the Archive. |
| `Ctrl` `Delete` | Delete the selected(s). |
| `Ctrl` `Shift` `D` | Collapse or expand the sidebar. |
| `Ctrl` `+` | Zoom in. |
| `Ctrl` `-` | Zoom out. |
| `Ctrl` `0` | Revert to actual size. |
{.shortcuts}
### 1Password in the browser {.row-span-2}
| `Shortcut` | Action |
| ------------------------ | ----------------------------------------------------------------------------------------- |
| `Ctrl` `Shift` `X` | Open or close the 1Password pop-up in Chrome, Edge, or Brave. |
| `Ctrl` `.` | Open or close the 1Password pop-up in Firefox. |
| `Ctrl` `F` | Search for items. |
| `Esc` | Clear the search field. |
| `Ctrl` `D` | Show the list of vaults. |
| `Ctrl` `Down Arrow` | Open or close the category menu. |
| `Down Arrow` | Select the next category, item, or field. |
| `Up Arrow` | Select the previous category, item, or field. |
| `Right Arrow` | Select the item details. |
| `Left Arrow` | Select the item list. |
| `Space` | Expand item overview banners. |
| `Enter` | Copy the selected detail.Perform the default action for the selected. |
| `Ctrl` `C` | Copy the username of the selected. |
| `Ctrl` `Shift` `C` | Copy the password of the selected. |
| `Ctrl` `Shift` `Win` `C` | Copy the one-time password of the selected. |
| `Ctrl` `Enter` | Open the website for the selected login in a new tab and fill your username and password. |
| `Ctrl` `O` | Open the selected in a separate window. |
| `Ctrl` `I` | Create new item. |
| `Ctrl` `E` | Edit the selected. |
| `Ctrl` `Alt` | Temporarily reveal all secure fields in the selected. |
| `Ctrl` `G` | Show the password generator. |
| `Ctrl` `C` | Copy a password from the password generator. |
| `Ctrl` `Shift` `L` | Lock 1Password. |
| `Esc` | Close the 1Password pop-up. |
{.shortcuts}
### Quick Access
| `Shortcut` | Action |
| ---------------------- | ----------------------------------------------------------------------------------- |
| `Ctrl` `Shift` `Space` | Open or close Quick Access. |
| `Esc` | Clear the search field. |
| `Ctrl` `1...9` | Switch accounts or collections. |
| `Right Arrow` | View all available actions. |
| `Ctrl` `C` | Copy username or primary field. |
| `Ctrl` `Shift` `C` | Copy password. |
| `Ctrl` `Alt` `C` | Copy one-time password. |
| `Ctrl` `O` | Open item details in new window. |
| `Alt` `Enter` | Open the website for the login in your browser and fill your username and password. |
| `Ctrl` `Shift` `O` | Open the item in the app. |
{.shortcuts}
## 1Password Keyboard Shortcuts for Linux
### X11
| `Shortcut` | Action |
| ----------------------- | ------------------ |
| Enter your own shortcut | Show 1Password. |
| `Ctrl` `Shift` `Space` | Show Quick Access. |
| `Ctrl` `Shift` `L` | Lock 1Password. |
| `Ctrl` `\` | Fill in Browser. |
{.shortcuts}
### 1Password app {.row-span-4}
| `Shortcut` | Action |
| ------------------- | -------------------------------------------------------------------------------------------- |
| `Ctrl` `Shift` `/` | View keyboard shortcuts. |
| `Alt` | Show or hide the app menu in the title bar. |
| `Ctrl` `,` | Open settings. |
| `Ctrl` `F` | Search for items. |
| `Ctrl` `Alt` `F` | Find items in the current list. |
| `Esc` | Clear the search field. |
| `Ctrl` `1` | Switch to All Accounts. |
| `Ctrl` `2...9` | Switch accounts and collections. |
| `Alt` `Left Arrow` | Go back. |
| `Alt` `Right Arrow` | Go forward. |
| `Down Arrow` | Focus next row. |
| `Up Arrow` | Focus previous row. |
| `Right Arrow` | Focus right section. |
| `Left Arrow` | Focus left section. |
| `Space` | Activate focused element. |
| `Ctrl` `C` | Copy the username or primary field of the selected. |
| `Ctrl` `Shift` `C` | Copy the password of the selected. |
| `Ctrl` `Alt` `C` | Copy the one-time password of the selected. |
| `Ctrl` `Shift` `F` | Open the website for the selected login in your browser and fill your username and password. |
| `Ctrl` `O` | Open the selected in a new window. |
| `Ctrl` `N` | Create a new item. |
| `Ctrl` `E` | Edit the selected. |
| `Ctrl` `S` | Save changes to an item. |
| `Esc` | Cancel an edit. |
| `Ctrl` `R` | Reveal or conceal secure fields in the selected. |
| `Ctrl` `Alt` | Temporarily reveal all secure fields in the selected. |
| `Delete` | Move the selected(s) to the Archive. |
| `Ctrl` `Delete` | Delete the selected(s). |
| `Ctrl` `Shift` `D` | Collapse or expand the sidebar. |
| `Ctrl` `+` | Zoom in. |
| `Ctrl` `-` | Zoom out. |
| `Ctrl` `0` | Revert to actual size. |
{.shortcuts}
### 1Password in the browser {.row-span-4}
| `Shortcut` | Action |
| ------------------------------ | ----------------------------------------------------------------------------------------- |
| `Ctrl` `Shift` `X` | Open or close the 1Password pop-up in Chrome, Edge, or Brave. |
| `Ctrl` `.` | Open or close the 1Password pop-up in Firefox. |
| `Ctrl` `F` | Search for items. |
| `Esc` | Clear the search field. |
| `Ctrl` `D` | Show the list of vaults. |
| `Ctrl` `Down Arrow` | Open or close the category menu. |
| `Down Arrow` | Select the next category, item, or field. |
| `Up Arrow` | Select the previous category, item, or field. |
| `Right Arrow` | Select the item details. |
| `Left Arrow` | Select the item list. |
| `Space` | Expand item overview banners. |
| `Enter` | Copy the selected detail.Perform the default action for the selected. |
| `Ctrl` `C` | Copy the username of the selected. |
| `Ctrl` `Shift` `C` | Copy the password of the selected. |
| `Ctrl` `Shift` `Super key` `C` | Copy the one-time password of the selected. |
| `Ctrl` `Enter` | Open the website for the selected login in a new tab and fill your username and password. |
| `Ctrl` `O` | Open the selected in a separate window. |
| `Ctrl` `I` | Create new item. |
| `Ctrl` `E` | Edit the selected. |
| `Ctrl` `Alt` | Temporarily reveal all secure fields in the selected. |
| `Ctrl` `G` | Show the password generator. |
| `Ctrl` `C` | Copy a password from the password generator. |
| `Ctrl` `Shift` `L` | Lock 1Password. |
| `Esc` | Close the 1Password pop-up. |
{.shortcuts}
### GNOME
| Shortcut | Action |
| ---------------------- | ------------------------ |
| `Ctrl` `P` | 1password --show |
| `Ctrl` `Shift` `Space` | 1password --quick-access |
| `Ctrl` `Shift` `L` | 1password --lock |
| `Ctrl` `\` | 1password --fill |
{.shortcuts}
### KDE Plasma
| `Trigger` | Action |
| ---------------------- | ------------------------ |
| `Ctrl` `P` | 1password --show |
| `Ctrl` `Shift` `Space` | 1password --quick-access |
| `Ctrl` `Shift` `L` | 1password --lock |
| `Ctrl` `\` | 1password --fill |
{.shortcuts}
### Quick Access
| `Shortcut` | Action |
| ---------------------- | ----------------------------------------------------------------------------------- |
| `Ctrl` `Shift` `Space` | Open or close Quick Access. |
| `Esc` | Clear the search field. |
| `Ctrl` `1...9` | Switch accounts or collections. |
| `Right Arrow` | View all available actions. |
| `Ctrl` `C` | Copy username or primary field. |
| `Ctrl` `Shift` `C` | Copy password. |
| `Ctrl` `Alt` `C` | Copy one-time password. |
| `Ctrl` `O` | Open item details in new window. |
| `Alt` `Enter` | Open the website for the login in your browser and fill your username and password. |
| `Ctrl` `Shift` `O` | Open the item in the app. |
{.shortcuts}
## Also see
- [Keyboard shortcuts for 1Password](https://support.1password.com/keyboard-shortcuts/) _(support.1password.com)_
================================================
FILE: source/_posts/adobe-lightroom.md
================================================
---
title: Adobe Lightroom CC
date: 2022-11-23 16:23:31.702312
background: bg-[#081c32]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 251 keyboard shortcuts found in Adobe Lightroom CC
---
## Keyboard Shortcuts
### Working with panels {.row-span-2}
| Shortcut | Action |
| ------------------------- | ------------------------------------------------------------------------- |
| `Tab` | Show/hide side panels |
| `Shift` `Tab` | Show/hide all panels |
| `T` | Show/hide toolbar |
| `F5` | Show/hide Module Picker |
| `F6` | Show/hide Filmstrip |
| `F7` | Show/hide left panels |
| `F8` | Show/hide right panels |
| `Alt` `(click a panel)` | Toggle solo mode |
| `Shift` `(click a panel)` | Open a new panel without closing soloed panel |
| `Ctrl` `(click a panel)` | Open/close all panels |
| `Ctrl` `Shift` `0-5` | Open/close left panels, top to bottom |
| `Ctrl` `0-9` | Open/close right panels, Library and Develop modules, top to bottom |
| `Ctrl` `1-7` | Open/close right panels, Slideshow, Print, and Web modules, top to bottom |
{.shortcuts}
### Navigating modules
| Shortcut | Action |
| ------------------------- | -------------------------- |
| `Ctrl` `Alt` `1` | Go to Library module |
| `Ctrl` `Alt` `2` | Go to Develop module |
| `Ctrl` `Alt` `3` | Go to Slideshow module |
| `Ctrl` `Alt` `4` | Go to Print module |
| `Ctrl` `Alt` `5` | Go to Web module |
| `Ctrl` `Alt` `Left/Right` | Go back/go forward |
| `Ctrl` `Alt` `Up` | Go back to previous module |
{.shortcuts}
### Using a secondary window
| Shortcut | Action |
| ---------------------------- | ------------------------------------------------ |
| `F11` | Open secondary window |
| `Shift` `G` | Enter Grid view |
| `Shift` `E` | Enter normal Loupe view |
| `Ctrl` `Shift` `Enter` | Enter locked Loupe view |
| `Shift` `C` | Enter Compare view |
| `Shift` `N` | Enter Survey view |
| `Ctrl` `Alt` `Shift` `Enter` | Enter Slideshow view |
| `Shift` `F11` | Enter full-screen mode (requires second monitor) |
| `Shift` `\` | Show/hide Filter bar |
| `Ctrl` `Shift` `+/-` | Zoom in/out |
{.shortcuts}
### Working in the Develop module {.row-span-3}
| Shortcut | Action |
| ---------------------------- | ------------------------------------------------------------------------------------- |
| `V` | Convert to grayscale |
| `Ctrl` `U` | Auto tone |
| `Ctrl` `Shift` `U` | Auto white balance |
| `Ctrl` `E` | Edit in Photoshop |
| `Ctrl` `Shift` `C/V` | Copy/paste Develop settings |
| `Ctrl` `Alt` `V` | Paste settings from previous photo |
| `Ctrl` `Alt` `Shift` `Left` | Copy After settings to Before |
| `Ctrl` `Alt` `Shift` `Right` | Copy Before settings to After |
| `Ctrl` `Alt` `Shift` `Up` | Swap Before and After settings |
| `Up/Down` | Increase/decrease selected slider in small increments |
| `Shift` `Up/Down` | Increase/decrease selected slider in larger increments |
| `./,` | Cycle through Basic panel settings (forward/backward) |
| `(double-click slider name)` | Reset a slider |
| `Alt` `(click group name)` | Reset a group of sliders |
| `Ctrl` `Shift` `R` | Reset all settings |
| `Ctrl` `Shift` `S` | Sync settings |
| `Ctrl` `Alt` `S` | Sync settings bypassing Synchronize Settings dialog box |
| `Ctrl` `(click Sync button)` | Toggle Auto Sync |
| `Ctrl` `Alt` `Shift` `A` | Enable Auto Sync |
| `Ctrl` `Alt` `Shift` `M` | Match total exposures |
| `W` | Select White Balance tool (from any module) |
| `R` | Select the Crop tool (from any module) |
| `A` | Constrain aspect ratio when Crop tool is selected |
| `Shift` `A` | Crop to same aspect ratio as previous crop |
| `Alt` `(drag)` | Crop from center of photo |
| `O` | Cycle Crop grid overlay |
| `Shift` `O` | Cycle Crop grid overlay orientation |
| `X` | Switch crop between portrait and landscape orientation |
| `Ctrl` `Alt` `R` | Reset crop |
| `Shift` `T` | Select the Guided Upright tool |
| `Q` | Select the Spot Removal tool |
| `Shift` `T` | Toggle Brush between Clone and Heal modes when Spot Removal tool is selected |
| `K` | Select the Adjustment Brush tool (from any module) |
| `M` | Select the Graduated Filter tool |
| `Shift` `T` | Toggle Mask between Edit and Brush modes when the Graduated/Radial Filter is selected |
| `]/[` | Increase/decrease brush size |
| `Shift` `]/[` | Increase/decrease brush feathering |
| `/` | Switch between local adjustment brush A and B |
| `Alt` `(drag)` | Temporarily switch from brush A or B to Eraser |
| `Shift` `(drag)` | Paint a horizontal or vertical line |
| `H` | Show/hide local adjustment pin |
| `O` | Show/hide local adjustment mask overlay |
| `Shift` `O` | Cycle local adjustment mask overlay colors |
| `Ctrl` `Alt` `Shift` `T` | Select Targeted Adjustment tool to apply a Tone Curve adjustment |
| `Ctrl` `Alt` `Shift` `H` | Select Targeted Adjustment tool to apply a Hue adjustment |
| `Ctrl` `Alt` `Shift` `S` | Select Targeted Adjustment tool to apply a Saturation adjustment |
| `Ctrl` `Alt` `Shift` `L` | Select Targeted Adjustment tool to apply a Luminance adjustment |
| `Ctrl` `Alt` `Shift` `G` | Select Targeted Adjustment tool to apply a Grayscale Mix adjustment |
| `Ctrl` `Alt` `Shift` `N` | Deselect Targeted Adjustment tool |
| `J` | Show clipping |
| `Ctrl` `]` | Rotate photo right (clockwise) |
| `Ctrl` `[` | Rotate photo left (counterclockwise) |
| `Space/Z` | Toggle between Loupe and 1:1 Zoom preview |
| `Ctrl` `+/-` | Zoom in/out |
| `Ctrl` `Enter` | Play impromptu slide show |
| `Y` | View Before and After left/right |
| `Alt` `Y` | View Before and After top/bottom |
| `Shift` `Y` | View Before and After in a split screen |
| `\` | View Before only |
| `Ctrl` `N` | Create a new snapshot |
| `Ctrl` `Shift` `N` | Create a new preset |
| `Ctrl` `Alt` `N` | Create a new preset folder |
| `Ctrl` `J` | Open Develop view options |
{.shortcuts}
### Changing view and screen modes
| Shortcut | Action |
| ------------------ | -------------------------------------------------- |
| `E` | Enter Library Loupe view |
| `G` | Enter Library Grid view |
| `C` | Enter Library Compare view |
| `N` | Enter Library Survey view |
| `D` | Open selected photo in the Develop module |
| `L` | Cycle forward through Lights Out modes |
| `Shift` `L` | Cycle backward through Lights Out modes |
| `Ctrl` `Shift` `L` | Toggle Lights Dim mode |
| `F` | Cycle screen modes |
| `Ctrl` `Shift` `F` | Switch between Normal and full-screen, hide panels |
| `Ctrl` `Alt` `F` | Go to Normal screen mode |
| `I` | Cycle info overlay |
| `Ctrl` `I` | Show/hide info overlay |
{.shortcuts}
### Managing photos and catalogs
| Shortcut | Action |
| -------------------------------- | -------------------------------------------------------------------------------------- |
| `Ctrl` `Shift` `I` | Import photos from disk |
| `Ctrl` `O` | Open catalog |
| `Ctrl` `,` | Open Preferences |
| `Ctrl` `Alt` `,` | Open Catalog Settings |
| `Ctrl` `Shift` `T` | Create new subfolder (segmented tethered capture) |
| `Ctrl` `T` | Hide/show tether capture bar |
| `Ctrl` `Shift` `N` | Create a new folder in the Library module |
| `Ctrl` `'` | Create virtual copy (Library and Develop module only) |
| `Ctrl` `R` | Show in Explorer/Finder (Library and Develop module only) |
| `Right/Left` | Go to next/previous photo in the Filmstrip |
| `Shift/Ctrl` `Click` | Select multiple folders or collections (in Library, Slideshow, Print, and Web modules) |
| `F2` | Rename photo (in Library module) |
| `Delete` | Delete selected photo(s) |
| `Alt` `Backspace` | Remove selected photo(s) from catalog |
| `Ctrl` `Alt` `Shift` `Backspace` | Delete selected photo(s) and move to Trash |
| `Ctrl` `Backspace` | Delete rejected photo(s) |
| `Ctrl` `E` | Edit in Photoshop |
| `Ctrl` `Alt` `E` | Open in other editor |
| `Ctrl` `Shift` `E` | Export selected photo(s) |
| `Ctrl` `Alt` `Shift` `E` | Export with previous settings |
| `Ctrl` `Alt` `Shift` `,` | Open plug-in manager |
| `Ctrl` `P` | Print selected photo |
| `Ctrl` `Shift` `P` | Open Page Setup dialog box |
{.shortcuts}
### Comparing photos in the Library module
| Shortcut | Action |
| ------------------------ | ----------------------------------------------------- |
| `E/Enter` | Switch to Loupe view |
| `G/Esc` | Switch to Grid view |
| `C` | Switch to Compare view |
| `N` | Switch to Survey view |
| `Space/E` | Switch from Grid to Loupe view |
| `Down` | Swap select and candidate photos in Compare view |
| `Up` | Make next photos select and candidate in Compare view |
| `Z` | Toggle Zoom view |
| `Ctrl` `+/-` | Zoom in/out in Loupe view |
| `PgUp/PgDown` | Scroll up/down zoomed photo in Loupe view |
| `Home/End` | Go to beginning/end of Grid view |
| `Ctrl` `Enter` | Play impromptu slide show |
| `Ctrl` `]` | Rotate photo right (clockwise) |
| `Ctrl` `[` | Rotate photo left (counterclockwise) |
| `=/-` | Increase/decrease Grid thumbnail size |
| `PgUp/PgDown` | Scroll up/down Grid thumbnails |
| `Ctrl` `Shift` `H` | Toggle cell extras |
| `Ctrl` `Alt` `Shift` `H` | Show/hide badges |
| `J` | Cycle Grid views |
| `Ctrl` `J` | Open Library view options |
| `Ctrl` `(click)` | Select multiple discrete photos |
| `Shift` `(click)` | Select multiple contiguous photos |
| `Ctrl` `A` | Select all photos |
| `Ctrl` `D` | Deselect all photos |
| `Ctrl` `Shift` `D` | Select only active photo |
| `/` | Deselect active photo |
| `Shift` `Left/Right` | Add previous/next photo to selection |
| `Ctrl` `Alt` `A` | Select flagged photos |
| `Ctrl` `Alt` `Shift` `D` | Deselect unflagged photos |
| `Ctrl` `G` | Group into stack |
| `Ctrl` `Shift` `G` | Unstack |
| `S` | Toggle stack |
| `Shift` `S` | Move to top of stack |
| `Shift` `[` | Move up in stack |
| `Shift` `]` | Move down in stack |
{.shortcuts}
### Rating and filtering photos
| Shortcut | Action |
| ------------------------------- | ------------------------------------------- |
| `1-5` | Set star rating |
| `Shift` `1-5` | Set star rating and go to next photo |
| `0` | Remove star rating |
| `Shift` `0` | Remove star rating and go to next photo |
| `]/[` | Increase/decrease rating by one star |
| `6` | Assign a red label |
| `7` | Assign a yellow label |
| `8` | Assign a green label |
| `9` | Assign a blue label |
| `Shift` `6-9` | Assign a color label and go to next photo |
| `P` | Flag photo as a pick |
| `Shift` `P` | Flag photo as a pick and go to next photo |
| `X` | Flag photo as a reject |
| `Shift` `X` | Flag photo as a reject and go to next photo |
| `U` | Unflag photo |
| `Shift` `U` | Unflag photo and go to next photo |
| `Ctrl` `Up/Down` | Increase/decrease flag status |
|
\` | Cycle flag settings |
| `Ctrl` `Alt` `R` | Refine photos |
| `\` | Show/hide Library Filter bar |
| `Shift` `(click filter labels)` | Open multiple filters in the Filter bar |
| `Shift` `L` | Toggle filters on/off |
| `Ctrl` `F` | Find photo in the Library module |
{.shortcuts}
### Working with collections
| Shortcut | Action |
| ------------------------ | --------------------------------------------- |
| `Ctrl` `N` | Create a new collection in the Library module |
| `B` | Add to Quick Collection |
| `Shift` `B` | Add to Quick Collection and go to next photo |
| `Ctrl` `B` | Show Quick Collection |
| `Ctrl` `Alt` `B` | Save Quick Collection |
| `Ctrl` `Shift` `B` | Clear Quick Collection |
| `Ctrl` `Alt` `Shift` `B` | Set as target collection |
{.shortcuts}
### Working with metadata and keywords in the Library module
| Shortcut | Action |
| -------------------------- | -------------------------------------------------- |
| `Ctrl` `K` | Add keywords |
| `Ctrl` `Shift` `K` | Edit keywords |
| `Ctrl` `Alt` `Shift` `K` | Set a keyword shortcut |
| `Shift` `K` | Add/remove keyword shortcut from selected photo |
| `Ctrl` `Alt` `K` | Enable painting |
| `Alt` `1-9` | Add a keyword from a keyword set to selected photo |
| `Alt` `0` | Cycle forward through keyword sets |
| `Alt` `Shift` `0` | Cycle backward through keyword sets |
| `Ctrl` `Alt` `Shift` `C/V` | Copy/paste metadata |
| `Ctrl` `S` | Save metadata to file |
{.shortcuts}
### Working in the Slideshow module
| Shortcut | Action |
| ------------------ | --------------------------------------- |
| `Enter` | Play slide show |
| `Ctrl` `Enter` | Play impromptu slide show |
| `Space` | Pause slide show |
| `Alt` `Enter` | Preview slide show |
| `Esc` | End slide show |
| `Right` | Go to next slide |
| `Left` | Go to previous slide |
| `Ctrl` `]` | Rotate photo right (clockwise) |
| `Ctrl` `[` | Rotate photo left (counterclockwise) |
| `Ctrl` `Shift` `H` | Show/hide guides |
| `Ctrl` `J` | Export PDF slide show |
| `Ctrl` `Shift` `J` | Export JPEG slide show |
| `Ctrl` `Alt` `J` | Export video slide show |
| `Ctrl` `N` | Create a new slide show template |
| `Ctrl` `Shift` `N` | Create a new slide show template folder |
| `Ctrl` `S` | Save slide show settings |
{.shortcuts}
### Working in the Print module
| Shortcut | Action |
| ------------------------ | ------------------------------------ |
| `Ctrl` `P` | Print |
| `Ctrl` `Alt` `P` | Print one copy |
| `Ctrl` `Shift` `P` | Open Page Setup dialog box |
| `Ctrl` `Alt` `Shift` `P` | Open Print Settings dialog box |
| `Ctrl` `Shift` `Left` | Go to first page |
| `Ctrl` `Shift` `Right` | Go to last page |
| `Ctrl` `Left` | Go to previous page |
| `Ctrl` `Right` | Go to next page |
| `Ctrl` `Shift` `H` | Show/hide guides |
| `Ctrl` `R` | Show/hide rulers |
| `Ctrl` `Shift` `J` | Show/hide page bleed |
| `Ctrl` `Shift` `M` | Show/hide margins and gutters |
| `Ctrl` `Shift` `K` | Show/hide image cells |
| `Ctrl` `Shift` `U` | Show/hide dimensions |
| `Ctrl` `Enter` | Play impromptu slide show |
| `Ctrl` `]` | Rotate photo right (clockwise) |
| `Ctrl` `[` | Rotate photo left (counterclockwise) |
| `Ctrl` `N` | Create a new print template |
| `Ctrl` `Shift` `N` | Create a new print template folder |
| `Ctrl` `S` | Save print settings |
{.shortcuts}
### Working in the Web module
| Shortcut | Action |
| ------------------ | ---------------------------------------- |
| `Ctrl` `R` | Reload web gallery |
| `Ctrl` `Alt` `P` | Preview in browser |
| `Ctrl` `Enter` | Play impromptu slide show |
| `Ctrl` `J` | Export web gallery |
| `Ctrl` `N` | Create a new web gallery template |
| `Ctrl` `Shift` `N` | Create a new web gallery template folder |
| `Ctrl` `S` | Save web gallery settings |
{.shortcuts}
### Using help
| Shortcut | Action |
| ---------------- | -------------------------------- |
| `Ctrl` `/` | Display current module shortcuts |
| `(click)` | Hide current module shortcuts |
| `Ctrl` `Alt` `/` | Go to current module Help |
| `F1` | Open Community Help |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Adobe Lightroom CC](https://helpx.adobe.com/lightroom/help/keyboard-shortcuts.html)
_(helpx.adobe.com)_
================================================
FILE: source/_posts/adobe-photoshop.md
================================================
---
title: Adobe Photoshop
date: 2022-11-23 16:23:31.706034
background: bg-[#071c25]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 283 keyboard shortcuts found in Adobe Photoshop
---
## Keyboard Shortcuts
### Popular shortcuts
| Shortcut | Action |
| ------------------ | -------------------------------------------------------------- |
| `Ctrl` `T` | Free transform |
| `[` | Decrease brush size |
| `]` | Increase brush size |
| `Shift` `[` | Decrease brush hardness |
| `Shift` `]` | Increase brush hardness |
| `D` | Default foreground/background colors |
| `X` | Switch foreground/background colors |
| `Ctrl` `J` | New layer via copy |
| `Ctrl` `Shift` `J` | New layer via cut |
| `Esc` | Cancel any modal dialog window (including the Start Workspace) |
| `Enter` | Select the first edit field of the tool bar |
| `Tab` | Navigate between fields |
| `Shift` `Tab` | Navigate between fields in the opposite direction |
| `Alt` | Change cancel to reset |
| `Ctrl` `F` | Invoke the search experience |
{.shortcuts}
### Use function keys
| Shortcut | Action |
| ------------ | ----------------------- |
| `F1` | Start help |
| `F2` | Cut |
| `F3` | Copy |
| `F4` | Paste |
| `F5` | Show/hide brush panel |
| `F6` | Show/hide color panel |
| `F7` | Show/hide layers panel |
| `F8` | Show/hide info panel |
| `F9` | Show/hide actions panel |
| `F12` | Revert |
| `Shift` `F5` | Fill |
| `Shift` `F6` | Feather selection |
| `Shift` `F7` | Inverse selection |
{.shortcuts}
### Select tools {.row-span-2}
| Shortcut | Action |
| ----------- | ----------------------------------------------------------------------------------------------- |
| `V` | Move tool |
| `M` | Rectangular marquee tool |
| `L` | Lasso tool |
| `W` | Magic wand tool > quick selection tool |
| `C` | Crop tool > slice tool > slice select tool |
| `I` | Eyedropper tool > ruler tool > note tool |
| `J` | Spot healing brush tool > healing brush tool > patch tool > red eye tool |
| `B` | Brush tool > pencil tool > color replacement tool > mixer brush tool |
| `S` | Clone stamp tool > pattern stamp tool |
| `Y` | History brush tool > Art history brush tool |
| `E` | Eraser tool > background eraser tool > magic eraser tool |
| `G` | Gradient tool > paint bucket tool |
| `O` | Dodge tool > burn tool > sponge tool |
| `P` | Pen tool > freeform pen tool |
| `T` | Horizontal type tool > vertical type tool > horizontal type mask tool > vertical type mask tool |
| `A` | Path selection tool > direct selection tool |
| `U` | Rectangle tool > rounded rectangle tool > ellipse tool > polygon tool > line tool |
| `H` | Hand tool |
| `R` | Rotate view tool |
| `Z` | Zoom tool |
| `D` | Default foreground/background colors |
| `X` | Switch foreground/background colors |
| `Q` | Toggle standard/quick mask modes |
| `J` | Content-aware move tool |
| `C` | Perspective crop tool |
| `V` | Artboard tool |
| `R` | Rotate view tool |
| `/` | Toggle preserve transparency |
| `,` | Previous brush |
| `.` | Next brush |
| `Shift` `,` | First brush |
| `Shift` `.` | Last brush |
{.shortcuts}
### View images {.row-span-2}
| Shortcut | Action |
| -------------------- | ---------------------------------------------------------------------------------------- |
| `Ctrl` `Tab` | Cycle through open documents |
| `Ctrl` `Shift` `Tab` | Switch to previous document |
| `Ctrl` `Shift` `W` | Close a file in Photoshop and open Bridge |
| `F` | Toggle forward between Standard screen > Full screen with menu bar > Full screen modes |
| `Shift` `F` | Toggle backwards between Standard screen > Full screen with menu bar > Full screen modes |
| `Space` `F` | Toggle forward canvas color |
| `Shift` `Space` `F` | Toggle backwards canvas color |
| `Space` | Switch to hand tool (when not in text-edit mode) |
| `Ctrl` `Space` | Switch to zoom in tool |
| `Alt` `Space` | Switch to zoom out tool |
| `Shift` `Enter` | Apply zoom percentage, and keep zoom percentage box active |
| `PgUp/PgDn` | Scroll up or down 1 screen |
| `Shift` `PgUp/PgDn` | Scroll up or down 10 units |
| `Home` | Move view to upper-left corner |
| `End` | Move view to lower-right corner |
| `\` | Toggle layer mask on/off as rubylith (layer mask must be selected) |
{.shortcuts}
### Use Puppet Warp
| Shortcut | Action |
| ---------- | ------------------------ |
| `Esc` | Cancel completely |
| `Ctrl` `Z` | Undo last pin adjustment |
| `Ctrl` `A` | Select all pins |
| `Ctrl` `D` | Deselect all pins |
| `H` | Temporarily hide pins |
{.shortcuts}
### Use Refine Edge
| Shortcut | Action |
| ---------------- | ------------------------------------------------------- |
| `Ctrl` `Alt` `R` | Open the Refine Edge dialog box |
| `F` | Cycle forward through preview modes |
| `Shift` `F` | Cycle backwards through preview modes |
| `X` | Toggle between original image and selection preview |
| `P` | Toggle between original selection and refined version |
| `J` | Toggle radius preview on and off |
| `Shift` `E` | Toggle between Refine Radius and Erase Refinement tools |
{.shortcuts}
### Use the Filter Gallery
| Shortcut | Action |
| ------------------ | ------------------------------- |
| `Ctrl` `Alt` `F` | Reapply last-used filter |
| `Ctrl` | Change Cancel button to Default |
| `Alt` | Change Cancel button to Reset |
| `Ctrl` `Z` | Undo/Redo |
| `Ctrl` `Shift` `Z` | Step forward |
| `Ctrl` `Alt` `Z` | Step backward |
{.shortcuts}
### Use the Liquify filter
| Shortcut | Action |
| -------------- | ---------------------------------------------------------------- |
| `W` | Forward warp tool |
| `R` | Reconstruct tool |
| `C` | Twirl clockwise tool |
| `S` | Pucker tool |
| `B` | Bloat tool |
| `O` | Push left tool |
| `M` | Mirror tool |
| `T` | Turbulence tool |
| `F` | Freeze mask tool |
| `D` | Thaw mask tool |
| `Alt` `(tool)` | Reverse direction for Bloat, Pucker, Push Left, and Mirror tools |
| `Tab` | Cycle through controls on right from top |
| `Shift` `Tab` | Cycle through controls on right from bottom |
| `Alt` | Change cancel to reset |
{.shortcuts}
### Use Vanishing Point
| Shortcut | Action |
| ------------------ | ---------------------------------------------------- |
| `X` | Zoom 2x (temporary) |
| `Ctrl` `+` | Zoom in |
| `Ctrl` `-` | Zoom out |
| `Ctrl` `0` | Fit in view |
| `Ctrl` `Z` | Undo last action |
| `Ctrl` `Shift` `Z` | Redo last action |
| `Ctrl` `D` | Deselect all |
| `Ctrl` `H` | Hide selection and panes |
| `Arrows` | Move selection 1 pixel |
| `Shift` `Arrows` | Move selection 10 pixels |
| `Ctrl` `C` | Copy |
| `Ctrl` `V` | Paste |
| `Ctrl` `Shift` `T` | Repeat last duplicate and move |
| `Ctrl` `Alt` `T` | Create floating selection from the current selection |
| `Alt` `Shift` | Constrain selection to a 15 degree rotation |
| `Backspace` | Delete last node while creating plane |
{.shortcuts}
### Use the Camera Raw dialog box {.row-span-4}
| Shortcut | Action |
| ------------------------ | -------------------------------------------------------------------------------------------------- |
| `Z` | Zoom tool |
| `H` | Hand tool |
| `I` | White balance tool |
| `S` | Color sampler tool |
| `C` | Crop tool |
| `A` | Straighten tool |
| `B` | Spot removal tool |
| `E` | Red eye removal tool |
| `Ctrl` `Alt` `1` | Basic panel |
| `Ctrl` `Alt` `2` | Tone curve panel |
| `Ctrl` `Alt` `3` | Detail panel |
| `Ctrl` `Alt` `4` | HSL/Greyscale panel |
| `Ctrl` `Alt` `5` | Split toning panel |
| `Ctrl` `Alt` `6` | Lens corrections panel |
| `Ctrl` `Alt` `7` | Camera calibration panel |
| `Ctrl` `Alt` `8` | Presets panel |
| `Ctrl` `Alt` `9` | Open snapshots panel |
| `Ctrl` `Alt` `Shift` `T` | Parametric curve targeted adjustment tool |
| `Ctrl` `Alt` `Shift` `H` | Hue targeted adjustment tool |
| `Ctrl` `Alt` `Shift` `S` | Saturation targeted adjustment tool |
| `Ctrl` `Alt` `Shift` `L` | Luminance targeted adjustment tool |
| `Ctrl` `Alt` `Shift` `G` | Grayscale mix targeted adjustment tool |
| `T` | Last-used targeted adjustment tool |
| `K` | Adjustment brush tool |
| `G` | Graduated filter tool |
| `Alt` | Temporarily switch from Add to Erase mode for the Adjustment brush tool, or from Erase to Add mode |
| `Alt` `]/[` | Increase/decrease temporary adjustment brush tool size |
| `Alt` `Shift` `]/[` | Increase/decrease temporary adjustment brush tool feather |
| `Alt` `=/-` | Increase/decrease temporary adjustment brush tool size flow in increments of 10 |
| `N` | Switch to New mode from Add or Erase mode of the Adjustment Brush tool or Graduated filter |
| `M` | Toggle Auto Mask for Adjustment Brush tool |
| `Y` | Toggle Show Mask for Adjustment Brush tool |
| `V` | Toggle pins for Adjustment Brush tool |
| `L` | Rotate image left |
| `R` | Rotate image right |
| `Ctrl` | Temporarily switch to zoom in tool |
| `Alt` | Temporarily switch to zoom out tool and change the image open button to open copy |
| `P` | Toggle preview |
| `F` | Full screen mode |
| `Shift` | Temporarily activate the White Balance tool and change the open image button to open object |
| `Arrows` | Move selected point in curves panel 1 pixel |
| `Shift` `Arrows` | Move selected point in curves panel 10 pixels |
| `Ctrl` `R` | Open selected images in Camera Raw dialog box from Bridge |
| `O` | Highlight clipping warning |
| `U` | Shadows clipping warning |
| `Ctrl` `1-5` | Add 1-5 star rating (filmstrip mode) |
| `Ctrl` `./,` | Increase/decrease rating (filmstrip mode) |
| `Ctrl` `6` | Add red label (filmstrip mode) |
| `Ctrl` `7` | Add yellow label (filmstrip mode) |
| `Ctrl` `8` | Add green label (filmstrip mode) |
| `Ctrl` `9` | Add blue label (filmstrip mode) |
| `Ctrl` `Shift` `0` | Add purple label (filmstrip mode) |
| `Ctrl` `K` | Camera Raw preferences |
| `Ctrl` `Alt` | Delete Adobe Camera Raw preferences (on open) |
{.shortcuts}
### Use the Black-and-White dialog box
| Shortcut | Action |
| ------------------------ | --------------------------------------- |
| `Ctrl` `Shift` `Alt` `B` | Open the Black-and-White dialog box |
| `Up/Down` | Increase/decrease selected value by 1% |
| `Shift` `Up/Down` | Increase/decrease selected value by 10% |
{.shortcuts}
### Use Curves
| Shortcut | Action |
| ---------------- | -------------------------------------- |
| `Ctrl` `M` | Open the Curves dialog box |
| `+` | Select next point on the curve |
| `-` | Select the previous point on the curve |
| `Ctrl` `D` | Deselect a point |
| `Del` | Delete a point on the curve |
| `Arrows` | Move the selected point 1 pixel |
| `Shift` `Arrows` | Move the selected point 10 pixels |
{.shortcuts}
### Transform selections, selection borders, and paths
| Shortcut | Action |
| ------------------------ | ----------------------------------- |
| `Alt` | Transform from center or reflect |
| `Shift` | Constrain |
| `Ctrl` | Distort |
| `Enter` | Apply |
| `Ctrl` `.` | Cancel |
| `Ctrl` `Alt` `T` | Free transform with duplicate data |
| `Ctrl` `Shift` `Alt` `T` | Transform again with duplicate data |
{.shortcuts}
### Edit paths
| Shortcut | Action |
| -------- | ----------------------------------------------------------------------------------------------------------------------- |
| `Ctrl` | Switch from path selection, pen, add anchor point, delete anchor point, or convert point tools to direct selection tool |
| `Alt` | Switch from pen tool to freeform pen tool to convert point tool when pointer is over anchor or direction point |
{.shortcuts}
### Use for painting
| Shortcut | Action |
| ------------------------ | ---------------------------------------------------- |
| `Alt` `Shift` `0-9` | Mixer brush changes mix setting |
| `0-9` | Mixer brush changes wet setting |
| `00` | Mixer brush changes wet and mix to zero |
| `Shift` `+/-` | Cycle through blending modes |
| `Backspace` | Open fill dialog box on background or standard layer |
| `Alt` `Backspace` | Fill with foreground color |
| `Ctrl` `Backspace` | Fill with background color |
| `Ctrl` `Alt` `Backspace` | Fill from history |
| `Shift` `Backspace` | Displays fill dialog box |
| `/` | Lock transparent pixels on/off |
{.shortcuts}
### Use for blending modes {.row-span-2}
| Shortcut | Action |
| ----------------- | ----------------------------------------------------------------------------- |
| `Ctrl` `-/+` | Cycle through blending modes |
| `Shift` `Alt` `N` | Normal |
| `Shift` `Alt` `I` | Dissolve |
| `Shift` `Alt` `Q` | Behind (brush tool only) |
| `Shift` `Alt` `R` | Clear (brush tool only) |
| `Shift` `Alt` `K` | Darken |
| `Shift` `Alt` `M` | Multiply |
| `Shift` `Alt` `B` | Color burn |
| `Shift` `Alt` `A` | Linear burn |
| `Shift` `Alt` `G` | Lighten |
| `Shift` `Alt` `S` | Screen |
| `Shift` `Alt` `D` | Color dodge |
| `Shift` `Alt` `W` | Linear dodge |
| `Shift` `Alt` `O` | Overlay |
| `Shift` `Alt` `F` | Soft light |
| `Shift` `Alt` `H` | Hard light |
| `Shift` `Alt` `V` | Vivid light |
| `Shift` `Alt` `J` | Linear light |
| `Shift` `Alt` `Z` | Pin light |
| `Shift` `Alt` `L` | Hard mix |
| `Shift` `Alt` `E` | Difference |
| `Shift` `Alt` `X` | Exclusion |
| `Shift` `Alt` `U` | Hue |
| `Shift` `Alt` `T` | Saturation |
| `Shift` `Alt` `C` | Color |
| `Shift` `Alt` `Y` | Luminosity |
| `Shift` `Alt` `N` | Set blending mode to Threshold for bitmap images, Normal for all other images |
{.shortcuts}
### Format type
| Shortcut | Action |
| ------------------------ | ------------------------------------------------------------------ |
| `Ctrl` `Shift` `L/C/R` | Align left, center, or right |
| `Ctrl` `Shift` `X` | Choose 100% horizontal scale |
| `Ctrl` `Shift` `Alt` `X` | Choose 100% vertical scale |
| `Ctrl` `Shift` `Alt` `A` | Choose auto leading |
| `Ctrl` `Shift` `Q` | Choose 0 for tracking |
| `Ctrl` `Shift` `J` | Justify paragraph, left aligns last line |
| `Ctrl` `Shift` `F` | Justify paragraph, justifies all |
| `Ctrl` `Shift` `Alt` `H` | Toggle paragraph hyphenation on/off |
| `Ctrl` `Shift` `Alt` `T` | Toggle single/every-line composer on/off |
| `Ctrl` `Shift` `>` | Decrease or increase type size of selected text 2 points or pixels |
| `Alt` `Up/Down` | Decrease or increase leading 2 points or pixels |
| `Shift` `Alt` `Up/Down` | Decrease or increase baseline shift 2 points or pixels |
| `Alt` `Left/Right` | Decrease or increase kerning/tracking 20/1000 ems |
{.shortcuts}
### Use panels
| Shortcut | Action |
| ----------------- | ------------------------------------------------------- |
| `Shift` `Enter` | Apply value and keep text box active |
| `Tab` | Show/Hide all panels |
| `Shift` `Tab` | Show/Hide all panels except the toolbox and options bar |
| `Enter` | Highlight options bar (select tool first) |
| `Shift` `Up/Down` | Increase/decrease selected values by 10 |
{.shortcuts}
### Use adjustment layers
| Shortcut | Action |
| ----------- | --------------------------------------- |
| `Alt` `3` | Choose red channel for adjustment |
| `Alt` `4` | Choose green channel for adjustment |
| `Alt` `5` | Choose blue channel for adjustment |
| `Alt` `2` | Choose composite channel for adjustment |
| `Backspace` | Delete adjustment layer |
{.shortcuts}
### Use the Brush panel
| Shortcut | Action |
| ----------------- | -------------------------------------- |
| `,/.` | Select previous/next brush size |
| `Shift` `,/.` | Select first/last brush |
| `Caps Lock` | Display precise cross hair for brushes |
| `Shift` `Alt` `P` | Toggle airbrush option |
{.shortcuts}
### Use the Clone Source panel
| Shortcut | Action |
| ------------------------ | -------------------------------------------- |
| `Alt` `Shift` | Show Clone Source (overlays iamge) |
| `Alt` `Shift` `(arrows)` | Nudge Clone Source |
| `Alt` `Shift` `>` | Rotate Clone Source |
| `Alt` `Shift` `[/]` | Scale (increase or reduce size) Clone Source |
{.shortcuts}
### Use the Layers panel
| Shortcut | Action |
| ------------------------ | --------------------------------------------------------------- |
| `Ctrl` `Shift` `N` | New layer |
| `Ctrl` `J` | New layer via copy |
| `Ctrl` `Shift` `J` | New layer via cut |
| `Ctrl` `G` | Group layers |
| `Ctrl` `Shift` `G` | Ungroup layers |
| `Ctrl` `Alt` `G` | Create/release clipping mask |
| `Ctrl` `Alt` `A` | Select all layers |
| `Ctrl` `Shift` `E` | Merge visible layers |
| `Alt` `.` | Select top layer |
| `Alt` `.` | Select bottom layer |
| `Shift` `Alt` `[/]` | Add to layer selection in Layers panel |
| `Alt` `[/]` | Select next layer down/up |
| `Ctrl` `[/]` | Move target layer down/up |
| `Ctrl` `Shift` `Alt` `E` | Merge a copy of all visible layers into target layer |
| `Ctrl` `E` | Merge layers (while layers are highlighted) |
| `Ctrl` `Shift` `[/]` | Move layer to bottom or top |
| `/` | Toggle lock transparency for target layer, or last applied lock |
| `\` | Toggle rubylith mode for layer mask on/off |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Adobe Photoshop](https://helpx.adobe.com/photoshop/using/default-keyboard-shortcuts.html)
_(helpx.adobe.com)_
================================================
FILE: source/_posts/adobe-xd.md
================================================
---
title: Adobe XD
date: 2022-11-23 16:23:31.703379
background: bg-[#400835]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 97 keyboard shortcuts found in Adobe XD
---
## Keyboard Shortcuts
### Keys for Edit menu
| Shortcut | Action |
| ------------------ | -------------------------------------------------------------------- |
| `Ctrl` `Z` | Undo |
| `Ctrl` `Shift` `Z` | Redo |
| `Ctrl` `X` | Cut |
| `Ctrl` `C` | Copy |
| `Ctrl` `V` | Paste |
| `Ctrl` `Alt` `V` | Paste Appearance (Design mode) or Paste Interaction (Prototype mode) |
| `Ctrl` `D` | Duplicate |
| `Del` | Delete |
| `Ctrl` `A` | Select All |
| `Ctrl` `Shift` `A` | Deselect All |
{.shortcuts}
### Keys for File menu
| Shortcut | Action |
| ------------------ | --------------- |
| `Ctrl` `N` | New |
| `Ctrl` `Shift` `O` | Open... |
| `Alt` `F4` | Close |
| `Ctrl` `S` | Save... |
| `Ctrl` `Shift` `S` | Save As... |
| `Ctrl` `Shift` `E` | Export Batch |
| `Ctrl` `E` | Export Selected |
| `Ctrl` `Shift` `I` | Import |
{.shortcuts}
### Keys for Pen/Path
| Shortcut | Action |
| ---------------- | ------------------------ |
| `P` | Switch to Pen tool |
| `Alt` | Asymmetric control point |
| `Shift` | Snap control point angle |
| `Shift` | Snap anchor point angle |
| `Ctrl` `Alt` `U` | Add |
| `Ctrl` `Alt` `S` | Subtract |
| `Ctrl` `Alt` `I` | Intersect |
| `Ctrl` `Alt` `X` | Exclude overlap |
| `Ctrl` `8` | Convert to path |
{.shortcuts}
### Keys for Layers (Objects), Groups, and Artboards {.row-span-2}
| Shortcut | Action |
| ------------------ | ------------------------- |
| `Ctrl` `G` | Group layers |
| `Ctrl` `Shift` `G` | Ungroup layers |
| `Ctrl` `K` | Make component |
| `Ctrl` `L` | Lock/Unlock layer |
| `Ctrl` `,` | Hide/Show layer |
| `Ctrl` `Shift` `M` | Mask with shape |
| `Ctrl` `R` | Make repeat grid |
| `1-9` | Change layer opacity |
| `Ctrl` `;` | Show/Hide artboard guides |
| `Ctrl` `Shift` `;` | Lock artboard guides |
{.shortcuts}
### Keys for Align
| Shortcut | Action |
| ---------------------- | --------------------- |
| `Ctrl` `Shift` `Left` | Left |
| `Shift` `C` | Center (horizontally) |
| `Ctrl` `Shift` `Right` | Right |
| `Ctrl` `Shift` `Up` | Top |
| `Shift` `M` | Middle (vertically) |
| `Ctrl` `Shift` `Down` | Bottom |
{.shortcuts}
### Keys for Arrange
| Shortcut | Action |
| ------------------ | -------------- |
| `Ctrl` `Shift` `]` | Bring to front |
| `Ctrl` `]` | Bring forward |
| `Ctrl` `[` | Send backward |
| `Ctrl` `Shift` `[` | Send to back |
{.shortcuts}
### Keys for Distribute
| Shortcut | Action |
| ------------------ | ---------- |
| `Ctrl` `Shift` `H` | Horizontal |
| `Ctrl` `Shift` `V` | Vertical |
{.shortcuts}
### Keys for Text
| Shortcut | Action |
| ------------------ | ------------------ |
| `Ctrl` `B` | Bold |
| `Ctrl` `I` | Italic |
| `Ctrl` `Shift` `.` | Increase font size |
| `Ctrl` `Shift` `,` | Decrease font size |
{.shortcuts}
### Keys for Operations menu
| Shortcut | Action |
| ------------- | ---------------------------------------- |
| `Alt` | From center |
| `Shift` | Constrain |
| `Enter` | Edit text |
| `Shift` | Constrain rotate (15 deg) |
| `Shift` | Line constrain rotate (45 deg) |
| `Shift` `Alt` | Constrain from center |
| `Ctrl` | Direct select |
| `Ctrl` `Tab` | Switch between Design and Prototype mode |
{.shortcuts}
### Keys for Tools menu
| Shortcut | Action |
| ---------- | ----------------- |
| `V` | Select |
| `R` | Rectangle |
| `E` | Ellipse |
| `Y` | Polygon |
| `L` | Line |
| `P` | Pen |
| `T` | Text |
| `A` | Artboard |
| `Z` | Zoom |
| `Ctrl` `3` | Zoom to selection |
| `I` | Eyedropper |
{.shortcuts}
### Keys for Interface and Viewing Options
| Shortcut | Action |
| ------------------ | --------------------------------------------- |
| `Ctrl` `+` | Zoom in |
| `Ctrl` `-` | Zoom out |
| `Ctrl` `0` | Zoom to fit |
| `Ctrl` `1` | Zoom to 100% |
| `Ctrl` `2` | Zoom to 200% |
| `Space` | Pan |
| `Ctrl` `Shift` `Y` | Assets |
| `Ctrl` `Y` | Layers |
| `Ctrl` `Shift` `'` | Show layout grid |
| `Ctrl` `'` | Show square grid |
| `Ctrl` `Tab` | Switch between Design and Prototype mode |
| `Up/Down` | Increase or decrease a value in a field by 1 |
| `Shift` `Up/Down` | Increase or decrease a value in a field by 10 |
{.shortcuts}
### Keys for Design Specs
| Shortcut | Action |
| ------------------ | ------------------------------------------ |
| `Ctrl` `+/-` | Zoom |
| `Ctrl` `0` | Reset zoom |
| `(arrows)` | Pan |
| `Shift` `(arrows)` | Faster pan |
| `Esc` | Go from Spec view to UX flow view |
| `Esc` | Remove focus from artboard in UX flow view |
{.shortcuts}
### Keys for Vector Editing
| Shortcut | Action |
| -------- | ------------------------------------ |
| `Enter` | Start editing selected vector object |
| `Esc` | Stop editing selected vector object |
{.shortcuts}
### Keys for Prototyping
| Shortcut | Action |
| ------------------ | ------------------------------------------------- |
| `Ctrl` `A` | See all connections in prototype mode |
| `Ctrl` `Enter` | Preview |
| `Ctrl` `Shift` `E` | Share prototype online |
| `Left/Right` | Navigate artboards in preview or shared prototype |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Adobe XD](https://helpx.adobe.com/xd/help/keyboard-shortcuts.html) _(helpx.adobe.com)_
================================================
FILE: source/_posts/affinity-designer.md
================================================
---
title: Affinity Designer
date: 2022-11-23 16:23:31.702748
background: bg-[#79cdf1]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 108 keyboard shortcuts found in Affinity Designer
---
## Keyboard Shortcuts
### Designer Persona {.row-span-2}
| Shortcut | Action |
| -------------- | -------------------------- |
| `Esc` | Cancel operation |
| `F1` | Help |
| `0-9` | Change opacity |
| `Tab` | Toggle UI |
| `T` | Cycle text tools |
| `Y` | Transparency tool |
| `I` | Color picker tool |
| `P` | Pen tool |
| `[` | Decrease brush size |
| `]` | Increase brush size |
| `A` | Node tool |
| `F` | Point transform tool |
| `G` | Fill tool |
| `H` | View tool |
| `;` | Toggle snapping |
| `\` | Clip to canvas |
| `Z` | Zoom tool |
| `X` | Toggle active selector |
| `C` | Corner tool |
| `V` | Move tool |
| `B` | Vector brush tool |
| `N` | Pencil tool |
| `M` | Cycle shape tool |
| `,` | Cycle split view |
| `.` | Reset selection box |
| `/` | Set fill or stroke to none |
| `Ctrl` `1` | Zoom to 100% |
| `Ctrl` `2` | Zoom to 200% |
| `Ctrl` `3` | Zoom to 400% |
| `Ctrl` `4` | Zoom to 800% |
| `Ctrl` `8` | Zoom to actual size |
| `Ctrl` `9` | Zoom to pixel size |
| `Ctrl` `0` | Zoom to fit |
| `Ctrl` `-` | Zoom out |
| `Ctrl` `=` | Zoom in |
| `Ctrl` `Tab` | Switch view |
| `Ctrl` `W` | Close |
| `Ctrl` `R` | Rulers |
| `Ctrl` `T` | Character |
| `Ctrl` `Y` | Redo |
| `Ctrl` `O` | Open |
| `Ctrl` `P` | Print |
| `Ctrl` `[` | Back one |
| `Ctrl` `]` | Forward one |
| `Ctrl` `Enter` | Convert to curves |
| `Ctrl` `A` | Select all |
| `Ctrl` `S` | Save |
| `Ctrl` `G` | Group |
| `Ctrl` `J` | Duplicate |
| `Ctrl` `L` | Lock |
| `Ctrl` `;` | Show guides |
| `Ctrl` `'` | Show grid |
| `Ctrl` `Z` | Undo |
| `Ctrl` `X` | Cut |
| `Ctrl` `C` | Copy |
| `Ctrl` `V` | Paste |
| `Ctrl` `N` | New |
| `Ctrl` `M` | Curves |
| `Ctrl` `,` | Preferences |
| `Space` | Hold for view tool |
{.shortcuts}
### Pixel Persona
| Shortcut | Action |
| -------- | --------------------------- |
| `W` | Selection brush |
| `E` | Erase brush |
| `I` | Color picker tool |
| `O` | Cycle dodge or burn brushes |
| `[` | Decrease brush size |
| `]` | Increase brush size |
| `G` | Flood fill tool |
| `L` | Freehand selection tool |
| `X` | Toggle active selector |
| `V` | Move tool |
| `B` | Cycle brush or pixel tools |
| `M` | Cycle marquees |
| `,` | Cycle split view |
| `.` | Reset selection box |
{.shortcuts}
### Modifiers and Layer Control {.row-span-2}
| Shortcut | Action |
| -------- | ---------------------------------------------------------------------- |
| `Alt` | Drawing and painting - temporarily switches to the color picker tool |
| `Shift` | Freehand selection tools - connects clicked points with straight lines |
| `Shift` | Reverses aspect ratio constraint on scaling |
| `Ctrl` | Scales from the center of selection |
| `Alt` | Ignores snapping during an operation |
| `Ctrl` | Geometric shapes - moves red handles symmetrically |
| `Shift` | Path text - maintains distance between red handles |
| `Ctrl` | Path text - moves red handles symmetrically |
| `Shift` | Pixel brush painting - draws straight line connecting two strokes |
| `Shift` | Pixel selections - constrains marquee to square or circle |
| `Ctrl` | Pixel selection - moves underlying layer rather than selection |
| `Alt` | Pixel selection - removes from selection |
| `Ctrl` | Pixel tool - erases from current layer or projects |
| `Shift` | Rotating - constrains rotations to 15 degree intervals |
| `Shift` | Selecting - scales multiple objects and layers |
| `Alt` | Selecting - selects object or layer behind current selection |
| `Ctrl` | Shearing - mirrors shear around center of object |
| `Shift` | Vector drawing tools - constrains handle angles to 15 degrees |
| `Alt` | Vector drawing tools - sets node to sharp for creating cusps |
| `Ctrl` | Vector drawing tools - temporarily switches to node editing from pen |
{.shortcuts}
### Advanced Text
| Shortcut | Action |
| --------------------------- | ------------------------ |
| `Ctrl` `T` | Character panel |
| `Ctrl` `Shift` `T` | Typography dialog |
| `Ctrl` `B` | Bold |
| `Ctrl` `I` | Italic |
| `Ctrl` `U` | Underline |
| `Ctrl` `Alt` `L` | Align left |
| `Ctrl` `Alt` `C` | Align center |
| `Ctrl` `Alt` `R` | Align right |
| `Alt` `Shift` `Left` | Tighten spacing more |
| `Alt` `Shift` `Right` | Loosen spacing more |
| `Ctrl` `Alt` `Shift` `Up` | Precise raise baseline |
| `Ctrl` `Alt` `Shift` `Down` | Precise lower baseline |
| `Ctrl` `Alt` `Down` | Precise increase leading |
| `Ctrl` `Alt` `Up` | Precise decrease leading |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Affinity Designer](https://affinityspotlight.com/article/downloadable-affinity-keyboard-shortcut-cheat-sheets/)
_(affinityspotlight.com)_
================================================
FILE: source/_posts/affinity-photo.md
================================================
---
title: Affinity Photo
date: 2022-11-23 16:23:31.694998
background: bg-[#d578f0]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 177 keyboard shortcuts found in Affinity Photo
---
## Keyboard Shortcuts
### Editing {.row-span-2}
| Shortcut | Action |
| ------------------ | ---------------------------------------------- |
| `Ctrl` `Alt` `I` | Resize document |
| `Ctrl` `Alt` `C` | Resize canvas |
| `.` | Reset selection box |
| `;` | Toggle snapping |
| `Ctrl` | Erase with pixel tool on current layer |
| `X` | Switch between Stroke/Fill color selectors |
| `Shift` `X` | Swap Stroke/Fill colour selectors |
| `/` | Set no fill on Stroke/Fill color selectors |
| `O` | Toggle between crop tool overlays |
| `Shift` `O` | Flip golden spiral overlay (crop tool enabled) |
| `Esc` | Cancel a sizing, moving, or creating operation |
| `(arrows)` | Move item |
| `Shift` `(arrows)` | Move item in 10x measurement units |
{.shortcuts}
### Tools (Tone Mapping Persona)
| Shortcut | Action |
| -------- | --------------------- |
| `H` | View tool |
| `Z` | Zoom tool |
| `B` | Overlay paint tool |
| `E` | Overlay erase tool |
| `G` | Overlay gradient tool |
{.shortcuts}
### Files
| Shortcut | Action |
| ------------------------ | ------------------------------------------------------- |
| `Ctrl` `N` | New document |
| `Ctrl` `Shift` `Alt` `N` | New from clipboard |
| `Ctrl` `O` | Open document |
| `Ctrl` `W` | Close document, or close app when no documents are open |
| `Ctrl` `Tab` | Switch document/view |
| `Ctrl` `S` | Save |
| `Ctrl` `Shift` `S` | Save as |
| `Ctrl` `Shift` `Alt` `S` | Export |
| `Ctrl` `P` | Print |
{.shortcuts}
### Vector Graphics
| Shortcut | Action |
| -------------- | ----------------------------------------------------- |
| `Ctrl` | Edit curves as you draw using node editing (from pen) |
| `Ctrl` `Enter` | Convert to curves |
{.shortcuts}
### Tools (Export Persona)
| Shortcut | Action |
| -------- | ----------------- |
| `S` | Slice tool |
| `L` | Layer select tool |
{.shortcuts}
### Tools (Develop Persona)
| Shortcut | Action |
| -------- | --------------------- |
| `S` | Sampler tool |
| `W` | White balance tool |
| `R` | Red eye removal tool |
| `L` | Blemish removal tool |
| `B` | Overlay paint tool |
| `E` | Overlay erase tool |
| `G` | Overlay gradient tool |
| `C` | Crop tool |
| `Z` | Zoom tool |
| `H` | View tool |
{.shortcuts}
### Tools
| Shortcut | Action |
| -------- | ---------------------------------------- |
| `G` | Flood fill tool/gradient cycle |
| `H` | View tool |
| `V` | Move tool |
| `C` | Crop tool |
| `W` | Selection tools cycle |
| `P` | Pen and node tool cycle |
| `Z` | Zoom tool |
| `S` | Clone tool |
| `U` | Shape tools cycle |
| `T` | Text tools cycle |
| `O` | Dodge, burn, and sponge brush tool cycle |
| `J` | Retouch tools cycle |
| `B` | Painting tools cycle |
| `E` | Erase tools cycle |
| `M` | Marquee selection tools cycle |
| `L` | Free hand selection tool |
{.shortcuts}
### Tools (Liquify Persona)
| Shortcut | Action |
| -------- | ------------------------- |
| `P` | Liquify push forward tool |
| `L` | Liquify push left tool |
| `T` | Liquify twirl tool |
| `U` | Liquify pinch tool |
| `B` | Liquify turbulence tool |
| `C` | Liquify mesh clone tool |
| `R` | Liquify reconstruct tool |
| `F` | Liquify freeze tool |
| `W` | Liquify thaw tool |
| `Z` | Liquify zoom tool |
| `H` | Liquify view tool |
{.shortcuts}
### Text {.row-span-3}
| Shortcut | Action |
| --------------------------- | ---------------------------------- |
| `Ctrl` `>` | Bigger text |
| `Ctrl` `<` | Smaller text |
| `Ctrl` `Alt` `>` | Precise bigger text |
| `Ctrl` `Alt` `<` | Precise smaller text |
| `Alt` `Left` | Tighten |
| `Alt` `Right` | Loosen |
| `Alt` `Shift` `Left` | Tighten more |
| `Alt` `Shift` `Right` | Loosen more |
| `Ctrl` `B` | Bold |
| `Ctrl` `I` | Italic |
| `Ctrl` `U` | Underline |
| `Ctrl` `T` | Show character |
| `Ctrl` `Shift` `T` | Show typography |
| `Ctrl` `Alt` `+` | Superscript |
| `Ctrl` `Alt` `-` | Subscript |
| `Ctrl` `Alt` `L` | Align left |
| `Ctrl` `Alt` `R` | Align right |
| `Ctrl` `Alt` `C` | Align center |
| `Ctrl` `Alt` `Shift` `\` | Justify left |
| `Alt` `Down` | Increase paragraph leading |
| `Alt` `Up` | Decrease paragraph leading |
| `Ctrl` `Shift` `Up` | Precise paragraph increase leading |
| `Ctrl` `Shift` `Down` | Precise paragraph decrease leading |
| `Alt` `Shift` `Up` | Raise baseline |
| `Alt` `Shift` `Down` | Lower baseline |
| `Ctrl` `Alt` `Shift` `Up` | Precise raise baseline |
| `Ctrl` `Alt` `Shift` `Down` | Precise lower baseline |
| `Ctrl` `Alt` `Space` | Special characters |
| `Ctrl` `Enter` | Line break |
| `Alt` `Space` | Non-breaking space |
| `Alt` `-` | En dash |
| `Alt` `Shift` `-` | Em dash |
| `Ctrl` `Shift` `;` | Spelling options |
{.shortcuts}
### Tools (Panorama Persona)
| Shortcut | Action |
| -------- | --------------------------------- |
| `A` | Transform source image tool |
| `L` | Add to source image mask tool |
| `U` | Erase from source image mask tool |
{.shortcuts}
### Edit
| Shortcut | Action |
| ------------------------ | -------------------- |
| `Ctrl` `Z` | Undo |
| `Ctrl` `Shift` `Z` | Redo |
| `Ctrl` `Shift` `C` | Copy merged |
| `Ctrl` `Shift` `V` | Paste style |
| `Ctrl` `Alt` `V` | Paste FX |
| `Ctrl` `Shift` `Alt` `V` | Paste without format |
| `Ctrl` `Alt` `V` | Paste inside |
| `Shift` `F5` | Fill |
| `Alt` `Tab` | Inpaint |
{.shortcuts}
### Layer Operations
| Shortcut | Action |
| ------------------------ | ------------------------------------------ |
| `Ctrl` `Alt` `A` | Select all layers |
| `Ctrl` `G` | Group |
| `Ctrl` `Shift` `G` | Ungroup |
| `Ctrl` `J` | Duplicate |
| `Ctrl` `I` | Invert |
| `Ctrl` `Shift` `]` | Move to front |
| `Ctrl` `]` | Move forward one |
| `Ctrl` `Shift` `[` | Move to back |
| `Ctrl` `[` | Move back one |
| `Ctrl` `Shift` `N` | New layer |
| `Ctrl` `E` | Merge down |
| `Ctrl` `Shift` `E` | Merge selected |
| `Ctrl` `Shift` `Alt` `E` | Merge visible |
| `F` | Toggle between frequency separation layers |
| `Ctrl` `Alt` `P` | Edit live projection |
{.shortcuts}
### Brush
| Shortcut | Action |
| -------- | -------------------------------------------------- |
| `0-9` | Change selected layer content/brush tool's opacity |
| `[/]` | Increase/decrease brush width |
{.shortcuts}
### View
| Shortcut | Action |
| -------------- | -------------------- |
| `Ctrl` `+` | Zoom in |
| `Ctrl` `-` | Zoom out |
| `Ctrl` `0` | Zoom to fit |
| `Ctrl` `1` | Zoom to 100% |
| `Ctrl` `2` | Zoom to 200% |
| `Ctrl` `3` | Zoom to 400% |
| `Ctrl` `4` | Zoom to 800% |
| `Ctrl` `8` | Zoom to actual size |
| `Ctrl` `9` | Zoom to pixel size |
| `Space` | Hot key panning |
| `Ctrl` `Space` | Hot key zoom in |
| `H` | View tool |
| `Ctrl` `Tab` | Switch between views |
| `Ctrl` `R` | Show rulers |
| `Ctrl` `;` | Show guides |
| `Ctrl` `'` | Show grid |
{.shortcuts}
### Pixel Selection / Mask
| Shortcut | Action |
| ------------------ | ------------------------------------------------------------ |
| `Ctrl` `A` | Select all |
| `Ctrl` `D` | Deselect |
| `Ctrl` `Shift` `I` | Invert pixel selection |
| `Ctrl` | Add to selection (marquee or free hand selection tools only) |
| `Alt` | Remove from selection |
| `Ctrl` `B` | Grow or shrink |
| `Shift` `F6` | Feather |
| `Ctrl` `Alt` `R` | Refine edges |
| `(arrows)` | Move selection in 1 pixel increments |
| `Shift` `(arrows)` | Move selection in 10 pixel increments |
| `Q` | Quick mask |
| `Ctrl` `I` | Invert mask |
{.shortcuts}
### Workspace
| Shortcut | Action |
| ------------------ | -------------------------- |
| `Ctrl` `Shift` `H` | Show or hide studio panels |
| `Ctrl` `Alt` `T` | Show or hide toolbar |
| `Tab` | Toggle UI |
| `Ctrl` `H` | Hide workspace |
{.shortcuts}
### Adjustment and Filter
| Shortcut | Action |
| ------------------------ | -------------------------- |
| `Ctrl` `L` | Levels adjustment |
| `Ctrl` `U` | HSL adjustment |
| `Ctrl` `I` | Invert adjustment |
| `Ctrl` `M` | Curves adjustment |
| `Ctrl` `Shift` `Alt` `B` | Black and white adjustment |
| `Ctrl` `F` | Repeat filter |
{.shortcuts}
### Liquify Persona
| Shortcut | Action |
| ---------- | ----------- |
| `Ctrl` `D` | Mask all |
| `Ctrl` `I` | Invert mask |
| `Ctrl` `A` | Clear mask |
{.shortcuts}
### Misc
| Shortcut | Action |
| ---------------- | -------------------------- |
| `Ctrl` `,` | Preferences |
| `Ctrl` `Alt` `L` | Liquify persona |
| `Ctrl` `Alt` `E` | Export persona |
| `Ctrl` `Alt` `R` | Develop persona |
| `Ctrl` `Alt` `H` | Hide others (applications) |
| `Ctrl` `Alt` `M` | Media browser |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Affinity Photo](https://affinityspotlight.com/article/downloadable-affinity-keyboard-shortcut-cheat-sheets/)
_(affinityspotlight.com)_
================================================
FILE: source/_posts/ai.md
================================================
---
title: AI Directory
date: 2023-03-02 11:28:43
background: bg-purple-600
tags:
- AI
- List
- Tools
- Resources
categories:
- Other
intro:
This is a quick reference list of cheat sheets for the AI Navigation Directory, designed to help you discover exciting
AI tools.
---
## Getting Started
### Health & fitness
- [ Buoy health](https://buoyhealth.com)
- [ Mdacne](https://mdacne.com)
- [ Youper](https://youper.ai)
- [ Endel × james blake: wind down](https://endel.io/sleep)
- [ Dialogue](https://nowdialogue.com)
- [ Maslo ai](https://maslo.ai)
{.icon-list .marker-none}
### Text
- [ Quillbot paraphraser](https://quillbot.com)
- [ Notion ai](https://notion.so/product/ai)
- [ Naturalreader](https://naturalreaders.com)
- [ Wordtune read](https://wordtune.com/read)
- [ Underduck](https://uberduck.ai)
- [ Slogan generator](https://aiseo.ai/templates/slogan-generator.html)
{.icon-list .marker-none}
### Writing
- [ Prowritingaid](https://prowritingaid.com)
- [ Sapling](https://sapling.ai)
- [ Headline studio](https://coschedule.com/headline-studio)
- [ Trinka](https://trinka.ai)
- [ Benchmark email](https://benchmarkemail.com/features/smart-content)
- [ Sassbook ai writer](https://sassbook.com/ai-writer)
{.icon-list .marker-none}
### Image editing
- [ Remove.bg](https://remove.bg)
- [ Quicktools by picsart](https://tools.picsart.com/image)
- [ Befunky](https://befunky.com)
- [ Topaz photo ai](https://topazlabs.com/topaz-photo-ai)
- [ Photoroom](https://photoroom.com)
- [ Erase.bg](https://erase.bg)
{.icon-list .marker-none}
### Productivity
- [ Dall-e](https://openai.com/blog/dall-e)
- [ Flowrite](https://flowrite.com)
- [ Golden](https://golden.com)
- [ Picturethis](https://picturethisai.com)
- [ Weights & biases](https://wandb.ai/site)
- [ Vwo humans vs ai](https://vwo.com/ab-testing-openai-gpt-3)
{.icon-list .marker-none}
### Music
- [ Musenet (openai)](https://openai.com/blog/musenet)
- [ Tensorflow research cloud](https://sites.research.google/trc)
- [ Moises app](https://moises.ai)
- [ Soundraw](https://soundraw.io)
- [ Ai lyrics generator](https://theselyricsdonotexist.com)
- [ Phonicmind](https://phonicmind.com)
{.icon-list .marker-none}
### Design assistant
- [ Cartoonify](https://kapwing.com/cartoonify)
- [ Smart upscaler](https://icons8.com/upscaler)
- [ Background remover](https://icons8.com/bgremover)
- [ Lunacy](https://icons8.com/lunacy)
- [ Pixlr](https://pixlr.com)
- [ Launchaco free logo builder](https://namecheap.com/logo-maker)
{.icon-list .marker-none}
### Image
- [ Swapper](https://icons8.com/swapper)
- [ Movavi picverse](https://movavi.com/photo-editor)
- [ Clipstudio](https://clipstudio.net/en)
- [ Looka](https://looka.com)
- [ Midjourney](https://midjourney.com)
- [ Text to image api](https://deepai.org/machine-learning-model/text2img)
{.icon-list .marker-none}
### Business
- [ Ai writer by picsart](https://tools.picsart.com/text/ai-writer)
- [ Intelligent paraphraser](https://aiseo.ai/tools/paraphrasing-tool.html)
- [ Bardeen ai](https://bardeen.ai)
- [ Resumai](https://wonsulting.com/resumai)
- [ Durable ai site builder](https://durable.co/ai-website-builder)
- [ Startup pitch generator](https://tally.so/r/npeJgq)
{.icon-list .marker-none}
### Virtual reality
- [ Deep nostalgia™](https://myheritage.com/deep-nostalgia)
- [ Gpt-3 custom ai voices](https://resemble.ai/gpt-3)
- [ Ai portraits by sketchar](https://sketchar.io)
- [ Anything world](https://anything.world)
- [ Aipoly](https://aipoly.com)
- [ Amazon comprehend](https://aws.amazon.com/comprehend)
{.icon-list .marker-none}
### Developer tools
- [ Openai for coda](https://coda.io/@coda/openai-for-coda)
- [ Nanonets ocr](https://case-study-page-nanonets.webflow.io/ocr-api)
- [ Google.ai](https://ai.google)
- [ Assemblyai](https://assemblyai.com)
- [ Httpie ai](https://httpie.io)
- [ Runpod](https://runpod.io)
{.icon-list .marker-none}
### Avatar
- [ Ai time machine](https://myheritage.com/ai-time-machine)
- [ Ready player me](https://readyplayer.me)
- [ Openart photo booth](https://openart.ai/photobooth)
- [ Reface ai](https://hey.reface.ai)
- [ Pandora avatars](https://socialbook.io/ai-avatar)
- [ Livereacting ai](https://livereacting.com/ai-host-for-live-stream)
{.icon-list .marker-none}
### Fun tools
- [ Write with artificial intelligence](https://transformer.huggingface.co)
- [ Chai](https://chai.ml)
- [ How bad is your spotify?](https://pudding.cool/2020/12/judge-my-spotify)
- [ Playphrase.me](https://playphrase.me/)
- [ Dreamily](https://dreamily.ai/editor)
- [ Supermeme.ai](https://supermeme.ai)
{.icon-list .marker-none}
### Seo
- [ Writer](https://writer.com)
- [ Jenni](https://jenni.ai)
- [ Articleforge](https://articleforge.com)
- [ Wordhero](https://wordhero.co)
- [ Ai-writer](https://ai-writer.com)
- [ Growthbar](https://growthbarseo.com)
{.icon-list .marker-none}
### Video editing
- [ Wave.video](https://wave.video)
- [ Topaz video ai](https://topazlabs.com/topaz-video-ai)
- [ Unscreen.com](https://unscreen.com)
- [ Pictory](https://pictory.ai)
- [ Type studio](https://typestudio.co/tool/video-to-text)
- [ Papercup](https://papercup.com)
{.icon-list .marker-none}
### Code assistant
- [ Ghostwriter](https://replit.com/site/ghostwriter)
- [ Fig ai](https://fig.io/user-manual/ai)
- [ Continual](https://continual.ai)
- [ Cheat layer](https://cheatlayer.com)
- [ Kodezi ai](https://kodezi.com)
- [ Whatthediff](https://whatthediff.ai)
{.icon-list .marker-none}
### Mac
- [ Whatthefont](https://myfonts.com)
- [ References.design](https://references.design)
- [ Swift ai](https://github.com/Swift-AI/Swift-AI)
{.icon-list .marker-none}
### Audio editing
- [ Voicemod](https://voicemod.net)
- [ Podcastle](https://podcastle.ai)
- [ Beatoven.ai](https://beatoven.ai)
- [ Altered](https://altered.ai)
- [ Cleanvoice ai](https://cleanvoice.ai)
- [ Krisp](https://krisp.ai)
{.icon-list .marker-none}
### Copywriting
- [ Ink](https://inkforall.com)
- [ Respondable](https://boomeranggmail.com/respondable)
- [ Frase](https://frase.io)
- [ Anyword](https://anyword.com)
- [ Copysmith](https://copysmith.ai)
- [ Hypotenuse ai](https://hypotenuse.ai)
{.icon-list .marker-none}
### General writing
- [ Languagetool](https://languagetool.org)
- [ Wordtune](https://wordtune.com)
- [ Kickresume](https://kickresume.com)
- [ Nichess](https://nichesss.com)
- [ Wordai](https://wordai.com)
- [ Corrector app](https://corrector.app)
{.icon-list .marker-none}
### Summarizer
- [ Otter ai](https://otter.ai)
- [ Tldr this](https://tldrthis.com)
- [ Summari](https://summari.com)
- [ Tactiq](https://tactiq.io)
- [ Genei](https://genei.io)
- [ Upword](https://upword.ai)
{.icon-list .marker-none}
### Video generator
- [ Invideo](https://invideo.io)
- [ Film](https://replicate.com/google-research/frame-interpolation)
- [ Synthesia](https://synthesia.io)
- [ Movio](https://movio.la)
- [ Hourone](https://hourone.ai)
- [ Colossyan](https://colossyan.com)
{.icon-list .marker-none}
### Legal assistant
- [ Donotpay](https://donotpay.com)
- [ Darrow ai](https://darrow.ai)
- [ Spellbook](https://spellbook.legal)
- [ Patentpal](https://patentpal.com)
- [ Legal robot](https://legalrobot.com)
- [ Detangle.ai](https://detangle.ai)
{.icon-list .marker-none}
### Generative art
- [ Hotpot art generator](https://hotpot.ai/art-generator)
- [ Bannerbear](https://bannerbear.com)
- [ 6pen art](https://6pen.art)
- [ Memorable ad maker](https://admaker.memorable.io)
- [ Flair](https://withflair.ai)
- [ Designed with ai](https://designedwithai.com)
{.icon-list .marker-none}
### Text to speech
- [ Speechify](https://speechify.com)
- [ Fakeyou](https://fakeyou.com)
- [ Play.ht](https://play.ht)
- [ Wellsaidlabs](https://wellsaidlabs.com)
- [ Resemble](https://resemble.ai)
- [ Aiva](https://aiva.ai)
{.icon-list .marker-none}
### Life assistant
- [ Resume worded](https://resumeworded.com/index.php)
- [ Replika](https://replika.com)
- [ Justlearn](https://justlearn.com)
- [ Thekeys](https://thekeys.ai)
- [ Looria](https://looria.com)
- [ Woebot health](https://woebothealth.com)
{.icon-list .marker-none}
### Image generator
- [ Hotpot.ai](https://hotpot.ai)
- [ Generated photos](https://generated.photos)
- [ Imgcreator](https://imgcreator.zmo.ai)
- [ Getimg.ai](https://getimg.ai)
- [ Stock ai](https://stockai.com)
- [ Go charlie](https://gocharlie.ai)
{.icon-list .marker-none}
### Book
- [ Sona](https://readthistwice.com/sona)
{.icon-list .marker-none}
### Gaming
- [ Aidungeon](https://play.aidungeon.io)
- [ Eyeware beam](https://beam.eyeware.tech)
- [ Litrpg adventures](https://litrpgadventures.com)
- [ Charisma](https://charisma.ai)
- [ Hidden door](https://hiddendoor.co)
- [ Ggpredict](https://ggpredict.io)
{.icon-list .marker-none}
### Image scanning
- [ Thing translator](https://experiments.withgoogle.com/thing-translator)
- [ Polycam](https://poly.cam)
{.icon-list .marker-none}
### Sales
- [ Klaviyo sms assistant](https://klaviyo.com/product/whats-new/sms-assistant)
- [ Instantly](https://instantly.ai)
- [ Affinity](https://affinity.co)
- [ Wingman](https://trywingman.com)
- [ Lavender](https://lavender.ai)
- [ Cresta](https://cresta.com)
{.icon-list .marker-none}
### Audio
- [ Descript](https://descript.com)
- [ Lalal.ai voice cleaner](https://lalal.ai)
- [ Poly ai](https://poly.ai)
- [ Wzrd.ai](https://wzrd.ai)
- [ Rythmex](https://rythmex.com)
- [ Blogaudio](https://blogaudio.co)
{.icon-list .marker-none}
### Analytics
- [ Papers with code](https://paperswithcode.com)
- [ Explainpaper](https://explainpaper.com)
- [ Anania](https://anania.ai)
- [ Voiceops](https://voiceops.com)
- [ Stormly 2.0](https://stormly.com)
- [ Sahha](https://sahha.ai)
{.icon-list .marker-none}
### Fintech
- [ Nova money](https://novamoney.app.link/PH)
{.icon-list .marker-none}
### Marketing
- [ Monkeylearn](https://monkeylearn.com)
- [ Networkai](https://wonsulting.com/networkai)
- [ Reply.io](https://reply.io)
- [ Outranking](https://outranking.io)
- [ Seo content assistant by searchatlas](https://linkgraph.io/seo-content-assistant)
- [ Adcreative.ai](https://adcreative.ai)
{.icon-list .marker-none}
### Story teller
- [ Novelai](https://novelai.net)
- [ Artflow ai](https://artflow.ai)
- [ Subtxt](https://subtxt.app)
- [ Scene one](https://sceneone.app)
- [ Story path](https://storypath.app)
- [ What on earth?](https://whatonearth.xyz)
{.icon-list .marker-none}
### Low-code/no-code
- [ Vwo](https://vwo.com/testing)
- [ Mutiny](https://mutinyhq.com)
- [ Nanonets](https://nanonets.com)
- [ Axiom](https://axiom.ai)
- [ Viable](https://askviable.com)
- [ Durable](https://durable.co)
{.icon-list .marker-none}
### Art
- [ Wombo](https://wombo.art)
- [ Neural.love art generator](https://neural.love)
- [ Promptomania](https://promptomania.com)
- [ Lexica](https://lexica.art)
- [ Ai avatars](https://alethea.ai/avatars)
- [ Diffusionbee](https://diffusionbee.com)
{.icon-list .marker-none}
### Customer communication
- [ Algolia recommend](https://algolia.com/products/recommendations)
{.icon-list .marker-none}
### Chrome extensions
- [ Sendpulse for slack](https://sendpulse.com)
- [ X.ai](https://bizzabo.com)
- [ Pipecandy](https://pipecandy.com)
- [ Free article outline generator](https://surferseo.com/free-article-outline-generator)
- [ Fyle](https://fylehq.com)
- [ Socialbook cartoonizer](https://socialbook.io/cartoonize)
{.icon-list .marker-none}
### Search engine
- [ Algolia](https://algolia.com)
- [ Everypixel](https://everypixel.com)
- [ Andi](https://andisearch.com)
- [ One more ai](https://onemoreai.com)
- [ Imaiger](https://imaiger.com)
- [ Dreamsands](https://dreamsands.ai)
{.icon-list .marker-none}
### Research
- [ Elicit](https://elicit.org)
- [ Scispace](https://typeset.io)
- [ Adept](https://adept.ai)
- [ Scholarcy](https://scholarcy.com)
- [ Consensus](https://consensus.app)
- [ Akkio](https://akkio.com)
{.icon-list .marker-none}
### Browser extensions
- [ Motion task manager](https://usemotion.com)
{.icon-list .marker-none}
### Pc
- [ Gradient°](https://paperspace.com/gradient)
{.icon-list .marker-none}
### Prompt
- [ Img2prompt](https://replicate.com/methexis-inc/img2prompt)
- [ Openart](https://openart.ai)
- [ Decktopus](https://decktopus.com/blog/chatgpt-prompts-for-your-next-launch)
- [ Promptbase](https://promptbase.com)
- [ Krea](https://krea.ai)
- [ Pyttipanna](https://pyttipanna.xyz)
{.icon-list .marker-none}
### Email
- [ The landing page analyzer by unbounce](https://unbounce.com)
- [ Smart copy everywhere](https://unbounce.com/smart-copy-everywhere)
- [ Breadcrumbs reveal](https://breadcrumbs.io/reveal)
- [ Emerging tech brew](https://emergingtechbrew.com)
- [ Snazzy ai](https://snazzy.ai)
- [ Conduit](https://conduithq.com)
{.icon-list .marker-none}
### Image improvement
- [ Vanceai image upscaler](https://vanceai.com/image-enlarger)
- [ Cloudinary](https://cloudinary.com)
- [ Nero image upscaler](https://ai.nero.com/image-upscaler)
- [ Lensa](https://prisma-ai.com/lensa)
- [ Leiapix](https://convert.leiapix.com)
- [ Lama cleaner](https://github.com/Sanster/lama-cleaner)
{.icon-list .marker-none}
### Human resources
- [ Chatbot](https://chatbot.com/features)
- [ Moveworks](https://moveworks.com)
- [ Findem](https://findem.ai)
- [ Skillroads](https://skillroads.com)
- [ Qatalog](https://qatalog.com)
- [ Tars](https://hellotars.com/ph)
{.icon-list .marker-none}
### Website
- [ Getresponse](https://getresponse.com/features/website-builder)
- [ Aida](https://bookmark.com/ai-website-builder)
- [ Studio design](https://studio.design)
{.icon-list .marker-none}
### Branding
- [ Namesnack](https://namesnack.com)
- [ Namify](https://namify.tech)
- [ Namefruits](https://namefruits.com)
{.icon-list .marker-none}
### Speech
- [ Elsa speech analyzer](https://speechanalyzer.elsaspeak.com)
- [ Speech-to-speech](https://resemble.ai/speech-to-speech)
{.icon-list .marker-none}
### Communication
- [ Poised 2.0](https://poised.com)
{.icon-list .marker-none}
### Other
- [ Yolo](https://pjreddie.com/darknet/yolo)
- [ How normal am i?](https://hownormalami.eu)
- [ Toonify](https://toonify.photos)
- [ Gpt-3 crush](https://gptcrush.com/resources)
- [ Handl](https://handl.ai)
- [ Ai cheatsheet](https://aicheatsheet.comuzi.xyz)
{.icon-list .marker-none}
### Health
- [ Ubie ai symptom checker](https://ubiehealth.com)
{.icon-list .marker-none}
### Aggregator
- [ Gpt-3 demo](https://gpt3demo.com)
- [ Futurepedia](https://futurepedia.io)
- [ Ai library](https://library.phygital.plus)
- [ Smoking robot ai](https://smokingrobot.ai)
- [ All things ai](https://allthingsai.com)
- [ Aitogrow](https://aitogrow.com)
{.icon-list .marker-none}
### Customer support
- [ Harvey](https://hiverhq.com/harvey-ai-customer-support)
- [ Forethought](https://forethought.ai)
- [ Kore.ai](https://kore.ai)
- [ Regie](https://regie.ai)
- [ Typewise](https://typewise.app)
- [ Quickchat](https://quickchat.ai)
{.icon-list .marker-none}
### Movies
- [ Taste](https://taste.io)
{.icon-list .marker-none}
### Video
- [ Deepfakesweb](https://deepfakesweb.com)
- [ Fineshare](https://fineshare.com/finecam)
- [ Wisecut](https://wisecut.video)
- [ Elai](https://elai.io)
- [ Move](https://move.ai)
- [ Twelve labs](https://twelvelabs.io)
{.icon-list .marker-none}
### Email assistant
- [ Missive](https://missiveapp.com)
- [ Magicreach](https://magicreach.ai)
- [ Ellie](https://ellieai.com)
- [ Superreply](https://superreply.co)
- [ Chatgpt writer](https://chatgptwriter.ai)
- [ Superhuman](https://superhuman.com)
{.icon-list .marker-none}
### Messaging
- [ Madgicx for facebook ads](https://madgicx.com)
- [ Bottr.me](https://bottr.me)
- [ Octane ai](https://octaneai.com)
- [ Nerdify bot](https://gonerdify.com/nerdybot)
- [ Fritz](https://fritz.ai/launch)
- [ Abe](https://abe.ai)
{.icon-list .marker-none}
### Generative video
- [ Lumen5](https://lumen5.com)
- [ Livereacting](https://livereacting.com)
- [ Reachout.ai](https://reachout.ai)
- [ One shot talking face](https://huggingface.co/spaces/camenduru/one-shot-talking-face)
- [ Boolvideo](https://boolvideoinvite.carrd.co)
- [ Quickvid](https://quickvid.ai)
{.icon-list .marker-none}
### Safari extensions
- [ Rezi 3.0](https://rezi.ai/ai-resume-builder)
{.icon-list .marker-none}
### Transcriber
- [ Fireflies.ai](https://fireflies.ai)
- [ Steno](https://steno.ai)
- [ Peech](https://peech-ai.com)
- [ Anypod](https://anypod.ai)
- [ Supertranslate](https://supertranslate.ai)
{.icon-list .marker-none}
### Motion capture
- [ Rokoko](https://rokoko.com)
- [ Cascadeur](https://cascadeur.com)
{.icon-list .marker-none}
### Voice
- [ Fineshare](https://fineshare.com/finevoice)
- [ Voice ai](https://voice.ai)
- [ Vocads survey](https://vocads.com)
- [ Whisperapi](https://whisperapi.com)
- [ Createaivoiceovers](https://createaivoiceovers.com)
{.icon-list .marker-none}
### Machine learning
- [ H2o ai](https://h2o.ai)
- [ Nocodebooth](https://nocodebooth.com)
{.icon-list .marker-none}
### Social media assistant
- [ Tweet hunter](https://tweethunter.io)
- [ Socialbu](https://socialbu.com)
- [ Predis](https://predis.ai)
- [ Feedhive](https://feedhive.com)
- [ Audiolabs](https://audiolabs.io)
- [ Zaap.ai](https://zaap.ai)
{.icon-list .marker-none}
### Inspiration
- [ Gpt cheat sheet](https://entreresource.com/chatgpt-cheat-sheet)
- [ 100+ ai prompts](https://trello.com/b/4BPkSY1w/100-ai-prompts-resources-prompt-lovers)
- [ Midjourney prompt database](https://aealexander.com/midjourney-prompt-database)
- [ Midjourney prompt tool](https://prompt.noonshot.com)
- [ Saas library](https://saaslibrary.dev)
- [ Ordinary prompts](https://ordinarypeopleprompts.com)
{.icon-list .marker-none}
### Stocks
- [ Torto.ai](https://torto.ai/welcome)
{.icon-list .marker-none}
### Voice modulation
- [ Voice.ai](https://voice.ai/voice-ai-beta/I2p6L)
- [ Metavoice studio](https://studio.themetavoice.xyz)
{.icon-list .marker-none}
### Paraphraser
- [ Paraphraser](https://paraphrasetool.com)
- [ Rephrasely](https://rephrasely.com)
- [ Bearly](https://bearly.ai)
- [ Wordfixerbot](https://wordfixerbot.com)
{.icon-list .marker-none}
### Amazon
- [ Thereviewindex](https://TheReviewIndex.com/us)
{.icon-list .marker-none}
### Personalized videos
- [ Windsor](https://windsor.io)
- [ Rephrase](https://rephrase.ai)
- [ Maverick](https://trymaverick.com)
- [ Bhuman](https://bhuman.ai)
- [ Vidyo](https://vidyo.ai)
{.icon-list .marker-none}
### Spreadsheets
- [ Excel formula bot](https://excelformulabot.com)
- [ Sheetgod](https://boloforms.com/sheetgod)
- [ Sheet ai](https://sheetai.app)
- [ Sheet+](https://sheetplus.ai)
- [ Simple ml](https://workspace.google.com/marketplace/app/simple_ml_for_sheets/685936641092)
{.icon-list .marker-none}
### Ipad
- [ Brain.fm](https://brain.fm)
{.icon-list .marker-none}
### Task management
- [ Levity](https://levity.ai)
- [ Athena](https://apac.ai)
- [ Teacherbot](https://teacherbot.io)
{.icon-list .marker-none}
### Email marketing
- [ Phrasee](https://phrasee.co)
{.icon-list .marker-none}
### Fashion
- [ Cala](https://ca.la)
- [ Botika](https://botika.io)
- [ Fashionadvisorai](https://fashionadvisorai.com)
- [ Visualhound](https://visualhound.com)
{.icon-list .marker-none}
### Generator
- [ Blocksurvey](https://blocksurvey.io/ai-surveys)
{.icon-list .marker-none}
### 3d
- [ Deepmotion](https://deepmotion.com)
- [ Plask](https://plask.ai)
- [ Imagine 3d](https://captures.lumalabs.ai/imagine)
- [ Luma ai](https://lumalabs.ai)
- [ Kaedim](https://kaedim3d.com)
- [ Masterpiece studio](https://masterpiecestudio.com)
{.icon-list .marker-none}
### Home
- [ Shapescale](https://shapescale.com)
- [ Smartmirror](https://github.com/Shinao/SmartMirror)
{.icon-list .marker-none}
### Api
- [ Deepgram](https://deepgram.com)
- [ Banana](https://banana.dev)
- [ Perspective](https://perspectiveapi.com)
- [ Theneo](https://theneo.io)
- [ Base64.ai](https://base64.ai)
- [ Trueface.ai](https://trueface.ai)
{.icon-list .marker-none}
### Software engineering
- [ Prodigy](https://prodi.gy)
{.icon-list .marker-none}
### Open source
- [ Floyd](https://blog.floydhub.com)
- [ Mindsdb](https://cloud.mindsdb.com)
- [ Evidently ai](https://evidentlyai.com)
- [ Warriorjs](https://warrior.js.org)
- [ Datature](https://datature.io)
- [ Viseo bot maker](https://bot.viseo.io)
{.icon-list .marker-none}
### Chat
- [ Ask poppy](https://poppylist.com/askpoppy)
- [ Gpt chatbot](https://chatbotgpt3.bubbleapps.io/version-test)
- [ Voiceflow](https://voiceflow.com)
- [ Chatgpt for siri](https://mobilespoon.net/2023/01/how-to-activate-chatgpt-with-siri-and-save-response.html)
- [ Trudo](https://trudo.ai)
- [ Unschooler](https://unschooler.me)
{.icon-list .marker-none}
### Playstation
- [ Chatfuel](https://chatfuel.com)
{.icon-list .marker-none}
### Startup
- [ Rationale](https://rationale.jina.ai)
- [ Finta](https://trustfinta.com)
- [ Ideabuddy](https://ideabuddy.com)
- [ Broadn](https://broadn.io)
- [ Validator ai](https://validatorai.com)
- [ Namelix](https://namelix.com)
{.icon-list .marker-none}
### Experiments
- [ Alethea](https://alethea.ai)
- [ This model does not exist](https://thismodeldoesnotexist.co)
{.icon-list .marker-none}
### Windows
- [ Superannotate desktop](https://superannotate.com)
{.icon-list .marker-none}
### Generative code
- [ Gradio](https://gradio.app)
- [ Obviously ai](https://obviously.ai)
- [ Sourceai](https://sourceai.dev)
- [ No-code ai model builder](https://no-code-ai-model-builder.com)
- [ Codesquire](https://codesquire.ai)
- [ Aigur](https://aigur.dev)
{.icon-list .marker-none}
### Photography
- [ Portrait by vana](https://portrait.vana.com)
- [ Photorestoration](https://photorestoration.ai)
- [ Ecosnap](https://ecosnap.vercel.app)
- [ Pose animator](https://github.com/yemount/pose-animator)
- [ Facebook computer vision tags](https://github.com/ageitgey/show-facebook-computer-vision-tags)
- [ Dpth](https://dpth.app)
{.icon-list .marker-none}
### Healthcare
- [ Whisper ai](https://whisper.ai)
{.icon-list .marker-none}
### Resources
- [ Lablab.ai](https://lablab.ai)
- [ Ai art apps database](https://aiartapps.com)
- [ Ai experiments](https://experiments.withgoogle.com/collection/ai)
- [ Flowgpt](https://flowgpt.com)
{.icon-list .marker-none}
### Growth hacking
- [ Depict.ai](https://depict.ai)
{.icon-list .marker-none}
### Kids
- [ Brickit](https://brickit.app)
{.icon-list .marker-none}
### Search
- [ Open](https://open.ai)
{.icon-list .marker-none}
### Speech-to-text
- [ Glasp youtube summarizer](https://glasp.co/youtube-summary)
- [ Relayed](https://relayed.ai)
- [ Meeple](https://meeple.ai)
- [ Towords](https://app.towords.io)
- [ Melville app](https://usemelville.com)
{.icon-list .marker-none}
### Articles
- [ Riku](https://riku.ai/creators)
{.icon-list .marker-none}
### Podcast
- [ Snipd podcast summaries](https://snipd.com/ai-podcast-summaries)
- [ Sumly](https://sumly.ai)
- [ Tapesearch](https://tapesearch.com)
{.icon-list .marker-none}
### Parenting
- [ Parentivity](https://smartivity.in/pages/parentivity_bot)
- [ Sesh](https://gosesh.com)
{.icon-list .marker-none}
### Education assistant
- [ Brain Buddy](https://brain-buddy.com/)
- [ Kobra](https://kobra.dev)
- [ Boldvoice](https://boldvoice.com)
- [ Prepai](https://prepai.in/us)
- [ Eli5](https://explainlikeimfive.io)
- [ Tutorai](https://tutorai.me)
- [ Yip](https://yippity.io)
{.icon-list .marker-none}
### Tracking
- [ Hexowatch](https://hexowatch.com)
{.icon-list .marker-none}
### Privacy
- [ Anonymous camera](https://playground.ai)
- [ Guard](https://useguard.com)
{.icon-list .marker-none}
### Vehicle
- [ Polymath robotics](https://polymathrobotics.com)
{.icon-list .marker-none}
### Twitter
- [ Tribescaler](https://tribescaler.com)
- [ Kanye tweet generator](https://kanyegenerator.com)
- [ Tweetspear](https://tweetspear.com)
- [ Tweept3](https://tweept3.com)
- [ Tweetai](https://tweetai.com)
{.icon-list .marker-none}
### Dev
- [ Eden ai](https://edenai.co)
- [ Maya ai](https://meetmaya.world)
- [ Testkit](https://testkit.app)
{.icon-list .marker-none}
### Saas
- [ Yous](https://yous.ai)
- [ Docent](https://trydocent.ai)
{.icon-list .marker-none}
### Podcasting
- [ Audo ai](https://audo.ai)
{.icon-list .marker-none}
### Bot
- [ Hirex.ai](https://hirex.ai)
{.icon-list .marker-none}
### Finance
- [ Glean ai](https://glean.ai)
- [ Avanzai](https://avanz.ai)
{.icon-list .marker-none}
### Self-improvement
- [ Huberman ai](https://huberman.rile.yt)
{.icon-list .marker-none}
### Robots
- [ Activechat bot trainer](https://activechat.ai/intents-and-insights)
- [ Motion ai](https://motion.ai)
- [ Api to bot](https://apitobot.io)
{.icon-list .marker-none}
### Slack
- [ Thegist](https://thegist.ai)
- [ Chatbottle](https://chatbottle.co)
- [ Bot builder by recast.ai](https://cai.tools.sap)
{.icon-list .marker-none}
### Investing
- [ Founderfit by koble](https://koble.ai/founderfit)
{.icon-list .marker-none}
### Questions
- [ Jeeves](https://therocketbrew.com/jeeves)
- [ God in a box](https://godinabox.co)
{.icon-list .marker-none}
### Construction
- [ Aim](https://aim.vision)
{.icon-list .marker-none}
### Data
- [ Genius sheets](https://geniussheets.com)
- [ Ask command](https://askcommand.com)
- [ Nolu](https://noluai.com)
- [ Lookup](https://uselookup.com)
- [ Olli](https://olli.ai)
- [ Autopredict](https://autopredict.co.uk)
{.icon-list .marker-none}
### Plugin
- [ Jetbrains ide plugin](https://tldrdev.ai)
{.icon-list .marker-none}
### Pet
- [ Digital dogs](https://digitaldogs.ai)
- [ Aipetavatar](https://aipetavatar.com)
{.icon-list .marker-none}
### Sports
- [ Ai sports prediction](https://sportsprediction.ai)
{.icon-list .marker-none}
### User experience
- [ Clipdrop](https://arcopypaste.app)
- [ Airim 2.0](https://getairim.com)
- [ Akin](https://akin.nz)
{.icon-list .marker-none}
### Quiz
- [ Quizgecko](https://quizgecko.com)
{.icon-list .marker-none}
### Sql
- [ Decile](https://decile.app)
- [ Aihelperbot](https://aihelperbot.com)
- [ Ai query](https://aiquery.co)
- [ Ai2sql](https://ai2sql.io)
- [ Channel](https://usechannel.com)
{.icon-list .marker-none}
### Linkedin
- [ Linkedin posts generator](https://sid.black/tools/linkedin-post-generator)
{.icon-list .marker-none}
### Food
- [ Ai recipe generator](https://ai-recipes.softr.app)
- [ Foodai](https://foodai.app)
- [ What cake to bake?](https://whatcaketobake.com)
{.icon-list .marker-none}
### Tool
- [ Autoname](https://autoname.org)
- [ Assetsai](https://assetsai.art)
- [ Aibusinesstool](https://aibusinesstool.com)
{.icon-list .marker-none}
### Emoji
- [ Ph bench](https://phben.ch)
{.icon-list .marker-none}
### Newsletters
- [ Machine learnings](https://subscribe.machinelearnings.co)
{.icon-list .marker-none}
### Streaming services
- [ Theirtube](https://their.tube)
{.icon-list .marker-none}
### Excel
- [ Formula dog](https://formula.dog)
{.icon-list .marker-none}
### Ai detection
- [ Detect gpt](https://thomas.io/detect-gpt)
- [ Is this image nsfw?](https://nsfw.m1guelpf.me)
{.icon-list .marker-none}
### News
- [ Speechkit](https://speechkit.io)
- [ Clarity](https://useclarity.com)
{.icon-list .marker-none}
### Vacation
- [ Roamr](https://letsroam.app)
{.icon-list .marker-none}
### Logo generator
- [ Make logo ai](https://makelogoai.com)
{.icon-list .marker-none}
### Real estate
- [ Ai room planner](https://airoomplanner.com)
- [ Coolaiid](https://coolaiid.com)
{.icon-list .marker-none}
### Assistant
- [ Eddyai](https://eddyai.com)
{.icon-list .marker-none}
### Bots
- [ Ai chatbots in messengers](https://ai-chatbots.pulse.is)
{.icon-list .marker-none}
### Advertising
- [ Jot](https://jotapp.tech)
{.icon-list .marker-none}
### Gift ideas
- [ Giftastic.ai](https://giftastic.ai)
- [ Cool gift ideas](https://coolgiftideas.io)
- [ Elf help](https://elfhelp.ai)
{.icon-list .marker-none}
### Text-to-speech
- [ Verbatik](https://verbatik.com)
{.icon-list .marker-none}
### Character
- [ Salewhale](https://salewhale.chat)
{.icon-list .marker-none}
### Memory
- [ Heyday](https://heyday.xyz)
{.icon-list .marker-none}
### Feedback
- [ Myess](https://myess.ai)
{.icon-list .marker-none}
### Background
- [ Zoomscape](https://zoomscape.ai)
{.icon-list .marker-none}
### Support
- [ Resolveai](https://resolveai.co)
{.icon-list .marker-none}
### Rank
- [ Reviewz](https://reviewz.ai)
{.icon-list .marker-none}
### Letter
- [ Recommendme](https://recommendme.to)
{.icon-list .marker-none}
### Gift
- [ Text2present](https://text2present.com)
{.icon-list .marker-none}
### Dream
- [ Scarlettpanda](https://scarlettpanda.com)
{.icon-list .marker-none}
### Excuse
- [ Excuses ai](https://excuses.ai)
{.icon-list .marker-none}
### Game
- [ Stable diffusion multiplayer](https://huggingface.co/spaces/huggingface-projects/stable-diffusion-multiplayer)
{.icon-list .marker-none}
### Edit
- [ Bigmp4](https://bigmp4.com)
{.icon-list .marker-none}
### Translation
- [ Languagepro](https://bot.petit.today)
{.icon-list .marker-none}
### Startup tools
- [ Releasenote.ai](https://releasenote.ai)
{.icon-list .marker-none}
### E-commerce
- [ Recommendix](https://recommendix.com/es-ar)
{.icon-list .marker-none}
### Beauty
- [ Hairbyai](https://hairbyai.com)
{.icon-list .marker-none}
### Photo
- [ Camira](https://camira.ai)
{.icon-list .marker-none}
================================================
FILE: source/_posts/airtable.md
================================================
---
title: Airtable
date: 2022-11-23 16:23:31.699659
background: bg-[#f1b73f]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 36 keyboard shortcuts found in Airtable
---
## Keyboard Shortcuts
### General {.row-span-3}
| Shortcut | Action |
| ------------------ | ------------------------------------------------------------------------------------------------ |
| `Ctrl` `Z` | Undo action |
| `Ctrl` `Shift` `Z` | Redo action |
| `Ctrl` `P` | Print the current table view or current expanded record (if inside an expanded record) |
| `Ctrl` `J` | Opens the table switcher in the current base |
| `Ctrl` `K` | Opens the quick base switcher if on the home screen or inside a base |
| `Ctrl` `Shift` `K` | Opens the view switcher in the current base |
| `Ctrl` `Shift` `F` | Opens the filter menu in the current view, press enter to create a new filter |
| `Ctrl` `Shift` `D` | Opens the grouped records menu in the current view, press enter to collapse or expand all groups |
| `Ctrl` `Shift` `S` | Opens the sort menu in the current view, press enter to re-apply the most recent sort |
| `Ctrl` `Shift` `\` | Toggles blocks |
| `Ctrl` `F` | Opens the find bar, use esc to close it |
| `Ctrl` `;` | Sets the selected date/datetime field to now |
{.shortcuts}
### Grid View {.row-span-3}
| Shortcut | Action |
| ------------------------- | ------------------------------------------------------------------------------------------------------- |
| `Ctrl` `C` | Copy a cell or range of cells |
| `Ctrl` `X` | Cut a cell or range of cells |
| `Ctrl` `V` | Paste a cell (if you select a range of cells, you can paste the same value into multiple cells at once) |
| `Space` | Expand the active record, use esc to return to the table |
| `Shift` `Space` | Expand the active cell, you can then use arrow keys to move to different cells |
| `PgUp` | Scrolls one screen up |
| `PgDn` | Scrolls one screen down |
| `Alt` `PgUp` | Scrolls one screen left |
| `Alt` `PgDn` | Scrolls one screen right |
| `Ctrl` `(arrows)` | Jump to the edge of the table |
| `Ctrl` `Shift` `(arrows)` | Jump to the edge of table and select cells |
| `Shift` `(arrows)` | Select range of cells, you can also click while holding shift to select cells |
| `Shift` `Enter` | Insert a record below the selected cell |
| `Enter` | Edit the selected cell |
{.shortcuts}
### Gallery View
| Shortcut | Action |
| ---------------- | ------------------------- |
| `Ctrl` `Up/Down` | Scroll to edge of gallery |
{.shortcuts}
### Kanban View
| Shortcut | Action |
| -------------- | --------------------------------------------- |
| `Left` | Scroll kanban board to the left by one stack |
| `Right` | Scroll kanban board to the right by one stack |
| `Ctrl` `Left` | Scroll kanban board to the left edge |
| `Ctrl` `Right` | Scroll kanban board to the right edge |
| `Ctrl` `Up` | Scroll all stacks to the top |
| `Ctrl` `Down` | Scroll all stacks to the bottom |
{.shortcuts}
### Expanded Record
| Shortcut | Action |
| ------------------ | ------------------------------------------------------------ |
| `Ctrl` `Shift` `<` | Move to the previous record while viewing an expanded record |
| `Ctrl` `Shift` `>` | Move to the next record while viewing an expanded record |
| `Esc` | Close expanded record |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Airtable](https://support.airtable.com/hc/en-us/articles/204143385-Airtable-keyboard-shortcuts)
_(support.airtable.com)_
================================================
FILE: source/_posts/alan-ai.md
================================================
---
title: Alan AI
date: 2023-03-03 6:00:00
background: bg-[#4aa181]
tags:
- AI
- AlanAI
- Prompts
- Tips
categories:
- Toolkit
intro:
This cheat sheet covers all major script concepts, client API methods, handlers and other tools to create a multimodal
conversational experience with Alan AI
---
### Legend
- `pattern` — phrase to invoke a voice/text command or a response to be played
- `value` — specified value
- `params` — passed parameters
- `action` — action to be performed
- `output` — data outcome
- `[...]` — optional data or parameters
## Dialog script
### Intents & patterns
Define a voice/text command to play a response
```{.wrap}
intent('pattern'[, 'patternN'], reply('pattern'))
```
Define a voice/text command to play a response or perform an action
```{.wrap}
intent('pattern'[, 'patternN'], p => { action })
```
Define alternatives
```{.wrap}
intent('phrase1|phrase2')
```
Define optional words and phrases
```{.wrap}
intent('pattern (optional phrase|)')
```
### Response functions
Play a response (in case of multiple patterns, a response is picked at random)
```{.wrap}
reply('pattern'[, 'patternN'])
```
Play a response
```{.wrap}
p.play('pattern')
```
Define voice settings for the assistant reply: `accent (en, fr, de, it, ru, es)`, `gender (male/female)`, `voice type`,
`speaking pitch`, `speaking rate`
```{.wrap}
p.play([voice(code, gender, type, pitch, rate), ]'pattern')
```
Define play options: `force:true` (execute if the button is inactive), `activate:true` (activate the button before),
`deactivate:true` (deactivate the button after)
```{.wrap}
p.play('pattern'[, opts(options)])
```
Send a command to the app
```{.wrap}
p.play({command:data})
```
### User-defined slots
Define a static list of values expected in the input
```{.wrap}
$(SLOTNAME value1|value2) => p.SLOTNAME.value
```
Provide labels to classify or identify the slot values
```{.wrap}
$(SLOTNAME value1~label1|value2~label2) => p.SLOTNAME.label
```
Enable fuzzy matching to capture similar variants
```{.wrap}
$(SLOTNAME~ value1|value2) => p.SLOTNAME.value
```
Make a slot optional
```{.wrap}
$(SLOTNAME value1|value2|)
```
Capture several slot values
```{.wrap}
intent('$(SLOTNAME value1|value2) and $(SLOTNAME value1|value2 )') => p.SLOTNAME_ (array), p.SLOTNAME_[0].value, p.SLOTNAME_[1].value
```
### Predefined slots
Capture date values
```{.wrap}
$(DATE) => p.DATE.value, p.DATE.moment, p.DATE.luxon
```
Capture time values
```{.wrap}
$(TIME) => p.TIME.value, p.TIME.moment
```
Capture cardinal numbers
```{.wrap}
$(NUMBER) => p.NUMBER.value, p.NUMBER.number
```
Capture ordinal numbers
```{.wrap}
$(ORDINAL) => p.ORDINAL.value, p.ORDINAL.number
```
Capture locations
```{.wrap}
$(LOC) => p.LOC.value
```
Capture names
```{.wrap}
$(NAME) => p.NAME.value
```
### Dynamic slots
Define a dynamic slot at the project level
```{.wrap}
project.name = {en: "value1|value2|value3"}
$(SLOTNAME p:name) => p.SLOTNAME.value
```
Define a dynamic slot at the dialog session level
```{.wrap}
p.userData.name = {en: "value1|value2|value3"}
$(SLOTNAME u:name) => p.SLOTNAME.value
```
Get data for a dynamic slot with the visual state
```{.wrap}
let name = ["value1|value2|value3"]
p.visual.data = {en: name};
$(SLOTNAME v:name) => p.SLOTNAME.value
```
Define a dynamic slot in a short form
```{.wrap}
project.name = {en: "value1|value2|value3"}
$(p:name) => p.SLOTNAME.value
```
Define labels for dynamic slots: see [User-defined slots](#user-defined-slots).
Enable fuzzy matching for dynamic slots: see [User-defined slots](#user-defined-slots).
Make a dynamic slot optional: see [User-defined slots](#user-defined-slots).
Capture several slot values: see [User-defined slots](#user-defined-slots).
### RegEx slots
Capture digit and/or letter combination
```{.wrap}
const reg = "([A-Za-z]{1}\\s?){6}"
$(SLOTNAME* ${reg}) => p.SLOTNAME.value
```
Capture any user’s input
```{.wrap}
$(SLOTNAME* .+) => p.SLOTNAME.value
```
### Contexts
Define a context
```{.wrap}
let contextName = context(() => { action })
```
Activate a context
```{.wrap}
intent('pattern', p => {..., p.then(contextName)}
```
Pass data to the context
```{.wrap}
p.then(contextName, state: {data:yourData}) => p.state.data
```
Resolve a context
```{.wrap}
p.resolve([data:yourData])
```
Reset a context
```{.wrap}
p.resetContext()
```
Define intents to be matched at any time without switching the current context
```{.wrap}
intent(noctx, 'pattern', ...) or noContext(() => {intent(...)})
```
Play a prompt for an expected input
```{.wrap}
fallback('pattern1'[, 'patternN'])
```
Title a context
```{.wrap}
title('contextName')
```
### Predefined objects
Store static device- and user-specific data passed from the client app
```{.wrap}
authData.data => p.authData.data
```
Store state data to be available globally at the project scope
```{.wrap}
project.info = {data:yourData} => project.info.data
```
Store the intent match score
```{.wrap}
p.score
```
Store data to be passed between contexts
```{.wrap}
p.state.data
```
Store visual context data to be passed from the client app with `setVisualState()`
```{.wrap}
p.visual.data
```
Store user-specific state data to be accessible during the dialog session
```{.wrap}
p.userData.data
```
### Predefined callbacks
Define actions to be performed when the script is saved and dialog model is built
```{.wrap}
onCreateProject(() => { action })
```
Define actions to be performed when the dialog session starts
```{.wrap}
onCreateUser((p) => { action })
```
Define actions to be performed when the dialog session ends
```{.wrap}
onCleanupUser((p) => { action })
```
Define actions to be performed when the visual state is set
```{.wrap}
onVisualState((p, s) => { action })
```
Define actions to be performed when a user event is triggered in the client app: `buttonReady`, `buttonClicked`,
`micPermissionPrompt`, `micAllowed`, `firstActivate`, `showPopup`, `popupCloseClicked`, `recognized`
```{.wrap}
onUserEvent((p, e) => { action })
```
Define actions to be performed when a context is activated
```{.wrap}
onEnter((p) => { action })
```
### Q&A service
Define a URL of a resource to be indexed
```{.wrap}
corpus({url: url, depth: depthLevel})
```
Define text corpus to be used by the assistant in the dialog
```{.wrap}
corpus('text')
```
### Built-in JS libraries
Make API calls
```{.wrap}
axios, request
```
Work with time
```{.wrap}
moment-timezone, luxon
```
Work with arrays, numbers, objects, strings and so on
```{.wrap}
lodash
```
### Other
Provide a list of hints to help recognize specific terms
```{.wrap}
recognitionHints('hint'[, 'hintN'])
```
Write info messages to Alan Studio logs
```{.wrap}
console.log(data)
```
Write error messages to Alan Studio logs
```{.wrap}
console.error(data)
```
## Client SDK
### Client API methods
Send information about the visual state from the client app to the dialog script
```{.wrap}
setVisualState(visualStateData:object)
```
Send data or perform actions without a voice/text command
```{.wrap}
projectAPI.method = function(p, param, callback) {
p.userData.data = param.data;
callback();
};
callProjectApi(method:string, data:object, callback:function)
```
Play a text message in the client app
```{.wrap}
playText(text:string)
```
Send a text message to Alan as the user’s input
```{.wrap}
sendText(text:string)
```
Execute a command in the client app
```{.wrap}
playCommand(command:object)
```
### Client API methods (continued)
Activate the Alan button programmatically
```{.wrap}
activate()
```
Deactivate the Alan button programmatically
```{.wrap}
deactivate()
```
Check the Alan button state
```{.wrap}
isActive()
```
Remove the Alan button from the parent element, page (supported on Web, Ionic)
```{.wrap}
remove()
```
Check the state of the wake word (supported on iOS, Android)
```{.wrap}
getWakewordEnabled()
```
Set the state of the wake word (supported on iOS, Android)
```{.wrap}
setWakewordEnabled(enabled:boolean)
```
### Handlers
// Examples are provided for the Web platform
Handle commands sent from the dialog script to the client app
```{.wrap}
onCommand: function (commandData) { action }
```
Handle Alan button state changes
```{.wrap}
onButtonState: function (e) { action }
```
Handle connection status to the virtual assistant project in the Alan Cloud
```{.wrap}
onConnectionStatus: function (e) { action }
```
Handle events received from Alan
```{.wrap}
onEvent: function (e) { action }
```
## Also see
- [Alan AI website](https://alan.app)
- [About the Alan Platform](https://alan.app/platform)
- [Alan AI documentation](https://alan.app/docs)
================================================
FILE: source/_posts/alpine-linux.md
================================================
---
title: Alpine Linux
date: 2024-03-20 12:00:00
icon: icon-alpine
background: bg-blue-600
tags:
- linux
- server
- container
categories:
- Operating System
intro:
A comprehensive cheatsheet for Alpine Linux, covering package management, system administration, networking, and more.
Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and busybox.
---
# Alpine Linux Cheatsheet
## Package Management (apk)
### Basic Package Operations
```bash
# Update package index
apk update
# Upgrade all installed packages
apk upgrade
# Install a package
apk add \` | Quick switch the scheme |
| `Ctrl` `Alt` `S` | Open the settings dialogue |
| `Ctrl` `Alt` `Shift` `S` | Open the project structure dialogue |
| `Ctrl` `Tab` | Switch between the tabs and tool window |
{.shortcuts}
### Navigating and Searching {.row-span-2}
| Shortcut | Action |
| -------------------------- | ------------------------------------------- |
| `Shift` `Shift` | Search everything, including code and menus |
| `Ctrl` `F` | Find |
| `F3` | Find next |
| `Shift` `F3` | Find previous |
| `Ctrl` `R` | Replace |
| `Ctrl` `Shift` `A` | Find action |
| `Ctrl` `Alt` `Shift` `N` | Search by a symbol name |
| `Ctrl` `N` | Find class |
| `Ctrl` `Shift` `N` | Find file, instead of class |
| `Ctrl` `Shift` `F` | Find in path |
| `Ctrl` `F12` | Open file structure pop-up |
| `Alt` `Right/Left` | Navigate between open editor tabs |
| `Ctrl` `Enter` | Jump to source |
| `Shift` `F4` | Open the current editor tab in a new window |
| `Ctrl` `E` | Recently opened files pop-up |
| `Ctrl` `Shift` `E` | Recently edited files pop-up |
| `Ctrl` `Shift` `Backspace` | Go to last edit location |
| `Ctrl` `F4` | Close active editor tab |
| `Esc` | Return to editor window from a tool window |
| `Shift` `Esc` | Hide active or last active tool window |
| `Ctrl` `G` | Go to line |
| `Ctrl` `H` | Open type hierarchy |
| `Ctrl` `Shift` `H` | Open method hierarchy |
| `Ctrl` `Alt` `H` | Open call hierarchy |
{.shortcuts}
### Writing Code {.row-span-4}
| Shortcut | Action |
| ---------------------- | --------------------------------------------------------------------------------- |
| `Alt` `Insert` | Generate code, e.g. getters, setters, constructors, new class |
| `Ctrl` `O` | Override methods |
| `Ctrl` `I` | Implement methods |
| `Ctrl` `Alt` `T` | Surround with if...else, try...catch, etc |
| `Ctrl` `Y` | Delete line at caret |
| `Ctrl` `-` | Collapse the current code block |
| `Ctrl` `+` | Expand the current code block |
| `Ctrl` `Shift` `-` | Collapse all code blocks |
| `Ctrl` `Shift` `+` | Expand all code blocks |
| `Ctrl` `D` | Duplicate the current line or selection |
| `Ctrl` `Space` | Basic code completion |
| `Ctrl` `Shift` `Space` | Smart code completion, filters the list of methods and variables by expected type |
| `Ctrl` `Shift` `Enter` | Complete statement |
| `Ctrl` `Q` | Quick documentation lookup |
| `Ctrl` `P` | Show parameters for selected method |
| `Ctrl` `B` | Go to declaration, directly |
| `Ctrl` `Alt` `B` | Go to implementations |
| `Ctrl` `U` | Go to super-method or super-class |
| `Ctrl` `Shift` `I` | Open quick definition lookup |
| `Alt` `1` | Toggle project tool window visibility |
| `F11` | Toggle bookmark |
| `Ctrl` `F11` | Toggle bookmark with mnemonic |
| `Ctrl` `/` | Comment or uncomment with line comment |
| `Ctrl` `Shift` `/` | Comment or uncomment with block comment |
| `Ctrl` `W` | Select successively increasing code blocks |
| `Ctrl` `Shift` `W` | Decrease current selection to previous state |
| `Ctrl` `[` | Move to code block start |
| `Ctrl` `]` | Move to code block end |
| `Ctrl` `Shift` `[` | Select to the code block start |
| `Ctrl` `Shift` `]` | Select to the code block end |
| `Ctrl` `Del` | Delete to the end of a word |
| `Ctrl` `Backspace` | Delete to the start of a word |
| `Ctrl` `Alt` `O` | Optimize imports |
| `Alt` `Enter` | Project quick fix, show intention actions and quick fixes |
| `Ctrl` `Alt` `L` | Reformat code |
| `Ctrl` `Alt` `I` | Auto-indent lines |
| `Tab` | Indent lines |
| `Shift` `Tab` | Unindent lines |
| `Ctrl` `Shift` `J` | Smart line join |
| `Ctrl` `Enter` | Smart line split |
| `Shift` `Enter` | Start new line |
| `F2` | Next highlighted error |
| `Shift` `F2` | Previous highlighted error |
{.shortcuts}
### Viewing Layouts
| Shortcut | Action |
| ------------------ | ------------- |
| `Ctrl` `+` | Zoom in |
| `Ctrl` `-` | Zoom out |
| `Ctrl` `0` | Fit to screen |
| `Ctrl` `Shift` `1` | Actual size |
{.shortcuts}
### Layout Editor
| Shortcut | Action |
| ----------------- | -------------------------------------------- |
| `B` | Toggle between Design and Blueprint modes |
| `O` | Toggle between Portrait and Landscaope modes |
| `D` | Toggle devices |
| `R` | Force refresh |
| `E` | Toggle render errors panel |
| `Del` | Delete constraints |
| `Ctrl` `+` | Zoom in |
| `Ctrl` `-` | Zoom out |
| `Ctrl` `0` | Zoom to fit |
| `Ctrl` `B` | Go to XML |
| `Ctrl` `A` | Select all components |
| `Shift` `(click)` | Select multiple components |
{.shortcuts}
### Navigation Editor
| Shortcut | Action |
| ---------------- | ---------------------------- |
| `Ctrl` `+` | Zoom in |
| `Ctrl` `-` | Zoom out |
| `Ctrl` `0` | Zoom to fit |
| `Ctrl` `B` | Go to XML |
| `E` | Toggle render errors panel |
| `Ctrl` `G` | Group into a nested graph |
| `Tab` | Cycle through destinations |
| `Ctrl` `A` | Select all destinations |
| `Ctrl` `(click)` | Select multiple destinations |
{.shortcuts}
### Build and Run
| Shortcut | Action |
| ------------------ | ---------------------------------- |
| `Ctrl` `F9` | Build |
| `Shift` `F10` | Build and run |
| `Ctrl` `F10` | Apply changes and restart activity |
| `Ctrl` `Alt` `F10` | Apply code changes |
{.shortcuts}
### Debugging
| Shortcut | Action |
| ------------------- | ------------------- |
| `Shift` `F9` | Debug |
| `F8` | Step over |
| `F7` | Step into |
| `Shift` `F7` | Smart step into |
| `Shift` `F8` | Step out |
| `Alt` `F9` | Run to cursor |
| `Alt` `F8` | Evaluate expression |
| `F9` | Resume program |
| `Ctrl` `F8` | Toggle breakpoint |
| `Ctrl` `Shift` `F8` | View breakpoints |
{.shortcuts}
### Refactoring
| Shortcut | Action |
| ---------------- | ----------------- |
| `F5` | Copy |
| `F6` | Move |
| `Alt` `Del` | Safe delete |
| `Shift` `F6` | Rename |
| `Ctrl` `F6` | Change signature |
| `Ctrl` `Alt` `N` | Inline |
| `Ctrl` `Alt` `M` | Extract method |
| `Ctrl` `Alt` `V` | Extract variable |
| `Ctrl` `Alt` `F` | Extract field |
| `Ctrl` `Alt` `C` | Extract constant |
| `Ctrl` `Alt` `P` | Extract parameter |
{.shortcuts}
### Version Control
| Shortcut | Action |
| --------------------- | ----------------------- |
| `Ctrl` `K` | Commit project to VCS |
| `Ctrl` `T` | Update project from VCS |
| `Alt` `Shift` `C` | View recent changes |
| `Alt` \` | Open VCS pop-up |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Android Studio](https://developer.android.com/studio/intro/keyboard-shortcuts)
_(developer.android.com)_
================================================
FILE: source/_posts/apex-legends.md
================================================
---
title: Apex Legends
date: 2022-11-23 16:23:31.706352
background: bg-[#a74145]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 27 default keyboard shortcuts found in Apex Legends
---
## Keyboard Shortcuts
### Movement
| Shortcut | Action |
| ------------ | -------------- |
| `W` | Move forward |
| `S` | Move back |
| `A` | Move left |
| `D` | Move right |
| `Left Shift` | Sprint |
| `Space` | Jump |
| `C` | Toggle crouch |
| `Left Ctrl` | Hold to crouch |
{.shortcuts}
### Weapons and Abilities
| Shortcut | Action |
| -------- | ------------------------- |
| `Q` | Tactical ability |
| `Z` | Ultimate ability |
| `E` | Interact or pickup |
| `X` | Alternate interact |
| `Tab` | Toggle inventory |
| `M` | Toggle map |
| `B` | Toggle fire mode |
| `V` | Melee |
| `R` | Reload |
| `1` | Equip first weapon |
| `2` | Equip second weapon |
| `3` | Holster weapons |
| `G` | Equip grenade |
| `4` | Use selected health item |
| `H` | Toggle Gibraltar's shield |
| `N` | Inspect weapon |
{.shortcuts}
### Communication
| Shortcut | Action |
| -------- | ------------------------ |
| `F` | Ping enemy here |
| `T` | Hold to use push to talk |
| `Enter` | Message team |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Apex Legends](https://www.metabomb.net/off-meta/gameplay-guides/apex-legends-controls-pc-playstation-4xbox-one)
_(www.metabomb.net)_
================================================
FILE: source/_posts/apple-music.md
================================================
---
title: Apple Music
date: 2022-11-23 16:23:31.700157
background: bg-[#e05564]
label: Mac
tags:
-
- mac
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 62 keyboard shortcuts found in the Apple Music app. This application is MacOS-only.
---
## Keyboard Shortcuts
### Playing Music {.row-span-2}
| Shortcut | Action |
| --------------------- | -------------------------------------------------------- |
| `Space` | Start playing or pause the selected song |
| `Enter` | Play the currently selected song from the beginning |
| `Cmd` `Opt` `Right` | Move forward within a song |
| `Cmd` `Opt` `Left` | Move backward within a song |
| `Cmd` `.` | Stop playing the selected song |
| `Right` | When a song is playing, play the next song in a list |
| `Left` | When a song is playing, play the previous song in a list |
| `Cmd` `L` | Show the currently playing song in the list |
| `Cmd` `Opt` `U` | Show the Playing Next queue |
| `Opt` `Right` | Listen to the next album in a list |
| `Opt` `Left` | Listen to the previous album in a list |
| `Cmd` `Up` | Increase the volume |
| `Cmd` `Down` | Decrease the volume |
| `Cmd` `Opt` `E` | Open the equalizer |
| `Cmd` `Shift` `Right` | Go to the next chapter, if available |
| `Cmd` `Shift` `Left` | Go to the previous chapter, if available |
| `Cmd` `U` | Stream audio file at a specific URL to Music |
{.shortcuts}
### Playlists
| Shortcut | Action |
| ----------------- | ------------------------------------------------------------------------ |
| `Cmd` `N` | Create a new playlist |
| `Cmd` `Shift` `N` | Create a playlist from a selection of songs |
| `Cmd` `Opt` `N` | Create a new Smart Playlist |
| `Opt` `Space` | Start the Genius Shuffle |
| `Cmd` `R` | Refresh a Genius Playlist, when the playlist is selected |
| `Cmd` `Del` | Delete the selected playlist without confirmation |
| `Opt` `Del` | Delete the selected playlist and all songs it contains from your library |
| `Opt` `Del` | Delete the selected song from your library and all playlists |
{.shortcuts}
### Window Options {.row-span-2}
| Shortcut | Action |
| ----------------- | --------------------------------------------------------- |
| `Cmd` `Shift` `M` | Open the MiniPlayer |
| `Cmd` `Shift` `F` | Open the Full Screen Player |
| `Cmd` `Ctrl` `F` | Toggle full-screen view |
| `Cmd` `/` | Show or hide the status bar |
| `Cmd` `I` | Open the info window for the selected song |
| `Cmd` `N` | In the info window, see information for the next song |
| `Cmd` `P` | In the info window, see information for the previous song |
| `Cmd` `Shift` `[` | Go to the previous pane in the info window |
| `Cmd` `Shift` `]` | Go to the next pane in the info window |
| `Cmd` `J` | Open the View Options window for the selected source |
| `Cmd` `T` | Turn the visualizer on or off |
| `?` | See more options when a visual effect is showing |
| `Cmd` `R` | Refresh Apple Music or the iTunes Store |
| `Cmd` `0` | Open the Music window |
| `Cmd` `W` | Close the Music window |
| `Cmd` `M` | Put the Music window in the Dock |
| `Cmd` `H` | Hide the Music window |
| `Cmd` `Opt` `H` | Hide all other applications |
{.shortcuts}
### Library
| Shortcut | Action |
| ----------------- | -------------------------------------------------- |
| `Cmd` `O` | Add a file to your library |
| `Cmd` `Shift` `R` | Show where a song file is located |
| `Cmd` `F` | Select the search field |
| `Cmd` `Z` | Undo your last typing change while editing an item |
| `Cmd` `X` | Cut the selected song's information or artwork |
| `Cmd` `C` | Copy the selected song's information or artwork |
| `Cmd` `V` | Paste the selected song's information or artwork |
| `Cmd` `A` | Select all the songs in the list |
| `Cmd` `B` | Show or hide the column browser |
| `Cmd` `Shift` `A` | De-select all the songs in the list |
{.shortcuts}
### iTunes Store
| Shortcut | Action |
| ------------- | ------------------------------------------- |
| `Opt` `Enter` | Initiate a search in the iTunes Store |
| `Cmd` `]` | Go to the next page in the iTunes Store |
| `Cmd` `[` | Go to the previous page in the iTunes Store |
| `Cmd` `R` | Reload the current page |
{.shortcuts}
### Other
| Shortcut | Action |
| ----------- | --------------------------------------------------- |
| `Cmd` `,` | Open Music Preferences |
| `Cmd` `Q` | Quit the Music app |
| `Cmd` `E` | Eject a CD |
| `Cmd` `?` | Open the Music Help menu |
| `Cmd` `Opt` | Open a different music library, while opening Music |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Music on Mac](https://support.apple.com/guide/music/keyboard-shortcuts-mus1019/mac)
_(support.apple.com)_
================================================
FILE: source/_posts/arduino-programming.md
================================================
---
title: Arduino Programming
date: 2024-05-29 8:58:31
background: bg-[#387f83]
label:
tags: -cpp -I/O
categories:
- Programming
intro: |
Ardunio programming cheat-sheet for I/O programming and ardunio board programming.
plugins:
- copyCode
---
## Getting Started
### Gather Necessary Materials
- Arduino Board: Any model, such as Arduino Uno, Mega, Nano, etc.
- USB Cable: Compatible with your Arduino board (commonly USB Type-A to Type-B for Uno).
- Computer: Windows, macOS, or Linux.
### Install the Arduino IDE
- windows/mac/linux
- Go to the Arduino Software page.
- Download the os installer.
- Run the installer and follow the instructions.
### Connect Your Arduino Board
- Connect the Arduino board to your computer using the USB cable.
- The power LED on the Arduino should light up, indicating it’s receiving power.
### Configure the Arduino IDE
- Open the Arduino IDE.
- Select Your Board:
- Go to Tools > Board and select the model of your Arduino board (e.g., Arduino Uno).
- Select the Port:
- Go to Tools > Port and select the port that the Arduino is connected to (it usually shows as COMx on Windows,
/dev/cu.usbmodemxxxx on macOS, and /dev/ttyUSBx on Linux).
## Basic Structure
### Setup and Loop
```cpp
void setup() {
// Code here runs once
}
void loop() {
// Code here runs repeatedly
}
```
### Comment
```cpp
// Single-line comment
/*
Multi-line
comment
*/
```
### Variable
```cpp
int ledPin = 13; // Integer
float voltage = 5.0; // Floating-point number
char letter = 'A'; // Character
String text = "Hello"; // String
```
### Pin Modes
```cpp
pinMode(pin, mode);
```
### Digital I/O
```cpp
digitalWrite(pin, value);
int value = digitalRead(pin);
```
### Analog I/O
```cpp
analogWrite(pin, value);
int value = analogRead(pin);
```
## Serial Communication
### Begin Serial Communication
```cpp
Serial.begin(baudRate);
```
### Print to Serial Monitor
```cpp
Serial.print(data);
Serial.println(data);
```
### Read from Serial Monitor
```cpp
if (Serial.available()) {
char data = Serial.read();
}
```
## Control Structures
### If Statement
```cpp
if (condition) {
// Code to execute if condition is true
} else {
// Code to execute if condition is false
}
```
### For Loop
```cpp
for (initialization; condition; increment) {
// Code to execute
}
```
### While Loop
```cpp
while (condition) {
// Code to execute
}
```
### Functions
```cpp
returnType functionName(parameters) {
// Code to execute
return value;
}
```
## Libraries
### Include a Library
```cpp
#include \` | 96 | 140 | 60 | 1100000 |
| a | 97 | 141 | 61 | 1100001 |
| b | 98 | 142 | 62 | 1100010 |
| c | 99 | 143 | 63 | 1100011 |
| d | 100 | 144 | 64 | 1100100 |
| e | 101 | 145 | 65 | 1100101 |
| f | 102 | 146 | 66 | 1100110 |
| g | 103 | 147 | 67 | 1100111 |
| h | 104 | 150 | 68 | 1101000 |
| i | 105 | 151 | 69 | 1101001 |
| j | 106 | 152 | 6A | 1101010 |
| k | 107 | 153 | 6B | 1101011 |
| l | 108 | 154 | 6C | 1101100 |
| m | 109 | 155 | 6D | 1101101 |
| n | 110 | 156 | 6E | 1101110 |
| o | 111 | 157 | 6F | 1101111 |
| p | 112 | 160 | 70 | 1110000 |
| q | 113 | 161 | 71 | 1110001 |
| r | 114 | 162 | 72 | 1110010 |
| s | 115 | 163 | 73 | 1110011 |
| t | 116 | 164 | 74 | 1110100 |
| u | 117 | 165 | 75 | 1110101 |
| v | 118 | 166 | 76 | 1110110 |
| w | 119 | 167 | 77 | 1110111 |
| x | 120 | 170 | 78 | 1111000 |
| y | 121 | 171 | 79 | 1111001 |
| z | 122 | 172 | 7A | 1111010 |
| { | 123 | 173 | 7B | 1111011 |
| | 124 | 174 | 7C | 1111100 |
| } | 125 | 175 | 7D | 1111101 |
| ~ | 126 | 176 | 7E | 1111110 |
| (Delete) | 127 | 177 | 7F | 1111111 |
| € | 128 | 200 | 80 | 10000000 |
| | 129 | 201 | 81 | 10000001 |
| ‚ | 130 | 202 | 82 | 10000010 |
| ƒ | 131 | 203 | 83 | 10000011 |
| „ | 132 | 204 | 84 | 10000100 |
| … | 133 | 205 | 85 | 10000101 |
| † | 134 | 206 | 86 | 10000110 |
| ‡ | 135 | 207 | 87 | 10000111 |
| ˆ | 136 | 210 | 88 | 10001000 |
| ‰ | 137 | 211 | 89 | 10001001 |
| Š | 138 | 212 | 8A | 10001010 |
| ‹ | 139 | 213 | 8B | 10001011 |
| Œ | 140 | 214 | 8C | 10001100 |
| | 141 | 215 | 8D | 10001101 |
| Ž | 142 | 216 | 8E | 10001110 |
| | 143 | 217 | 8F | 10001111 |
| | 144 | 220 | 90 | 10010000 |
| ‘ | 145 | 221 | 91 | 10010001 |
| ’ | 146 | 222 | 92 | 10010010 |
| “ | 147 | 223 | 93 | 10010011 |
| ” | 148 | 224 | 94 | 10010100 |
| • | 149 | 225 | 95 | 10010101 |
| – | 150 | 226 | 96 | 10010110 |
| — | 151 | 227 | 97 | 10010111 |
| ˜ | 152 | 230 | 98 | 10011000 |
| ™ | 153 | 231 | 99 | 10011001 |
| š | 154 | 232 | 9A | 10011010 |
| › | 155 | 233 | 9B | 10011011 |
| œ | 156 | 234 | 9C | 10011100 |
| | 157 | 235 | 9D | 10011101 |
| ž | 158 | 236 | 9E | 10011110 |
| Ÿ | 159 | 237 | 9F | 10011111 |
| (Non-breaking space) | 160 | 240 | A0 | 10100000 |
| ¡ | 161 | 241 | A1 | 10100001 |
| ¢ | 162 | 242 | A2 | 10100010 |
| £ | 163 | 243 | A3 | 10100011 |
| ¤ | 164 | 244 | A4 | 10100100 |
| ¥ | 165 | 245 | A5 | 10100101 |
| ¦ | 166 | 246 | A6 | 10100110 |
| § | 167 | 247 | A7 | 10100111 |
| ¨ | 168 | 250 | A8 | 10101000 |
| © | 169 | 251 | A9 | 10101001 |
| ª | 170 | 252 | AA | 10101010 |
| « | 171 | 253 | AB | 10101011 |
| ¬ | 172 | 254 | AC | 10101100 |
| (Soft hyphen) | 173 | 255 | AD | 10101101 |
| ® | 174 | 256 | AE | 10101110 |
| ¯ | 175 | 257 | AF | 10101111 |
| ° | 176 | 260 | B0 | 10110000 |
| ± | 177 | 261 | B1 | 10110001 |
| ² | 178 | 262 | B2 | 10110010 |
| ³ | 179 | 263 | B3 | 10110011 |
| ´ | 180 | 264 | B4 | 10110100 |
| µ | 181 | 265 | B5 | 10110101 |
| ¶ | 182 | 266 | B6 | 10110110 |
| · | 183 | 267 | B7 | 10110111 |
| ¸ | 184 | 270 | B8 | 10111000 |
| ¹ | 185 | 271 | B9 | 10111001 |
| º | 186 | 272 | BA | 10111010 |
| » | 187 | 273 | BB | 10111011 |
| ¼ | 188 | 274 | BC | 10111100 |
| ½ | 189 | 275 | BD | 10111101 |
| ¾ | 190 | 276 | BE | 10111110 |
| ¿ | 191 | 277 | BF | 10111111 |
| À | 192 | 300 | C0 | 11000000 |
| Á | 193 | 301 | C1 | 11000001 |
| Â | 194 | 302 | C2 | 11000010 |
| Ã | 195 | 303 | C3 | 11000011 |
| Ä | 196 | 304 | C4 | 11000100 |
| Å | 197 | 305 | C5 | 11000101 |
| Æ | 198 | 306 | C6 | 11000110 |
| Ç | 199 | 307 | C7 | 11000111 |
| È | 200 | 310 | C8 | 11001000 |
| É | 201 | 311 | C9 | 11001001 |
| Ê | 202 | 312 | CA | 11001010 |
| Ë | 203 | 313 | CB | 11001011 |
| Ì | 204 | 314 | CC | 11001100 |
| Í | 205 | 315 | CD | 11001101 |
| Î | 206 | 316 | CE | 11001110 |
| Ï | 207 | 317 | CF | 11001111 |
| Ð | 208 | 320 | D0 | 11010000 |
| Ñ | 209 | 321 | D1 | 11010001 |
| Ò | 210 | 322 | D2 | 11010010 |
| Ó | 211 | 323 | D3 | 11010011 |
| Ô | 212 | 324 | D4 | 11010100 |
| Õ | 213 | 325 | D5 | 11010101 |
| Ö | 214 | 326 | D6 | 11010110 |
| × | 215 | 327 | D7 | 11010111 |
| Ø | 216 | 330 | D8 | 11011000 |
| Ù | 217 | 331 | D9 | 11011001 |
| Ú | 218 | 332 | DA | 11011010 |
| Û | 219 | 333 | DB | 11011011 |
| Ü | 220 | 334 | DC | 11011100 |
| Ý | 221 | 335 | DD | 11011101 |
| Þ | 222 | 336 | DE | 11011110 |
| ß | 223 | 337 | DF | 11011111 |
| à | 224 | 340 | E0 | 11100000 |
| á | 225 | 341 | E1 | 11100001 |
| â | 226 | 342 | E2 | 11100010 |
| ã | 227 | 343 | E3 | 11100011 |
| ä | 228 | 344 | E4 | 11100100 |
| å | 229 | 345 | E5 | 11100101 |
| æ | 230 | 346 | E6 | 11100110 |
| ç | 231 | 347 | E7 | 11100111 |
| è | 232 | 350 | E8 | 11101000 |
| é | 233 | 351 | E9 | 11101001 |
| ê | 234 | 352 | EA | 11101010 |
| ë | 235 | 353 | EB | 11101011 |
| ì | 236 | 354 | EC | 11101100 |
| í | 237 | 355 | ED | 11101101 |
| î | 238 | 356 | EE | 11101110 |
| ï | 239 | 357 | EF | 11101111 |
| ð | 240 | 360 | F0 | 11110000 |
| ñ | 241 | 361 | F1 | 11110001 |
| ò | 242 | 362 | F2 | 11110010 |
| ó | 243 | 363 | F3 | 11110011 |
| ô | 244 | 364 | F4 | 11110100 |
| õ | 245 | 365 | F5 | 11110101 |
| ö | 246 | 366 | F6 | 11110110 |
| ÷ | 247 | 367 | F7 | 11110111 |
| ø | 248 | 370 | F8 | 11111000 |
| ù | 249 | 371 | F9 | 11111001 |
| ú | 250 | 372 | FA | 11111010 |
| û | 251 | 373 | FB | 11111011 |
| ü | 252 | 374 | FC | 11111100 |
| ý | 253 | 375 | FD | 11111101 |
| þ | 254 | 376 | FE | 11111110 |
| ÿ | 255 | 377 | FF | 11111111 |
{.show-header}
================================================
FILE: source/_posts/aspect-ratio.md
================================================
---
title: Aspect Ratio
date: 2022-09-21 10:28:43
background: bg-indigo-600
tags:
- photo
- image
- aspect
- ratio
- resolutions
categories:
- Other
intro: |
This cheat sheet lists some common aspect ratios and their pixel resolutions. Always confirm your final delivery ratio when shooting.
---
## Getting Started {.cols-2}
### Introduction
- The aspect ratio is the ratio between the width and height of the screen or image
- It's usually written as two numbers separated by a colon or "x", ex: 16:9 or 16x9
- Which is interpreted as W pixels in width for every H pixel in height.
- Resolution is the number of pixels (individual points of color)
{.marker-round}
### Multi-format of Aspect Ratio
- [Markdown Table](https://tableconvert.com/html-to-markdown?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [Template](https://tableconvert.com/html-to-template?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [LaTeX Table](https://tableconvert.com/html-to-latex?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [CSV](https://tableconvert.com/html-to-csv?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [Excel](https://tableconvert.com/html-to-excel?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [JSON Array](https://tableconvert.com/html-to-json?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [HTML Table](https://tableconvert.com/html-to-html?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [Insert SQL](https://tableconvert.com/html-to-sql?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [YAML Sequence](https://tableconvert.com/html-to-yaml?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [XML](https://tableconvert.com/html-to-xml?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [ASCII](https://tableconvert.com/html-to-ascii?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [MediaWiki Table](https://tableconvert.com/html-to-mediawiki?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [AsciiDoc Table](https://tableconvert.com/html-to-asciidoc?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [Jira Table](https://tableconvert.com/html-to-jira?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [Textile Table](https://tableconvert.com/html-to-textile?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [reStructuredText](https://tableconvert.com/html-to-restructuredtext?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [PHP Array](https://tableconvert.com/html-to-php?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [Ruby Array](https://tableconvert.com/html-to-ruby?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [ASP Array](https://tableconvert.com/html-to-asp?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [ActionScript](https://tableconvert.com/html-to-actionscript?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [BBCode](https://tableconvert.com/html-to-bbcode?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [PDF](https://tableconvert.com/html-to-pdf?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
- [JPEG](https://tableconvert.com/html-to-jpeg?data=https://cheatsheets.zip/aspect-ratio#TableGenerator)
{.cols-4 .marker-none}
## Lists of Aspect Ratios
### 1080p {.row-span-2}
| Aspect Ratio | Resolution |
| ------------ | ----------- |
| 0.80 (4:5) | 864 x 1080 |
| 1.25 (5:4) | 1350 x 1080 |
| 1.33 (4:3) | 1440 x 1080 |
| 1.66 (5:3) | 1800 x 1080 |
| 1.78 (16:9) | 1920 x 1080 |
| 1.85 | 1920 x 1038 |
| 1.90 | 1920 x 1011 |
| 2.00 | 1920 x 960 |
| 2.35 | 1920 x 817 |
| 2.37 | 1920 x 810 |
| 2.39 | 1920 x 803 |
| 2.40 | 1920 x 800 |
| 2.44 | 1920 x 787 |
{.show-header}
### 720p {.row-span-2}
| Aspect Ratio | Resolution |
| ------------ | ---------- |
| 0.80 (4:5) | 576 x 720 |
| 1.25 (5:4) | 900 x 720 |
| 1.33 (4:3) | 960 x 720 |
| 1.66 (5:3) | 1200 x 720 |
| 1.78 (16:9) | 1280 x 720 |
| 1.85 | 1280 x 692 |
| 1.90 | 1280 x 674 |
| 2.00 | 1280 x 640 |
| 2.35 | 1280 x 545 |
| 2.37 | 1280 x 540 |
| 2.39 | 1280 x 536 |
| 2.40 | 1280 x 533 |
| 2.44 | 1280 x 525 |
{.show-header}
### Cinema DCP 4K
| Aspect Ratio | Resolution |
| --------------------- | ----------- |
| Flat (1.85) | 3996 x 2160 |
| Scope (2.39) | 4096 x 1716 |
| Full Container (1.90) | 4096 x 2160 |
{.show-header}
### Cinema DCP 2K
| Aspect Ratio | Resolution |
| --------------------- | ----------- |
| Flat (1.85) | 1998 x 1080 |
| Scope (2.39) | 2048 x 858 |
| Full Container (1.90) | 2048 x 1080 |
{.show-header}
### 8K
| Aspect Ratio | Resolution |
| ------------ | ----------- |
| 0.80 (4:5) | 3686 x 4608 |
| 1.25 (5:4) | 5760 x 4608 |
| 1.33 (4:3) | 6144 x 4608 |
| 1.66 (5:3) | 7680 x 4608 |
| 1.78 (16:9) | 8192 x 4608 |
| 1.85 | 8192 x 4428 |
| 1.90 | 8192 x 4320 |
| 2.00 | 8192 x 4096 |
| 2.35 | 8192 x 3486 |
| 2.37 | 8192 x 3456 |
| 2.39 | 8192 x 3428 |
| 2.40 | 8192 x 3413 |
| 2.44 | 8192 x 3357 |
{.show-header}
### 6K
| Aspect Ratio | Resolution |
| ------------ | ----------- |
| 0.80 (4:5) | 2765 x 3456 |
| 1.25 (5:4) | 4320 x 3456 |
| 1.33 (4:3) | 4608 x 3456 |
| 1.66 (5:3) | 5760 x 3456 |
| 1.78 (16:9) | 6144 x 3456 |
| 1.85 | 6144 x 3321 |
| 1.90 | 6144 x 3234 |
| 2.00 | 6144 x 3072 |
| 2.35 | 6144 x 2614 |
| 2.37 | 6144 x 2592 |
| 2.39 | 6144 x 2571 |
| 2.40 | 6144 x 2560 |
| 2.44 | 6144 x 2518 |
{.show-header}
### 4K
| Aspect Ratio | Resolution |
| ------------ | ----------- |
| 0.80 (4:5) | 2765 x 3456 |
| 1.25 (5:4) | 4320 x 3456 |
| 1.33 (4:3) | 4608 x 3456 |
| 1.66 (5:3) | 5760 x 3456 |
| 1.78 (16:9) | 6144 x 3456 |
| 1.85 | 6144 x 3321 |
| 1.90 | 6144 x 3234 |
| 2.00 | 6144 x 3072 |
| 2.35 | 6144 x 2614 |
| 2.37 | 6144 x 2592 |
| 2.39 | 6144 x 2571 |
| 2.40 | 6144 x 2560 |
| 2.44 | 6144 x 2518 |
{.show-header}
### 3K
| Aspect Ratio | Resolution |
| ------------ | ----------- |
| 0.80 (4:5) | 1382 x 1728 |
| 1.25 (5:4) | 2160 x 1728 |
| 1.33 (4:3) | 2304 x 1728 |
| 1.66 (5:3) | 2880 x 1728 |
| 1.78 (16:9) | 3072 x 1728 |
| 1.85 | 3072 x 1661 |
| 1.90 | 3072 x 1620 |
| 2.00 | 3072 x 1536 |
| 2.35 | 3072 x 1307 |
| 2.37 | 3072 x 1296 |
| 2.39 | 3072 x 1285 |
| 2.40 | 3072 x 1280 |
| 2.44 | 3072 x 1259 |
{.show-header}
### 2K
| Aspect Ratio | Resolution |
| ------------ | ----------- |
| 0.80 (4:5) | 922 x 1152 |
| 1.25 (5:4) | 1440 x 1152 |
| 1.33 (4:3) | 1536 x 1152 |
| 1.66 (5:3) | 1920 x 1152 |
| 1.78 (16:9) | 2048 x 1152 |
| 1.85 | 2048 x 1107 |
| 1.90 | 2048 x 1078 |
| 2.00 | 2048 x 1024 |
| 2.35 | 2048 x 871 |
| 2.37 | 2048 x 864 |
| 2.39 | 2048 x 858 |
| 2.40 | 2048 x 853 |
| 2.44 | 2048 x 838 |
{.show-header}
### 8K UHD
| Aspect Ratio | Resolution |
| ------------ | ----------- |
| 0.80 (4:5) | 2765 x 3456 |
| 1.25 (5:4) | 5400 x 3456 |
| 1.33 (4:3) | 5760 x 3456 |
| 1.66 (5:3) | 7200 x 3456 |
| 1.78 (16:9) | 7680 x 4320 |
| 1.85 | 7680 x 4151 |
| 1.90 | 7680 x 4042 |
| 2.00 | 7680 x 3840 |
| 2.35 | 7680 x 3268 |
| 2.37 | 7680 x 3240 |
| 2.39 | 7680 x 3213 |
| 2.40 | 7680 x 3200 |
| 2.44 | 7680 x 3148 |
{.show-header}
### 5K
| Aspect Ratio | Resolution |
| ------------ | ----------- |
| 0.80 (4:5) | 2304 x 2880 |
| 1.25 (5:4) | 3600 x 2880 |
| 1.33 (4:3) | 3840 x 2880 |
| 1.66 (5:3) | 4800 x 2880 |
| 1.78 (16:9) | 5120 x 2880 |
| 1.85 | 5120 x 2768 |
| 1.90 | 5120 x 2700 |
| 2.00 | 5120 x 2560 |
| 2.35 | 5120 x 2179 |
| 2.37 | 5120 x 2160 |
| 2.39 | 5120 x 2142 |
| 2.40 | 5120 x 2133 |
| 2.44 | 5120 x 2098 |
{.show-header}
### 4K UHD
| Aspect Ratio | Resolution |
| ------------ | ----------- |
| 0.80 (4:5) | 1728 x 2160 |
| 1.25 (5:4) | 2700 x 2160 |
| 1.33 (4:3) | 2880 x 2160 |
| 1.66 (5:3) | 3600 x 2160 |
| 1.78 (16:9) | 3840 x 2160 |
| 1.85 | 3840 x 2076 |
| 1.90 | 3840 x 2021 |
| 2.00 | 3840 x 1920 |
| 2.35 | 3840 x 1634 |
| 2.37 | 3840 x 1620 |
| 2.39 | 3840 x 1607 |
| 2.40 | 3840 x 1600 |
| 2.44 | 3840 x 1574 |
{.show-header}
### 3K UHD
| Aspect Ratio | Resolution |
| ------------ | ----------- |
| 0.80 (4:5) | 1296 x 1620 |
| 1.25 (5:4) | 2025 x 1620 |
| 1.33 (4:3) | 2160 x 1620 |
| 1.66 (5:3) | 2700 x 1620 |
| 1.78 (16:9) | 2880 x 1620 |
| 1.85 | 2880 x 1557 |
| 1.90 | 2880 x 1516 |
| 2.00 | 2880 x 1440 |
| 2.35 | 2880 x 1226 |
| 2.37 | 2880 x 1215 |
| 2.39 | 2880 x 1205 |
| 2.40 | 2880 x 1200 |
| 2.44 | 2880 x 1180 |
{.show-header}
================================================
FILE: source/_posts/audacity.md
================================================
---
title: Audacity
date: 2022-11-23 16:23:31.701833
background: bg-[#0000e1]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 135 default keyboard shortcuts found in Audacity
---
## Keyboard Shortcuts
### File Menu
| Shortcut | Action |
| ------------------ | --------------- |
| `Ctrl` `N` | New |
| `Ctrl` `O` | Open |
| `Ctrl` `W` | Close |
| `Ctrl` `Q` | Exit |
| `Ctrl` `S` | Save project |
| `Ctrl` `Shift` `E` | Export audio |
| `Ctrl` `Shift` `L` | Export multiple |
| `Ctrl` `Shift` `I` | Import audio |
{.shortcuts}
### Edit Menu
| Shortcut | Action |
| ------------------ | -------------------------------- |
| `Ctrl` `Z` | Undo |
| `Ctrl` `Y` | Redo |
| `Ctrl` `X` | Cut |
| `Ctrl` `K` | Delete |
| `Ctrl` `C` | Copy |
| `Ctrl` `V` | Paste |
| `Ctrl` `D` | Duplicate |
| `Ctrl` `P` | Preferences |
| `Ctrl` `Alt` `X` | Split cut |
| `Ctrl` `Alt` `K` | Split delete |
| `Ctrl` `L` | Silence audio |
| `Ctrl` `T` | Trim audio |
| `Ctrl` `Alt` `I` | Split new |
| `Ctrl` `J` | Join |
| `Ctrl` `Shift` `J` | Detach at silences |
| `Ctrl` `B` | Add label at selection |
| `Ctrl` `M` | Add label at playback position |
| `Ctrl` `Alt` `V` | Paste text to new label |
| `Alt` `X` | Cut labeled audio |
| `Alt` `K` | Delete labeled audio |
| `Alt` `Shift` `X` | Split cut labeled audio |
| `Alt` `Shift` `K` | Split delete labeled audio |
| `Alt` `L` | Silence labeled audio |
| `Alt` `Shift` `C` | Copy labeled audio |
| `Alt` `I` | Split labeled audio |
| `Alt` `J` | Join labeled audio |
| `Alt` `Shift` `J` | Detach labeled audio at silences |
{.shortcuts}
### Extra Menu {.row-span-4}
| Shortcut | Action |
| ---------------------- | -------------------------------------- |
| `F11` | Toggle full screen |
| `1` | Play one second |
| `B` | Play to selection |
| `Shift` `F5` | Play before selection start |
| `Shift` `F6` | Play after selection start |
| `Shift` `F7` | Play before selection end |
| `Shift` `F8` | Play after selection end |
| `Ctrl` `Shift` `F5` | Play before and after selection start |
| `Ctrl` `Shift` `F7` | Play before and after selection end |
| `C` | Play cut preview |
| `F1` | Selection tool |
| `F2` | Envelope tool |
| `F3` | Draw tool |
| `F4` | Zoom tool |
| `F5` | Time shift tool |
| `F6` | Multi tool |
| `A` | Previous tool |
| `D` | Next tool |
| `Backspace` | Delete |
| `Alt` `Left` | Move to previous label |
| `Alt` `Right` | Move to next label |
| `Left` | Short seek left during playback |
| `Right` | Short seek right during playback |
| `Shift` `Left` | Long seek left during playback |
| `Shift` `Right` | Long seek right during playback |
| `Shift` `I` | Change recording device |
| `Shift` `O` | Change playback device |
| `Shift` `H` | Change audio host |
| `Shift` `N` | Change recording channels |
| `Shift` `Home` | Selection to start |
| `Shift` `End` | Selection to end |
| `Shift` `Left` | Selection extend left |
| `Shift` `Right` | Selection extend right |
| `Ctrl` `Shift` `Right` | Selection contract left |
| `Ctrl` `Shift` `Left` | Selection contract right |
| `Ctrl` `Shift` `F6` | Move backwards from toolbars to tracks |
| `Ctrl` `F6` | Move forward from toolbars to tracks |
| `Up` | Move focus to previous track |
| `Down` | Move focus to next track |
| `Ctrl` `Home` | Move focus to first track |
| `Ctrl` `End` | Move focus to last track |
| `Shift` `Up` | Move focus to previous and select |
| `Shift` `Down` | Move focus to next and select |
| `Enter` | Toggle focused track |
| `Left` | Cursor left |
| `Right` | Cursor right |
| `,` | Cursor short jump left |
| `.` | Cursor short jump right |
| `Shift` `,` | Cursor long jump left |
| `Shift` `.` | Cursor long jump right |
| `Shift` `P` | Change pan on focused track |
| `Alt` `Shift` `Left` | Pan left on focused track |
| `Alt` `Shift` `Right` | Pan right on focused track |
| `Shift` `G` | Change gain on focused track |
| `Alt` `Shift` `Up` | Increase gain on focused track |
| `Alt` `Shift` `Down` | Decrease gain on focused track |
| `Shift` `U` | Mute or unmute focused track |
| `Shift` `S` | Solo or unsolo focused track |
| `Shift` `C` | Close focused track |
{.shortcuts}
### Select Menu
| Shortcut | Action |
| ------------------ | -------------------------------- |
| `Ctrl` `A` | Select all |
| `Ctrl` `Shift` `A` | Select none |
| `Z` | Select at zero crossings |
| `Ctrl` `Shift` `K` | Select in all tracks |
| `Ctrl` `Shift` `Y` | Select in all sync-locked tracks |
| `[` | Left at playback position |
| `]` | Right at playback position |
| `Shift` `J` | Track start to cursor |
| `Shift` `K` | Cursor to track end |
| `Q` | Toggle spectral selection |
| `Ctrl` `Alt` `P` | Previous clip |
| `Ctrl` `Alt` `N` | Next clip |
{.shortcuts}
### View Menu
| Shortcut | Action |
| ------------------ | ----------------------- |
| `Ctrl` `1` | Zoom in |
| `Ctrl` `2` | Zoom normal |
| `Ctrl` `3` | Zoom out |
| `Ctrl` `E` | Zoom to selection |
| `Shift` `Z` | Zoom toggle |
| `Ctrl` `F` | Fit to width |
| `Ctrl` `Shift` `F` | Fit to height |
| `Ctrl` `Shift` `C` | Collapse all tracks |
| `Ctrl` `Shift` `X` | Expand collapsed tracks |
| `Ctrl` `[` | Skip to selection start |
| `Ctrl` `]` | Skip to selection end |
{.shortcuts}
### Transport Menu
| Shortcut | Action |
| --------------- | --------------------------- |
| `Space` | Play or stop |
| `X` | Play or stop and set cursor |
| `Shift` `Space` | Loop play |
| `P` | Pause |
| `R` | Record |
| `Shift` `R` | Record new track |
| `Shift` `T` | Timer record... |
| `Shift` `D` | Punch and roll record |
| `P` | Pause |
| `J` | Cursor to track start |
| `K` | Cursor to track end |
| `Home` | Cursor to project start |
| `End` | Cursor to project end |
{.shortcuts}
### Tracks Menu
| Shortcut | Action |
| ------------------ | --------------------------- |
| `Ctrl` `Shift` `N` | Add new mono track |
| `Ctrl` `Shift` `M` | Mix and render to new track |
| `Ctrl` `U` | Mute all tracks |
| `Ctrl` `Shift` `U` | Unmute all tracks |
{.shortcuts}
### Effect Menu
| Shortcut | Action |
| ---------- | ------------------ |
| `Ctrl` `R` | Repeat last effect |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Audacity](https://manual.audacityteam.org/man/keyboard_shortcut_reference.html)
_(manual.audacityteam.org)_
================================================
FILE: source/_posts/awk.md
================================================
---
title: Awk
date: 2020-12-31 15:18:34
background: bg-slate-600
tags:
- bash
- text
- script
categories:
- Linux Command
intro: |
This is a one page quick reference cheat sheet to the [GNU awk](https://www.gnu.org/software/gawk/manual/gawk.html), which covers commonly used awk expressions and commands.
plugins:
- copyCode
---
## Getting Started
### Have a try
```shell script {.wrap}
$ awk -F: '{print $1, $NF}' /etc/passwd
```
---
| - | - |
| ------------- | ------------------------- |
| `-F:` | Colon as a separator |
| `{...}` | Awk program |
| `print` | Prints the current record |
| `$1` | First field |
| `$NF` | Last field |
| `/etc/passwd` | Input data file |
{.left-text}
### Awk program
```
BEGIN {
_(default " ")_ |
| `FS` | input `F`ield `S`eparator
_(default " ")_ |
| `ORS` | `O`utput `R`ecord `S`eparator
_(default "\n")_ |
| `RS` | input `R`ecord `S`eparator
_(default "\n")_ |
| `FILENAME` | Name of the file |
### Expressions
| - | - |
| ------------------- | ---------------------------------- |
| `$1 == "root"` | First field equals root |
| `{print $(NF-1)}` | Second last field |
| `NR!=1{print $0}` | From 2nd record |
| `NR > 3` | From 4th record |
| `NR == 1` | First record |
| `END{print NR}` | Total records |
| `BEGIN{print OFMT}` | Output format |
| `{print NR, $0}` | Line number |
| `{print NR " " $0}` | Line number (tab) |
| `{$1 = NR; print}` | Replace 1st field with line number |
| `$NF > 4` | Last field > 4 |
| `NR % 2 == 0` | Even records |
| `NR==10, NR==20` | Records 10 to 20 |
| `BEGIN{print ARGC}` | Total arguments |
| `ORS=NR%5?",":"\n"` | Concatenate records |
### Examples
Print sum and average
```
awk -F: '{sum += $3}
END { print sum, sum/NR }
' /etc/passwd
```
Printing parameters
```
awk 'BEGIN {
for (i = 1; i < ARGC; i++)
print ARGV[i] }' a b c
```
Output field separator as a comma
```
awk 'BEGIN { FS=":";OFS=","}
{print $1,$2,$3,$4}' /etc/passwd
```
Position of match
```
awk 'BEGIN {
if (match("One Two Three", "Tw"))
print RSTART }'
```
Length of match
```
awk 'BEGIN {
if (match("One Two Three", "re"))
print RLENGTH }'
```
### Environment Variables
| - | - |
| --------- | --------------------------------------------------------- |
| `ARGC` | Number or arguments |
| `ARGV` | Array of arguments |
| `FNR` | `F`ile `N`umber of `R`ecords |
| `OFMT` | Format for numbers
_(default "%.6g")_ |
| `RSTART` | Location in the string |
| `RLENGTH` | Length of match |
| `SUBSEP` | Multi-dimensional array separator
_(default "\034")_ |
| `ARGIND` | Argument Index |
### GNU awk only
| - | - |
| ------------- | --------------------- |
| `ENVIRON` | Environment variables |
| `IGNORECASE` | Ignore case |
| `CONVFMT` | Conversion format |
| `ERRNO` | System errors |
| `FIELDWIDTHS` | Fixed width fields |
### Defining variable
```
awk -v var1="Hello" -v var2="Wold" '
END {print var1, var2}
' `
- `<=`
- `>=`
{.cols-3 .marker-none}
### Examples
```
awk 'BEGIN {
if ("foo" ~ "^fo+$")
print "Fooey!";
}'
```
#### Not match
```
awk 'BEGIN {
if ("boo" !~ "^fo+$")
print "Boo!";
}'
```
#### if in array
```
awk 'BEGIN {
assoc["foo"] = "bar";
assoc["bar"] = "baz";
if ("foo" in assoc)
print "Fooey!";
}'
```
## Awk Functions
### Common functions {.col-span-2}
| Function | Description |
| --------------------- | ------------------------------------------------------------------------------- |
| `index(s,t)` | Position in string s where string t occurs, 0 if not found |
| `length(s)` | Length of string s (or $0 if no arg) |
| `rand` | Random number between 0 and 1 |
| `substr(s,index,len)` | Return len-char substring of s that begins at index (counted from 1) |
| `srand` | Set seed for rand and return previous seed |
| `int(x)` | Truncate x to integer value |
| `split(s,a,fs)` | Split string s into array a split by fs, returning length of a |
| `match(s,r)` | Position in string s where regex r occurs, or 0 if not found |
| `sub(r,t,s)` | Substitute t for first occurrence of regex r in string s (or $0 if s not given) |
| `gsub(r,t,s)` | Substitute t for all occurrences of regex r in string s |
| `system(cmd)` | Execute cmd and return exit status |
| `tolower(s)` | String s to lowercase |
| `toupper(s)` | String s to uppercase |
| `getline` | Set $0 to next input record from current input file. |
### User defined function
```
awk '
# Returns minimum number
function find_min(num1, num2){
if (num1 < num2)
return num1
return num2
}
# Returns maximum number
function find_max(num1, num2){
if (num1 > num2)
return num1
return num2
}
# Main function
function main(num1, num2){
result = find_min(num1, num2)
print "Minimum =", result
result = find_max(num1, num2)
print "Maximum =", result
}
# Script execution starts here
BEGIN {
main(10, 60)
}
'
```
## Awk Arrays
### Array with index
```
awk 'BEGIN {
arr[0] = "foo";
arr[1] = "bar";
print(arr[0]); # => foo
delete arr[0];
print(arr[0]); # => ""
}'
```
### Array with key
```
awk 'BEGIN {
assoc["foo"] = "bar";
assoc["bar"] = "baz";
print("baz" in assoc); # => 0
print("foo" in assoc); # => 1
}'
```
### Array with split
```
awk 'BEGIN {
split("foo:bar:baz", arr, ":");
for (key in arr)
print arr[key];
}'
```
### Array with asort
```
awk 'BEGIN {
arr[0] = 3
arr[1] = 2
arr[2] = 4
n = asort(arr)
for (i = 1; i <= n ; i++)
print(arr[i])
}'
```
### Multi-dimensional
```
awk 'BEGIN {
multidim[0,0] = "foo";
multidim[0,1] = "bar";
multidim[1,0] = "baz";
multidim[1,1] = "boo";
}'
```
### Multi-dimensional iteration
```
awk 'BEGIN {
array[1,2]=3;
array[2,3]=5;
for (comb in array) {
split(comb,sep,SUBSEP);
print sep[1], sep[2],
array[sep[1],sep[2]]
}
}'
```
## Awk Conditions
### if-else statement
```
awk -v count=2 'BEGIN {
if (count == 1)
print "Yes";
else
print "Huh?";
}'
```
#### Ternary operator
```
awk -v count=2 'BEGIN {
print (count==1) ? "Yes" : "Huh?";
}'
```
### Exists
```
awk 'BEGIN {
assoc["foo"] = "bar";
assoc["bar"] = "baz";
if ("foo" in assoc)
print "Fooey!";
}'
```
#### Not exists
```
awk 'BEGIN {
assoc["foo"] = "bar";
assoc["bar"] = "baz";
if ("Huh" in assoc == 0 )
print "Huh!";
}'
```
### switch
```
awk -F: '{
switch (NR * 2 + 1) {
case 3:
case "11":
print NR - 1
break
case /2[[:digit:]]+/:
print NR
default:
print NR + 1
case -1:
print NR * -1
}
}' /etc/passwd
```
## Awk Loops
### for...i
```
awk 'BEGIN {
for (i = 0; i < 10; i++)
print "i=" i;
}'
```
#### Powers of two between 1 and 100
```
awk 'BEGIN {
for (i = 1; i <= 100; i *= 2)
print i
}'
```
### for...in
```
awk 'BEGIN {
assoc["key1"] = "val1"
assoc["key2"] = "val2"
for (key in assoc)
print assoc[key];
}'
```
#### Arguments
```
awk 'BEGIN {
for (argnum in ARGV)
print ARGV[argnum];
}' a b c
```
### Examples {.row-span-3}
#### Reverse records
```
awk -F: '{ x[NR] = $0 }
END {
for (i = NR; i > 0; i--)
print x[i]
}
' /etc/passwd
```
#### Reverse fields
```
awk -F: '{
for (i = NF; i > 0; i--)
printf("%s ",$i);
print ""
}' /etc/passwd
```
#### Sum by record
```
awk -F: '{
s=0;
for (i = 1; i <= NF; i++)
s += $i;
print s
}' /etc/passwd
```
#### Sum whole file
```
awk -F: '
{for (i = 1; i <= NF; i++)
s += $i;
};
END{print s}
' /etc/passwd
```
### while {.row-span-2}
```
awk 'BEGIN {
while (a < 10) {
print "- " " concatenation: " a
a++;
}
}'
```
#### do...while
```
awk '{
i = 1
do {
print $0
i++
} while (i <= 5)
}' /etc/passwd
```
### Break
```
awk 'BEGIN {
break_num = 5
for (i = 0; i < 10; i++) {
print i
if (i == break_num)
break
}
}'
```
### Continue
```
awk 'BEGIN {
for (x = 0; x <= 10; x++) {
if (x == 5 || x == 6)
continue
printf "%d ", x
}
print ""
}'
```
## Awk Formatted Printing
### Usage
#### Right align
```
awk 'BEGIN{printf "|%10s|\n", "hello"}'
| hello|
```
#### Left align
```
awk 'BEGIN{printf "|%-10s|\n", "hello"}'
|hello |
```
### Common specifiers
| Character | Description |
| ------------- | --------------------- |
| `c` | ASCII character |
| `d` | Decimal integer |
| `e`, `E`, `f` | Floating-point format |
| `o` | Unsigned octal value |
| `s` | String |
| `%` | Literal % |
### Space
```
awk -F: '{
printf "%-10s %s\n", $1, $(NF-1)
}' /etc/passwd | head -n 3
```
Outputs
```shell script
root /root
bin /bin
daemon /sbin
```
### Header
```
awk -F: 'BEGIN {
printf "%-10s %s\n", "User", "Home"
printf "%-10s %s\n", "----","----"}
{ printf "%-10s %s\n", $1, $(NF-1) }
' /etc/passwd | head -n 5
```
Outputs
```
User Home
---- ----
root /root
bin /bin
daemon /sbin
```
## Miscellaneous
### Regex Metacharacters
- `\`
- `^`
- `$`
- `.`
- `[`
- `]`
- `|`
- `(`
- `)`
- `*`
- `+`
- `?`
{.cols-3 .marker-none}
### Escape Sequences
| - | - |
| ---- | ------------------- |
| `\b` | Backspace |
| `\f` | Form feed |
| `\n` | Newline (line feed) |
| `\r` | Carriage return |
| `\t` | Horizontal tab |
| `\v` | Vertical tab |
### Run script
```shell script
$ cat demo.awk
#!/usr/bin/awk -f
BEGIN { x = 23 }
{ x += 2 }
END { print x }
$ awk -f demo.awk /etc/passwd
69
```
## Also see
- [The GNU Awk User's Guide](https://www-zeuthen.desy.de/dv/documentation/unixguide/infohtml/gawk/gawk.html)
_(www-zeuthen.desy.de)_
- [AWK cheatsheet](https://gist.github.com/Rafe/3102414) _(gist.github.com)_
================================================
FILE: source/_posts/bash.md
================================================
---
title: Bash
date: 2020-11-25 18:28:43
background: bg-[#3e4548]
tags:
- shell
- sh
- echo
- script
- linux
categories:
- Programming
- Operating System
intro: This is a quick reference cheat sheet to getting started with linux bash shell scripting.
plugins:
- copyCode
---
## Getting Started
### hello.sh
```bash
#!/bin/bash
VAR="world"
echo "Hello $VAR!" # => Hello world!
```
Execute the script
```shell script
$ bash hello.sh
```
### Variables
```bash
NAME="John"
echo ${NAME} # => John (Variables)
echo $NAME # => John (Variables)
echo "$NAME" # => John (Variables)
echo '$NAME' # => $NAME (Exact string)
echo "${NAME}!" # => John! (Variables)
NAME = "John" # => Error (about space)
```
### Comments
```bash
# This is an inline Bash comment.
```
```bash
: '
This is a
very neat comment
in bash
'
```
Multi-line comments use `:'` to open and `'` to close
### Arguments {.row-span-2}
| Expression | Description |
| ----------- | ------------------------------------- |
| `$1` … `$9` | Parameter 1 ... 9 |
| `$0` | Name of the script itself |
| `$1` | First argument |
| `${10}` | Positional parameter 10 |
| `$#` | Number of arguments |
| `$$` | Process id of the shell |
| `$*` | All arguments |
| `$@` | All arguments, starting from first |
| `$-` | Current options |
| `$_` | Last argument of the previous command |
See: [Special parameters](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables)
### Functions
```bash
get_name() {
echo "John"
}
echo "You are $(get_name)"
```
See: [Functions](#bash-functions)
### Conditionals {#conditionals-example}
```bash
if [[ -z "$string" ]]; then
echo "String is empty"
elif [[ -n "$string" ]]; then
echo "String is not empty"
fi
```
See: [Conditionals](#bash-conditionals)
### Brace expansion
```bash
echo {A,B}.js
```
---
| Expression | Description |
| ---------- | ------------------- |
| `{A,B}` | Same as `A B` |
| `{A,B}.js` | Same as `A.js B.js` |
| `{1..5}` | Same as `1 2 3 4 5` |
See: [Brace expansion](http://wiki.bash-hackers.org/syntax/expansion/brace)
### Shell execution
```bash
# => I'm in /path/of/current
echo "I'm in $(PWD)"
# Same as:
echo "I'm in `pwd`"
```
See: [Command substitution](http://wiki.bash-hackers.org/syntax/expansion/cmdsubst)
## Bash Parameter expansions
### Syntax {.row-span-2}
| Code | Description |
| ----------------- | ------------------- |
| `${FOO%suffix}` | Remove suffix |
| `${FOO#prefix}` | Remove prefix |
| `${FOO%%suffix}` | Remove long suffix |
| `${FOO##prefix}` | Remove long prefix |
| `${FOO/from/to}` | Replace first match |
| `${FOO//from/to}` | Replace all |
| `${FOO/%from/to}` | Replace suffix |
| `${FOO/#from/to}` | Replace prefix |
#### Substrings
| Expression | Description |
| --------------- | ------------------------------ |
| `${FOO:0:3}` | Substring _(position, length)_ |
| `${FOO:(-3):3}` | Substring from the right |
#### Length
| Expression | Description |
| ---------- | ---------------- |
| `${#FOO}` | Length of `$FOO` |
#### Default values
| Expression | Description |
| ----------------- | ---------------------------------------- |
| `${FOO:-val}` | `$FOO`, or `val` if unset |
| `${FOO:=val}` | Set `$FOO` to `val` if unset |
| `${FOO:+val}` | `val` if `$FOO` is set |
| `${FOO:?message}` | Show message and exit if `$FOO` is unset |
### Substitution
```bash
echo ${food:-Cake} #=> $food or "Cake"
```
```bash
STR="/path/to/foo.cpp"
echo ${STR%.cpp} # /path/to/foo
echo ${STR%.cpp}.o # /path/to/foo.o
echo ${STR%/*} # /path/to
echo ${STR##*.} # cpp (extension)
echo ${STR##*/} # foo.cpp (basepath)
echo ${STR#*/} # path/to/foo.cpp
echo ${STR##*/} # foo.cpp
echo ${STR/foo/bar} # /path/to/bar.cpp
```
### Slicing
```bash
name="John"
echo ${name} # => John
echo ${name:0:2} # => Jo
echo ${name::2} # => Jo
echo ${name::-1} # => Joh
echo ${name:(-1)} # => n
echo ${name:(-2)} # => hn
echo ${name:(-2):2} # => hn
length=2
echo ${name:0:length} # => Jo
```
See: [Parameter expansion](http://wiki.bash-hackers.org/syntax/pe)
### basepath & dirpath
```bash
SRC="/path/to/foo.cpp"
```
```bash
BASEPATH=${SRC##*/}
echo $BASEPATH # => "foo.cpp"
DIRPATH=${SRC%$BASEPATH}
echo $DIRPATH # => "/path/to/"
```
### Transform
```bash
STR="HELLO WORLD!"
echo ${STR,} # => hELLO WORLD!
echo ${STR,,} # => hello world!
STR="hello world!"
echo ${STR^} # => Hello world!
echo ${STR^^} # => HELLO WORLD!
ARR=(hello World)
echo "${ARR[@],}" # => hello world
echo "${ARR[@]^}" # => Hello World
```
## Bash Arrays
### Defining arrays
```bash
Fruits=('Apple' 'Banana' 'Orange')
Fruits[0]="Apple"
Fruits[1]="Banana"
Fruits[2]="Orange"
ARRAY1=(foo{1..2}) # => foo1 foo2
ARRAY2=({A..D}) # => A B C D
# Merge => foo1 foo2 A B C D
ARRAY3=(${ARRAY1[@]} ${ARRAY2[@]})
# declare construct
declare -a Numbers=(1 2 3)
Numbers+=(4 5) # Append => 1 2 3 4 5
```
### Indexing
| - | - |
| ------------------ | ------------- |
| `${Fruits[0]}` | First element |
| `${Fruits[-1]}` | Last element |
| `${Fruits[*]}` | All elements |
| `${Fruits[@]}` | All elements |
| `${#Fruits[@]}` | Number of all |
| `${#Fruits}` | Length of 1st |
| `${#Fruits[3]}` | Length of nth |
| `${Fruits[@]:3:2}` | Range |
| `${!Fruits[@]}` | Keys of all |
### Iteration
```bash
Fruits=('Apple' 'Banana' 'Orange')
for e in "${Fruits[@]}"; do
echo $e
done
```
#### With index
```bash
for i in "${!Fruits[@]}"; do
printf "%s\t%s\n" "$i" "${Fruits[$i]}"
done
```
### Operations {.col-span-2}
```bash
Fruits=("${Fruits[@]}" "Watermelon") # Push
Fruits+=('Watermelon') # Also Push
Fruits=( ${Fruits[@]/Ap*/} ) # Remove by regex match
unset Fruits[2] # Remove one item
Fruits=("${Fruits[@]}") # Duplicate
Fruits=("${Fruits[@]}" "${Veggies[@]}") # Concatenate
lines=(`cat "logfile"`) # Read from file
```
### Arrays as arguments
```bash
function extract()
{
local -n myarray=$1
local idx=$2
echo "${myarray[$idx]}"
}
Fruits=('Apple' 'Banana' 'Orange')
extract Fruits 2 # => Orangle
```
## Bash Dictionaries
### Defining
```bash
declare -A sounds
```
```bash
sounds[dog]="bark"
sounds[cow]="moo"
sounds[bird]="tweet"
sounds[wolf]="howl"
```
### Working with dictionaries
```bash
echo ${sounds[dog]} # Dog's sound
echo ${sounds[@]} # All values
echo ${!sounds[@]} # All keys
echo ${#sounds[@]} # Number of elements
unset sounds[dog] # Delete dog
```
### Iteration
```bash
for val in "${sounds[@]}"; do
echo $val
done
```
---
```bash
for key in "${!sounds[@]}"; do
echo $key
done
```
## Bash Conditionals
### Integer conditions
| Condition | Description |
| ------------------- | ------------------------------------------- |
| `[[ NUM -eq NUM ]]` | \` | Revert to the previous layer setting |
| `Tab` | Start or stop edit mode |
| `A` | Selects or deselects all |
| `Ctrl` `A` | Apply size and rotation |
| `Ctrl` `Shift` `A` | If the active object is automatically duplicated, brings up a menu for actually creating the objects |
| `Shift` `A` | Brings up the add menu, the toolbox items that start with ADD |
| `B` | Border select, draws a rectangle with the left mouse to select objects |
| `Shift` `B` | Render border, this only works in camera view mode |
| `C` | Center view, the position of the 3D cursor becomes the new center of the 3D window |
| `Alt` `C` | Convert menu, depending on the active object a popup menu is displayed enabling you to convert certain types of ObData |
| `Ctrl` `C` | Copy menu, this menu copies information from the active object to selected objects |
| `Shift` `C` | Center zero view, the 3D cursor is set to zero and the view is changed so all objects can be displayed |
| `D` | Display draw mode menu |
| `Shift` `D` | Add duplicate, the selected objects are duplicated |
| `Alt` `D` | Add linked duplicate, linked duplicates of the selected objects are created |
| `Ctrl` `D` | Draw the texture image as wire |
| `Alt` `E` | Start or stop edit mode |
| `F` | If selected object is a mash, toggles face select mode on or off |
| `Ctrl` `F` | Sort faces, the faces of the active mesh object are sorted based on the current view in the 3D window |
| `G` | Grab mode, or translation mode |
| `Alt` `G` | Clears translations, given in grab mode |
| `Shift` `G` | Group selection |
| `I` | Insert object key, a keyposition is inserted in the current frame of all selected objects |
| `Ctrl` `J` | Join objects, all selected objects of the same type are added to the active object |
| `K` | Show keys, the draw key option is turned on for all selected objects |
| `Shift` `K` | Display popup menu for showing and selecting all keys |
| `L` | Makes selected object local, makes library linked objects local for the current scene |
| `Ctrl` `L` | Link selected, links some of the active object data to all selected objects |
| `Shift` `L` | Select linked, selected all objects somehow linked to the active object |
| `M` | Move selected objects to another layer |
| `Ctrl` `M` | Mirror menu, it is possible to mirror an object along the X, Y, or Z axis |
| `N` | Number panel, the location, rotation, and scaling of the active object are displayed and can be modified |
| `Alt` `O` | Clear origin, the origin is erased for all child objects, which causes them to move ot the exact location of the parent objects |
| `Shift` `O` | If the selected object is a mesh, toggles the subsurf on or off |
| `Ctrl` `P` | Make selected objects the children of the active object |
| `Alt` `P` | Clears parent relation, user is asked if they wish to keep or clear parent-induced transforms |
| `R` | Rotate mode, works on selected objects |
| `Alt` `R` | Clears rotation, the X, Y, and Z rotations of selected objects are set to zero |
| `S` | Size mode or scaling mode, works on selected objects |
| `Alt` `S` | Clears size, the X, Y, and Z dimensions of selected objects are set to 1 |
| `Shift` `S` | Opens the snap menu |
| `T` | Texture space mode, the position of dimensions of the texture space for the selected objects can be changed in the same manner for grab and size mode |
| `Ctrl` `T` | Makes selected objects track the active object |
| `Alt` `T` | Clears old style track, constraint track is removed as all constrains are |
| `U` | Makes object single user, the inverse operation of link |
| `V` | Switches in and out of vertex paint mode |
| `Alt` `V` | Object image aspect, this hotkey sets the X and Y dimensions of the selected objects in relation to the dimensions of the image texture they have |
| `W` | Opens the object booleans menu |
| `X` | Deletes selected objects |
| `Z` | Toggles solid mode on or off |
| `Shift` `Z` | Toggles shaded mode on or off |
| `Alt` `Z` | Toggles textured mode on or off |
{.shortcuts}
### Edit Mode - General
| Shortcut | Action |
| ------------ | -------------------------------------------------------------------------------------------------- |
| `Tab` | Start or stop edit mode |
| `Alt` `E` | Start or stop edit mode (alternative) |
| `Ctrl` `Tab` | Switches between vertex select, edge select, and face select modes |
| `A` | Select or unselect all |
| `B` `B` | Circle select |
| `Ctrl` `H` | With vertices selected, this creates a hook object |
| `N` | Number panel, simpler than the object mode one |
| `O` | Switch in and out of proportional editing |
| `Shift` `O` | Toggles between smooth and sharp proportional editing |
| `P` | Separate, you can choose to make a new object with all selected vertices, edges, faces, and curves |
| `Ctrl` `P` | Make vertex parent |
| `Ctrl` `S` | Shear, in edit mode this operation enables you to make selected forms slant |
| `U` | Undo |
| `W` | Displays specials popup menu |
| `Shift` `W` | Warp, selected vertices can be bent into curves with this option |
{.shortcuts}
### Edit Mode - Mesh
| Shortcut | Action |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------- |
| `Ctrl` `+` | Adds to selection all vertices connected by an edge to an already selected vertex |
| `Ctrl` `-` | Removes from selection all vertices of the outer ring of selected vertices |
| `C` | If using curve deformation, toggles the curve cyclic mode on or off |
| `E` | Extrude selected |
| `Shift` `E` | Crease subsurf edge |
| `Ctrl` `E` | Mark LSCM seam |
| `F` | Make edge or face |
| `Shift` `F` | Fill selected, all selected vertices that are bound by edges and form a closed polygon are filled with triangular faces |
| `Alt` `F` | Beauty fill, edges of all selected triangular faces are switched so equally sized faces are formed |
| `Ctrl` `F` | Flip faces, selected triangular faces are paired and common edge of each pair swapped |
| `H` | Hide selected, all selected vertices and faces are hidden |
| `Shift` `H` | Hide not selected, all non-selected vertices and faces are hidden |
| `Alt` `H` | Reveal, all hidden vertices and faces are drawn again |
| `Alt` `J` | Join faces, selected triangular faces are joined in pairs and transformed to quads |
| `K` | Knife tool menu |
| `L` | Select linked |
| `Shift` `L` | Deselect linked |
| `Ctrl` `L` | Select linked selected |
| `M` | Mirror, opens a popup asking for the axis to mirror |
| `Alt` `M` | Merges selected vertices as barycentrum or at cursor depending on selection made on popup |
| `Ctrl` `N` | Calculate normals outside |
| `Ctrl` `Shift` `N` | Calculate normals inside |
| `Alt` `S` | Scales each vertex in the direction of its local normal |
| `Ctrl` `T` | Make triangles, all selected faces are converted to triangles |
| `U` | Undo |
| `Shift` `U` | Redo |
| `Alt` `U` | Undo menu |
| `W` | Special menu |
| `X` | Erase selected |
| `Y` | Split, this command splits the selected part of a mesh without deleting faces |
{.shortcuts}
### Edit Mode - Curve
| Shortcut | Action |
| ----------- | -------------------------------------------------------------------------------------- |
| `C` | Set the selected curves to cyclic or turn cyclic off |
| `E` | Extrude curve |
| `F` | Add segment, a segment is added between two selected vertices at the end of two curves |
| `H` | Toggle handle align or free |
| `Shift` `H` | Set handle to auto |
| `Ctrl` `H` | Calculate handles |
| `L` | Select linked |
| `Shift` `L` | Deselect linked |
| `M` | Mirror selected control points exactly as for vertices in a mesh |
| `T` | Tilt mode, specify an extra axis rotation for each vertex in a 3D curve |
| `Alt` `T` | Clear tilt |
| `V` | Vector handle |
| `W` | The special menu for curves appears |
| `X` | Erase selected |
{.shortcuts}
### Edit Mode - Surface
| Shortcut | Action |
| ----------- | -------------------------------------------------------------------------------------- |
| `C` | Toggle cyclic menu |
| `E` | Extrude selected |
| `F` | Add segment, a segment is added between two selected vertices at the end of two curves |
| `L` | Select linked |
| `Shift` `L` | Deselect linked |
| `M` | Mirror selected control points exactly as for vertices in a mesh |
| `Shift` `R` | Select row, starting with the last selected vertex |
| `W` | The special menu for surfaces appears |
| `X` | Erase selected |
{.shortcuts}
### Edit Mode - Font
| Shortcut | Action |
| --------------- | --------------------------------------------- |
| `Right` | Move text cursor one position forward |
| `Shift` `Right` | Move text cursor to the end of the line |
| `Left` | Move text cursor one position backwards |
| `Shift` `Left` | Move text cursor to the start of the line |
| `Down` | Move text cursor one line forward |
| `Shift` `Down` | Move text cursor to the end of the text |
| `Up` | Move text cursor one line back |
| `Shift` `Up` | Move text cursor to the beginning of the text |
| `Alt` `U` | Reload original data |
| `Alt` `V` | Paste text |
{.shortcuts}
### VertexPaint
| Shortcut | Action |
| ----------- | --------------------------------------------------------------------------- |
| `Shift` `K` | All vertex colors are erased, they are changed to the current drawing color |
| `U` | Undo, press twice redos the undone |
| `W` | Shared vertexcol, the colors of all faces that share vertices are blended |
{.shortcuts}
### UV Editor
| Shortcut | Action |
| --------- | --------------------------------------------------------------------------------------------- |
| `E` | LSCM unwrapping, launches on the faces visible in the UV editor |
| `P` | Pin selected vertices, they will stay in place on the UV editor when executing an LSCM unwrap |
| `Alt` `P` | Un-pin selected vertices |
{.shortcuts}
### FaceSelect
| Shortcut | Action |
| -------- | ------------------------------------------------------------------------------------------------------------ |
| `Tab` | Switches to edit mode |
| `F` | With multiple, co-planar faces selected, this will merge them into one FGon so long as they remain co-planar |
| `L` | Select linked UVs |
| `R` | Calls a menu allowing to rotate the UV coordinates or the vertex col |
| `U` | Calls the UV Calculation menu |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Blender](https://download.blender.org/documentation/BlenderHotkeyReference.pdf)
_(download.blender.org)_
================================================
FILE: source/_posts/brave.md
================================================
---
title: Brave Browser
date: 2022-11-23 16:23:31.698868
background: bg-[#da6b37]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 64 keyboard shortcuts found in the Brave browser
---
## Keyboard Shortcuts {.cols-2}
### Tabs and Windows
| Shortcut | Action |
| -------------------- | -------------------------------------------------------------------- |
| `Ctrl` `N` | Open a new window |
| `Ctrl` `Shift` `N` | Open a new window in Private mode |
| `Ctrl` `T` | Open a new tab, and jump to it |
| `Ctrl` `Shift` `T` | Reopen the last closed tab, and jump to it |
| `Ctrl` `Tab` | Jump to the next open tab |
| `Ctrl` `Shift` `Tab` | Jump to the previous open tab |
| `Ctrl` `1-8` | Jump to a specific tab |
| `Ctrl` `9` | Jump to the last tab |
| `Alt` `Home` | Open your home page in the current tab |
| `Ctrl` `Left` | Open the previous page from your browsing history in the current tab |
| `Alt` `Right` | Open the next page from your browsing history in the current tab |
| `Ctrl` `W` | Close the current tab |
| `Ctrl` `Shift` `W` | Close the current window |
| `Alt` `Space` `N` | Minimize the current window |
| `Alt` `Space` `X` | Maximize the current window |
| `Alt` `F4` | Close the current window |
| `Ctrl` `Shift` `Q` | Quit Brave |
{.shortcuts}
### Browser
| Shortcut | Action |
| ----------------------- | -------------------------------------------------- |
| `Alt` `F` | Open the main menu |
| `Ctrl` `Shift` `B` | Show or hide the bookmarks bar |
| `Ctrl` `H` | Open the history page in a new tab |
| `Ctrl` `J` | Open the downloads page in a new tab |
| `Shift` `Esc` | Open the Brave task manager |
| `Shift` `Alt` `T` | Set focus on the first item in the toolbar |
| `F10` | Set focus on the last item in the toolbar |
| `F6` | Switch focus to unfocused dialog, if showing |
| `Ctrl` `F` | Open the find bar to search the current page |
| `Ctrl` `G` | Jump to the next match in your find bar search |
| `Ctrl` `Shift` `G` | Jump to the previous match in your find bar search |
| `Ctrl` `Shift` `J` | Open developer tools |
| `Ctrl` `Shift` `Delete` | Open the clear browser data options |
| `F1` | Open the Brave help center in a new tab |
| `Ctrl` `Shift` `M` | Open profile menu |
| `` |
{.shortcuts}
### Address Bar
| Shortcut | Action |
| ---------------- | ------------------------------------------------------------------------------- |
| `Enter` | Search with your default search engine (after typing) |
| `Tab` | Search using a different search engine (after typing) |
| `Ctrl` `Enter` | Add www. and .com to a site name, and open it in the current tab (after typing) |
| `Alt` `Enter` | Open a new tab and perform a search (after typing) |
| `Ctrl` `L` | Jump to the address bar |
| `Ctrl` `K` | Search from anywhere on the page |
| `Shift` `Delete` | Remove predictions from your address bar (after highlighting them) |
{.shortcuts}
### Webpage
| Shortcut | Action |
| ------------------ | ------------------------------------------------------------------ |
| `Ctrl` `P` | Open options to print the current page |
| `Ctrl` `S` | Open options to save the current page |
| `Ctrl` `R` | Reload the current page |
| `Ctrl` `Shift` `R` | Reload the current page, ignoring cached content |
| `Esc` | Stop the page loading |
| `Tab` | Browse clickable items moving forward |
| `Shift` `Tab` | Browse clickable items moving backwards |
| `Ctrl` `O` | Open a file from your computer in Brave |
| `Ctrl` `U` | Display non-editable HTML source code for the current page |
| `Ctrl` `D` | Save your current webpage as a bookmark |
| `Ctrl` `Shift` `D` | Save all open tabs as bookmarks in a new folder |
| `F11` | Turn full-screen mode on or off |
| `Ctrl` `+` | Make everything on the page bigger |
| `Ctrl` `-` | Make everything on the page smaller |
| `Ctrl` `0` | Return everything on the page to default size |
| `Space` | Scroll down a webpage, a screen at a time |
| `Shift` `Space` | Scroll up a webpage, a screen at a time |
| `Home` | Go to the top of the page |
| `End` | Go to the bottom of the page |
| `Shift` `(scroll)` | Scroll horizontally on the page |
| `Alt` `Left` | Move your cursor to the front of the previous word in a text field |
| `Ctrl` `Right` | Move your cursor to the back of the next word in a text field |
| `Ctrl` `Back` | Delete the previous word in a text field |
| `Alt` `Home` | Open the home page in the current tab |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Brave](https://support.brave.com/hc/en-us/articles/360032272171-What-keyboard-shortcuts-can-I-use-in-Brave-)
_(support.brave.com)_
================================================
FILE: source/_posts/c.md
================================================
---
title: C
date: 2022-12-30 09:51:44
background: bg-[#2a338a]
tags:
categories:
- Programming
intro: |
C quick reference cheat sheet that provides basic syntax and methods.
plugins:
- copyCode
- runCode
---
## Getting Started
### hello.c {.row-span-2}
```c
#include \|= 3 | x `=` x \| 3 |
| x `^=` 3 | x `=` x `^` 3 |
| x `>>=` 3 | x `=` x `>>` 3 |
| x `<<=` 3 | x `=` x `<<` 3 |
### Comparison Operators
```c
int x = 5;
int y = 3;
printf("%d", x > y);
// returns 1 (true) because 5 is greater than 3
```
---
| Symbol | Name | Example |
| ------ | ------------------------ | -------- |
| `==` | equals | x `==` y |
| `!=` | not equal to | x `!=` y |
| `>` | greater than | x `>` y |
| `<` | less than | x `<` y |
| `>=` | greater than or equal to | x `>=` y |
| `<=` | less than or equal to | x `<=` y |
Comparison operators are used to compare two values
### Logical Operators {.col-span-2}
| Symbol | Name | Description | Example |
| ----------------- | ------------- | --------------------------------------------- | ----------------------------- |
| `&&` | `and` logical | returns true if both statements are true | `x < 5 && x < 10` |
| \|\| | `or` logical | returns true if one of the statements is true | x < 5 \|\| x < 4 |
| `!` | `not` logical | Invert result, return false if true | `!(x < 5 && x < 10)` |
{.show-header}
### Operator Examples {.row-span-2}
```c
unsigned int a = 60; /*60 = 0011 1100 */
unsigned int b = 13; /*13 = 0000 1101 */
int c = 0;
c = a & b; /*12 = 0000 1100 */
printf("Line 1 -the value of c is %d\n", c);
c = a | b; /*61 = 0011 1101 */
printf("Line 2 -the value of c is %d\n", c);
c = a ^ b; /*49 = 0011 0001 */
printf("Line 3 -the value of c is %d\n", c);
c = ~a; /*-61 = 1100 0011 */
printf("Line 4 -The value of c is %d\n", c);
c = a << 2; /*240 = 1111 0000 */
printf("Line 5 -the value of c is %d\n", c);
c = a >> 2; /*15 = 0000 1111 */
printf("Line 6 -The value of c is %d\n", c);
```
### Bitwise operators {.col-span-2}
| Operator | Description | Instance |
| :-------------- | :-------------------------------------------------------------- | :---------------------------------------------------- |
| `&` | Bitwise AND operation, "AND" operation by binary digits | `(A & B)` will get `12` which is 0000 1100 |
| \| | Bitwise OR operator, "or" operation by binary digit | (A \| B) will get`61` which is 0011 1101 |
| `^` | XOR operator, perform "XOR" operation by binary digits | `(A ^ B)` will get `49` which is 0011 0001 |
| `~` | Inversion operator, perform "inversion" operation by binary bit | `(~A)` will get `-61` which is 1100 0011 |
| `<<` | binary left shift operator | `A << 2` will get `240` which is 1111 0000 |
| `>>` | binary right shift operator | `A >> 2` will get `15` which is 0000 1111 |
{.show-header}
## Data Types
### Basic data types {.col-span-2}
| Data Type | Size | Range | Description |
| -------------------- | ---------------- | ---------------------------------- | :---------------------------------- |
| `char` | 1 byte | `−128` ~ `127` | single character/alphanumeric/ASCII |
| `signed char` | 1 byte | `−128` ~ `127` | |
| `unsigned char` | 1 byte | `0` ~ `255` | |
| `int` | `2` to `4` bytes | `−32,768` ~ `32,767` | store integers |
| `signed int` | 2 bytes | `−32,768` ~ `32,767` | |
| `unsigned int` | 2 bytes | `0` ~ `65,535` | |
| `short int` | 2 bytes | `−32,768` ~ `32,767` | |
| `signed short int` | 2 bytes | `−32,768` ~ `32,767` | |
| `unsigned short int` | 2 bytes | `0` ~ `65,535` | |
| `long int` | 4 bytes | `-2,147,483,648` ~ `2,147,483,647` | |
| `signed long int` | 4 bytes | `-2,147,483,648` ~ `2,147,483,647` | |
| `unsigned long int` | 4 bytes | `0` ~ `4,294,967,295` | |
| `float` | 4 bytes | `3.4E-38` ~ `3.4E+38` | |
| `double` | 8 bytes | `1.7E-308` ~ `1.7E+308` | |
| `long double` | 10 bytes | `3.4E-4932` ~ `1.1E+4932` | |
{.show-header}
### Data types
```c
// create variables
int myNum = 5; // integer
float myFloatNum = 5.99; // floating point number
char myLetter = 'D'; // string
// High precision floating point data or numbers
double myDouble = 3.2325467;
// print output variables
printf("%d\n", myNum);
printf("%f\n", myFloatNum);
printf("%c\n", myLetter);
printf("%lf\n", myDouble);
```
---
| Data Type | Description |
| :-------- | :----------------------------------- |
| `char` | character type |
| `short` | short integer |
| `int` | integer type |
| `long` | long integer |
| `float` | single-precision floating-point type |
| `double` | double-precision floating-point type |
| `void` | no type |
### Basic format specifiers
| Format Specifier | Data Type |
| ---------------- | :---------------------------------------------------- |
| `%d` or `%i` | `int` integer |
| `%f` | `float` single-precision decimal type |
| `%lf` | `double` high precision floating point data or number |
| `%c` | `char` character |
| `%s` | for `strings` strings |
{.show-header}
### Separate base format specifiers
| Format | Short | Int | Long |
| ----------- | ------------- | ----------- | :------------ |
| Octal | `%ho` | `%o` | `%lo` |
| Decimal | `%hd` | `%d` | `%ld` |
| Hexadecimal | `%hx` / `%hX` | `%x` / `%X` | `%lx` / `%lX` |
{.show-header}
### Data format example
```c
int myNum = 5;
float myFloatNum = 5.99; // floating point number
char myLetter = 'D'; // string
// print output variables
printf("%d\n", myNum);
printf("%f\n", myFloatNum);
printf("%c\n", myLetter);
```
## C Preprocessor
### Preprocessor Directives {.row-span-2}
| Directive | Description |
| ---------- | :------------------------------------------------------------------- |
| `#define` | define a macro |
| `#include` | include a source code file |
| `#undef` | undefined macro |
| `#ifdef` | Returns true if the macro is defined |
| `#ifndef` | Returns true if the macro is not defined |
| `#if` | Compile the following code if the given condition is true |
| `#else` | Alternative to `#if` |
| `#elif` | If the `#if` condition is false, the current condition is `true` |
| `#endif` | End a `#if...#else` conditional compilation block |
| `#error` | Print an error message when standard error is encountered |
| `#pragma` | Issue special commands to the compiler using the standardized method |
{.show-header}
```c
// replace all MAX_ARRAY_LENGTH with 20
#define MAX_ARRAY_LENGTH 20
// Get stdio.h from the system library
#include
If the file does not exist, a new one will be created |
| `r+` | Open a text file in `read-write` mode, allowing reading and writing of the file |
| `w+` | Open a text file in `read-write` mode, allowing reading and writing of the file |
| `a+` | Open a text file in `read-write` mode, allowing reading and writing of the file |
| `rb` | Open a binary file in `read` mode |
| `wb` | Open binary file in `write` mode |
| `ab` | Open a binary file in `append` mode |
| `rb+` | open binary file in `read-write` mode |
| `wb+` | Open binary file in `read-write` mode |
| `ab+` | open binary file in `read-write` mode |
{.show-header}
### Open the file: fopen()
```c{6}
#include \` | Focus the Console |
| `Ctrl` `L` | Clear the console |
| `Shift` `Enter` | Force a multi-line entry |
| `Enter` | Execute |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Chrome DevTools](https://developers.google.com/web/tools/chrome-devtools/shortcuts)
_(developers.google.com)_
================================================
FILE: source/_posts/code-editor-ios.md
================================================
---
title: Code Editor for iOS
date: 2022-11-23 16:23:31.697110
background: bg-[#4880c2]
label: Mac
tags:
-
- mac
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 43 keyboard shortcuts found in the Code Editor for iOS app. This application is MacOS-only.
---
## Keyboard Shortcuts {.cols-2}
### General Shortcuts I
| Shortcut | Action |
| ----------------- | ------------------------------------------------------------- |
| `Esc` | Show completions |
| `Tab` | Insert indent, depending on the preferences of tabs or spaces |
| `Cmd` `N` | New document tab |
| `Cmd` `W` | Close tab |
| `Cmd` `S` | Save |
| `Cmd` `Z` | Undo |
| `Cmd` `Shift` `Z` | Redo |
| `Cmd` `A` | Select all |
| `Cmd` `X` | Cut |
| `Cmd` `C` | Copy |
| `Cmd` `V` | Paste |
| `Cmd` `F` | Find |
| `Cmd` `G` | Find next |
| `Cmd` `Shift` `G` | Find previous |
| `Cmd` `/` | Toggle comment |
| `Cmd` `[` | Indent selection |
| `Cmd` `]` | Dedent selection |
| `Cmd` `Shift` `[` | Move to previous tab |
| `Cmd` `Shift` `]` | Move to next tab |
| `Cmd` `4` | Toggle preview, in editor only |
| `Cmd` `K` | Clear scrollback, in terminal and playgrounds only |
{.shortcuts}
### General Shortcuts II
| Shortcut | Action |
| --------------------------- | ------------------------------------------- |
| `Cmd` `R` | Reload, in preview only |
| `Cmd` `Left` | Back, in preview only |
| `Cmd` `Right` | Forward, in preview only |
| `Shift` `Left` | Select the previous character |
| `Shift` `Right` | Select the next character |
| `Cmd` `Left` | Move to the beginning of the current line |
| `Cmd` `Right` | Move to the end of the current line |
| `Cmd` `Shift` `Left` | Select to the beginning of the current line |
| `Cmd` `Shift` `Right` | Select to the end of the current line |
| `Opt` `Left` | Move to the beginning of the current word |
| `Opt` `Right` | Move to the end of the current word |
| `Opt` `Shift` `Left` | Select to the beginning of the current word |
| `Opt` `Shift` `Right` | Select to the end of the current word |
| `Cmd` `Del` | Delete to the beginning of the current line |
| `Cmd` `Opt` `Del` | Delete to the beginning of the current word |
| `Cmd` `Del (forward)` | Delete to the end of the current line |
| `Cmd` `Opt` `Del (forward)` | Delete to the end of the current word |
| `Ctrl` `A` | Move to the beginning of the current line |
| `Ctrl` `Shift` `A` | Select to the beginning of the current line |
| `Ctrl` `E` | Move to the end of the current line |
| `Ctrl` `Shift` `E` | Select to the end of the current line |
| `Ctrl` `K` | Delete to the end of the current line |
{.shortcuts}
## Also see
- [Keyboard shortcuts for the Code Editor iOS app](https://library.panic.com/code-editor/shortcut-keys/)
_(library.panic.com)_
================================================
FILE: source/_posts/color-picker.md
================================================
---
title: Color Picker
date: 2025-07-01 18:28:43
background: bg-[#2a6387]
tags:
- html
- color
categories:
- Toolkit
intro: The Color Picker cheat sheet provides you basic color info and choices
plugins:
- copyCode
---
## Getting Started
### Color Basics {.col-span-3}
| **Category** | **Description** |
|:---------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Color Models** | **RGB**: Red, Green, Blue – additive model used in screens.
**HEX**: Hexadecimal color codes, e.g., #FFFFFF.
**HSL**: Hue, Saturation, Lightness – intuitive for color adjustments.
**HSV**: Hue, Saturation, Value – similar to HSL but with different brightness handling. |
| **Color Terminology** | **Saturation**: Intensity or purity of a color.
**Hue**: The color type (e.g., red, blue).
**Lightness**: Brightness or darkness of a color.
**Opacity**: Transparency level of a color, often defined as alpha in RGBA. |
| **Color Representation Formats** | **HEX**: `#RRGGBB` or `#RRGGBBAA` (with alpha).
**RGB**: `rgb(255, 255, 255)`
**RGBA**: `rgba(255, 255, 255, 0.5)`
**HSL**: `hsl(120, 100%, 50%)`
**HSLA**: `hsla(120, 100%, 50%, 0.5)` |
### Main Frameworks {.col-span-3}
| **Framework** | **Color Notation / Syntax** | **Description** | **Documentation Link** |
|:-----------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------|:-------------------------------------------------------------------------------------------|
| **CSS** | `color: red;`
`color: #ff0000;`
`color: rgb(255, 0, 0);`
`color: rgba(255, 0, 0, 0.5);`
`color: hsl(0, 100%, 50%);`
`color: hsla(0, 100%, 50%, 0.5);` | Standard CSS color properties and formats. | [CSS Color Documentation](https://developer.mozilla.org/en-US/docs/Web/CSS/color) |
| **SASS/SCSS** | `$color: #ff0000;`
`color: $color;` | Variables for colors, can use same formats as CSS. | [SASS Color Documentation](https://sass-lang.com/documentation/values/colors) |
| **Tailwind CSS** | `class="bg-red-500"`
`class="text-green-300"` | Utility classes with predefined color shades. | [Tailwind CSS Colors](https://tailwindcss.com/docs/customizing-colors) |
| **Bootstrap** | `class="text-primary"`
`class="bg-success"` | Named color classes for quick styling. | [Bootstrap Colors](https://getbootstrap.com/docs/5.0/getting-started/introduction/#colors) |
| **Material UI** | `style={{ color: 'primary' }}` or theme palette | Uses theme palette, can override with specific color codes. | [Material UI Color](https://mui.com/customization/color/) |
## Color Palette
### Tailwind Palette {.col-span-3}
exp1 \|\| exp2 | Either is true _(OR)_ |
| `!exp` | `exp` is false _(NOT)_ |
#### Bitwise Operators
| Operator | Description |
| ------------------- | ----------------------- |
| `a & b` | Binary AND |
| a \| b | Binary OR |
| `a ^ b` | Binary XOR |
| `~ a` | Binary One's Complement |
| `a << b` | Binary Shift Left |
| `a >> b` | Binary Shift Right |
### Ternary Operator
```
┌── True ──┐
Result = Condition ? Exp1 : Exp2;
└───── False ─────┘
```
---
```cpp
int x = 3, y = 5, max;
max = (x > y) ? x : y;
// Outputs: 5
std::cout << max << std::endl;
```
---
```cpp
int x = 3, y = 5, max;
if (x > y) {
max = x;
} else {
max = y;
}
// Outputs: 5
std::cout << max << std::endl;
```
### Switch Statement
```cpp
int num = 2;
switch (num) {
case 0:
std::cout << "Zero";
break;
case 1:
std::cout << "One";
break;
case 2:
std::cout << "Two";
break;
case 3:
std::cout << "Three";
break;
default:
std::cout << "What?";
break;
}
```
## C++ Loops
### While
```cpp
int i = 0;
while (i < 6) {
std::cout << i++;
}
// Outputs: 012345
```
### Do-while
```cpp
int i = 1;
do {
std::cout << i++;
} while (i <= 5);
// Outputs: 12345
```
### Continue statements
```cpp
for (int i = 0; i < 10; i++) {
if (i % 2 == 0) {
continue;
}
std::cout << i;
} // Outputs: 13579
```
### Infinite loop
```cpp
while (true) { // true or 1
std::cout << "infinite loop";
}
```
---
```cpp
for (;;) {
std::cout << "infinite loop";
}
```
---
```cpp
for(int i = 1; i > 0; i++) {
std::cout << "infinite loop";
}
```
### for_each (Since C++11)
```cpp
#include
_(non-standard)_ |
### Cron Generator {.col-span-3}
_(non-standard)_ |
{.shortcuts}
### Special characters {.col-span-2}
| Special Character | Description |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Asterik(*)` | Matches all values in the field or any possible value. |
| `Hyphen(-)` | Used to define a range.Ex: 1-5 in 5th field(Day Of Week) Every Weekday i.e., Monday to Friday |
| `Slash (/)` | 1st field(Minute) /15 meaning every fifteen minute or increment of range. |
| `Comma (,)` | Used to separate items.Ex: 2,6,8 in 2nd fields(Hour) executes at 2am,6am and 8am |
| `L` | It is allowed only for Day of Month or Day Of Week field, 2L in Day of week indicates Last tuesday of every month |
| `Hash (#)` | It is allowed only for Day Of Week field, which must be followed within range of 1 to 5. For example, 4#1 means "The first Thursday" of given month. |
| `Question mark (?)` | Can be instead of '\*' and allowed for Day of Month and Day Of Week. Usage is restricted to either Day of Month or Day Of Week in a cron expression. |
## Also see {.cols-1}
- [Devhints](https://devhints.io/cron) _(devhints.io)_
- [Crontab Generator](https://crontab-generator.org/) _(crontab-generator.org)_
- [Crontab guru](https://crontab.guru/) _(crontab.guru)_
================================================
FILE: source/_posts/cs.md
================================================
---
title: C#
date: 2021-12-14 12:22:00
background: bg-[#8c4c8a]
tags:
- object-oriented
- class
categories:
- Programming
intro: |
C# quick reference cheat sheet that provides basic syntax and methods.
plugins:
- copyCode
---
## Getting Started
### Hello.cs
```cs
class Hello {
// main method
static void Main(string[] args)
{
// Output: Hello, world!
Console.WriteLine("Hello, world!");
}
}
```
Creates a project directory for new console application
```cs
$ dotnet new console
```
Lists all the applications templates
```cs
$ dotnet new list
```
Compiling and running (make sure you are in the project directory)
```shell script
$ dotnet run
Hello, world!
```
### Variables
```cs
int intNum = 9;
long longNum = 9999999;
float floatNum = 9.99F;
double doubleNum = 99.999;
decimal decimalNum = 99.9999M;
char letter = 'D';
bool @bool = true;
string site = "cheatsheets.zip";
var num = 999;
var str = "999";
var bo = false;
```
### Primitive Data Types
| Data Type | Size | Range |
| --------- | ---------------- | ------------------------- |
| `int` | 4 bytes | -2^31^ ^to^ 2^31^-1 |
| `long` | 8 bytes | -2^63^ ^to^ 2^63^-1 |
| `float` | 4 bytes | 6 ^to^ 7 decimal digits |
| `double` | 8 bytes | 15 decimal digits |
| `decimal` | 16 bytes | 28 ^to^ 29 decimal digits |
| `char` | 2 bytes | 0 ^to^ 65535 |
| `bool` | 1 bit | true / false |
| `string` | 2 bytes per char | _N/A_ |
{.show-header}
### Comments
```cs
// Single-line comment
/* Multi-line
comment */
// TODO: Adds comment to a task list in Visual Studio
/// Single-line comment used for documentation
/** Multi-line comment
used for documentation **/
```
### Strings
```cs
string first = "John";
string last = "Doe";
// string concatenation
string name = first + " " + last;
Console.WriteLine(name); // => John Doe
```
See: [Strings](#c-strings)
### User Input
```cs
Console.WriteLine("Enter number:");
if(int.TryParse(Console.ReadLine(),out int input))
{
// Input validated
Console.WriteLine($"You entered {input}");
}
```
### Conditionals
```cs
int j = 10;
if (j == 10) {
Console.WriteLine("I get printed");
} else if (j > 10) {
Console.WriteLine("I don't");
} else {
Console.WriteLine("I also don't");
}
```
### Arrays
```cs
char[] chars = new char[10];
chars[0] = 'a';
chars[1] = 'b';
string[] letters = {"A", "B", "C"};
int[] mylist = {100, 200};
bool[] answers = {true, false};
```
### Loops
```cs
int[] numbers = {1, 2, 3, 4, 5};
for(int i = 0; i < numbers.Length; i++) {
Console.WriteLine(numbers[i]);
}
```
---
```cs
foreach(int num in numbers) {
Console.WriteLine(num);
}
```
## C# Strings
### String concatenation
```cs
string first = "John";
string last = "Doe";
string name = first + " " + last;
Console.WriteLine(name); // => John Doe
```
### String interpolation
```cs
string first = "John";
string last = "Doe";
string name = $"{first} {last}";
Console.WriteLine(name); // => John Doe
```
### String Members {.row-span-2}
| Member | Description |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| Length | A property that returns the length of the string. |
| Compare() | A static method that compares two strings. |
| Contains() | Determines if the string contains a specific substring. |
| Equals() | Determines if the two strings have the same character data. |
| Format() | Formats a string via the {0} notation and by using other primitives. |
| Trim() | Removes all instances of specific characters from trailing and leading characters. Defaults to removing leading and trailing spaces. |
| Split() | Removes the provided character and creates an array out of the remaining characters on either side. |
{.show-header}
### Verbatim strings
```cs {.wrap}
string longString = @"I can type any characters in here !#@$%^&*()__+ '' \n \t except double quotes and I will be taken literally. I even work with multiple lines.";
```
### Member Example
```cs
// Using property of System.String
string lengthOfString = "How long?";
lengthOfString.Length // => 9
// Using methods of System.String
lengthOfString.Contains("How"); // => true
```
## Misc
### General .NET Terms {.col-span-2}
| Term | Definition |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Runtime | A collection of services that are required to execute a given compiled unit of code. |
| Common Language Runtime (CLR) | Primarily locates, loads, and managed .NET objects. The CLR also handles memory management, application hosting, coordination of threads, performing security checks, and other low-level details. |
| Managed code | Code that compiles and runs on .NET runtime. C#/F#/VB are examples. |
| Unmanaged code | Code that compiles straight to machine code and cannot be directly hosted by the .NET runtime. Contains no free memory management, garbage collection, etc. DLLs created from C/C++ are examples. |
{.show-header}
================================================
FILE: source/_posts/css3.md
================================================
---
title: CSS 3
date: 2020-12-25 20:22:47
background: bg-[#3473b5]
tags:
- web
- css
- style
categories:
- Programming
intro: |
This is a quick reference cheat sheet for CSS goodness, listing selector syntax, properties, units and other useful bits of information.
plugins:
- copyCode
- runCode
---
## Getting Started
### Introduction {.row-span-3}
CSS is rich in capabilities and is more than simply laying out pages.
#### External stylesheet
```html {.wrap}
```
#### Internal stylesheet
```html
```
#### Inline styles
```html {.wrap}
Centered text
_one level deep in div_ |
| `div + p` | P tags immediately after div |
| `div ~ p` | P tags preceded by div |
See also: [Adjacent](https://developer.mozilla.org/en-US/docs/Web/CSS/Adjacent_sibling_combinator) /
[Sibling](https://developer.mozilla.org/en-US/docs/Web/CSS/General_sibling_combinator) /
[Child](https://developer.mozilla.org/en-US/docs/Web/CSS/Child_combinator) selectors
### Attribute selectors
| | |
| -------------------- | ---------------------------------- | ---------------------------- |
| `a[target]` | With a
center / justify | | `text-transform:` | capitalize / uppercase / lowercase |
{.left-text}
See also: [Font](https://developer.mozilla.org/en-US/docs/Web/CSS/font)
### Shorthand {.secondary .col-span-2}
| | style | weight | size (required) | | line-height | family |
| ------- | -------- | ------ | --------------- | --- | ----------- | ----------------- |
| `font:` | `italic` | `400` | `14px` | `/` | `1.5` | `sans-serif` |
| | style | weight | size (required) | | line-height | family (required) |
### Example
```css
font-family: Arial, sans-serif;
font-size: 12pt;
letter-spacing: 0.02em;
```
### Case {.row-span-2}
```css
/* Hello */
text-transform: capitalize;
/* HELLO */
text-transform: uppercase;
/* hello */
text-transform: lowercase;
```
### @font-face
```css
@font-face {
font-family: 'Glegoo';
src: url('../Glegoo.woff');
}
```
## CSS Colors
### Named color
```css
color: red;
color: orange;
color: tan;
color: rebeccapurple;
```
### Hexadecimal color
```css
color: #090;
color: #009900;
color: #090a;
color: #009900aa;
```
### rgb() Colors
```css
color: rgb(34, 12, 64, 0.6);
color: rgba(34, 12, 64, 0.6);
color: rgb(34 12 64 / 0.6);
color: rgba(34 12 64 / 0.3);
color: rgb(34 12 64 / 60%);
color: rgba(34.6 12 64 / 30%);
```
### HSL Colors
```css
color: hsl(30, 100%, 50%, 0.6);
color: hsla(30, 100%, 50%, 0.6);
color: hsl(30 100% 50% / 0.6);
color: hsla(30 100% 50% / 0.6);
color: hsl(30 100% 50% / 60%);
color: hsla(30.2 100% 50% / 60%);
```
### Other
```css
color: inherit;
color: initial;
color: unset;
color: transparent;
color: currentcolor; /* keyword */
```
## CSS Backgrounds
### Properties {.row-span-2}
| Property | Description |
| ------------- | ------------- |
| `background:` | _(Shorthand)_ |
| `background-color:` | See: [Colors](#css-colors) | | `background-image:` | url(...) | | `background-position:` |
left/center/right
top/center/bottom | | `background-size:` | cover X Y | | `background-clip:` |
border-box
padding-box
content-box | | `background-repeat:` | no-repeat
repeat-x
repeat-y | |
`background-attachment:` | scroll/fixed/local | {.left-text}
### Shorthand {.secondary .col-span-2}
| | color | image | positionX | positionY | | size | repeat | attachment |
| ------------- | ------ | ------------ | --------- | --------- | --- | -------------- | ----------- | ---------- |
| `background:` | `#ff0` | `url(a.jpg)` | `left` | `top` | `/` | `100px` `auto` | `no-repeat` | `fixed;` |
| `background:` | `#abc` | `url(b.png)` | `center` | `center` | `/` | `cover` | `repeat-x` | `local;` |
| | color | image | posX | posY | | size | repeat | attach.. |
### Examples {.col-span-2}
```css {.wrap}
background: url(img_man.jpg) no-repeat center;
background:
url(img_flwr.gif) right bottom no-repeat,
url(paper.gif) left top repeat;
background: rgb(2, 0, 36);
background: linear-gradient(
90deg,
rgba(2, 0, 36, 1) 0%,
rgba(13, 232, 230, 1) 35%,
rgba(0, 212, 255, 1) 100%
);
```
## CSS The Box Model
### Maximums/Minimums
```css
.column {
max-width: 200px;
width: 500px;
}
```
See also: [max-width](https://developer.mozilla.org/en-US/docs/Web/CSS/max-width) /
[min-width](https://developer.mozilla.org/en-US/docs/Web/CSS/min-width) /
[max-height](https://developer.mozilla.org/en-US/docs/Web/CSS/max-height) /
[min-height](https://developer.mozilla.org/en-US/docs/Web/CSS/min-height)
### Margin / Padding
```css
.block-one {
margin: 20px;
padding: 10px;
}
```
See also: [Margin](https://developer.mozilla.org/en-US/docs/Web/CSS/margin) /
[Padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
### Box-sizing
```css
.container {
box-sizing: border-box;
}
```
See also: [Box-sizing](https://developer.mozilla.org/en-US/docs/Web/CSS/Box-sizing)
### Visibility
```css
.invisible-elements {
visibility: hidden;
}
```
See also: [Visibility](https://developer.mozilla.org/en-US/docs/Web/CSS/visibility)
### Auto keyword
```css
div {
margin: auto;
}
```
See also: [Margin](https://developer.mozilla.org/en-US/docs/Web/CSS/margin)
### Overflow
```css
.small-block {
overflow: scroll;
}
```
See also: [Overflow](https://developer.mozilla.org/en-US/docs/Web/CSS/overflow)
## CSS Animation {.cols-5}
### Shorthand {.col-span-5 .secondary}
| | name | duration | timing-function | delay | count | direction | fill-mode | play-state |
| ------------ | -------- | -------- | --------------- | ------- | ---------- | ------------------- | --------- | ---------- |
| `animation:` | `bounce` | `300ms` | `linear` | `100ms` | `infinite` | `alternate-reverse` | `both` | `reverse` |
| | name | duration | timing-function | delay | count | direction | fill-mode | play-state |
### Properties {.row-span-2 .col-span-2}
| Property | Value |
| ---------------------------- | ------------------------------------------------------ |
| `animation:` | _(shorthand)_ |
| `animation-name:` | \
Model Class Name: {{ objectmodel }}
``` ## Context Processor {.cols-1} ### Creating custom Context Processor Anywhere, create a `context_processors.py` file ``` project_name └───app_name ├───... └───context_processors.pyy ``` Create a function in context_processors.py that accepts a HttpRequest object as an argument and returns a dictionary A context processor is just a function that accepts an HttpRequest object as an argument and returns a dictionary. Like this: ```python # app_name/context_processors.py def site_email(request): return { 'site_email' : 'example@gmail.com' } ``` 3. Add this to your context_processors setting in settings.py (at the bottom for security reasons) ```python TEMPLATES = [ { … 'OPTIONS': { 'context_processors': [ … 'app_name.context_processors.site_email', # New context processor here … ], … }, # Now be able to access the 'site_email' template variable on every single django template across your whole site. ``` ## Model Managers and Querysets ### Model Manager Model manager allow model database reads and writes ```python # One line create and save Article.objects.create(name='Item 1', price=19.95) # Read all Article.objects.all() # Create user = User.objects.first() article = Article(user=user, name='Item 1', price=19.95) # Save article.save() # Read one Article.objects.get(id=1) # Select Related (to avoid n+1 query) posts = Post.objects.select_related('user', 'category').all() # Read or render a 404 not found page from django.shortcuts import get_object_or_404 article = get_object_or_404(Article, id=512) # Filter Article.objects.filter(model='dyson', name__icontains='dyson') # __icontains Article.objects.filter(year__gt=2016) # __gt = greater than Article.objects.filter(year__lt=2001) # __lt = less than # Filter on relationship sub model field Article.objects.get(user__username='mike') # Ordering Article.objects.order_by('name') # ascending Article.objects.order_by('-name') # descending # Slicing return first Article.objects.all().order_by('name')[0] # Slicing return last Article.objects.all().order_by('-name')[0] # Slicing limit/offset Article.objects.all().order_by('name')[1..10] # Updating article = Article.objects.first() article.name = 'new name' article.save() # One line update Article.objects.filter(id=4).update(name='new name') # Deleting article = Article.objects.first() article.delete() # One line delete article.objects.get(id=1).delete() # Delete all Article.objects.all().delete() # Set ForeignKey field value model1 = Model(name='dyson') article.model = model1 # Get ForeignKey value article1.model.name model1.article_set.all() # Add Many-to-Many article1.tags.add(tag1) article1.tags.all() tag1.articles_set.all() ``` ## Form ### Form creation {.col-span-2} In HTML, a form is a collection of elements inside `` that allow a visitor to do things like enter text, select options, manipulate objects or controls, and so on, and then send that information back to the server. ```python # app_name/forms.py from django import forms class ArticleForm(forms.Form): name = forms.Charfield(max_length=100) description = forms.Charfield(blank=True, null = True) # Model Form from django.forms import ModelForm from app_name.models import Article class ArticleForm(ModelForm): class Meta: model = Article fields = ['name', 'description', 'price'] # Use '__all__' for all fields widgets = { 'name': forms.TextInput(attrs={'class': 'form-control'}), } labels = { 'name': 'First Name', } error_messages = { 'name': {'required': 'This field is required',}, } help_texts = { 'name': 'Enter Your First Name', } ``` ```html ``` - NOTE: If the form contains a file field, your form MUST contain `enctype="multipart/form-data"`, eg: ```html ``` ##### A Tailwind CSS template pack for the wonderful django-crispy-forms. ```bash pip install crispy-tailwind ``` ```python # settings.py INSTALLED_APPS = ( ... "crispy_forms", "crispy_tailwind", ... ) CRISPY_ALLOWED_TEMPLATE_PACKS = 'tailwind' CRISPY_TEMPLATE_PACK = 'tailwind' ``` ```html {% load tailwind_filters %} {{ form|crispy }} ``` ### Form Validation ```python # forms.py from django.core.exceptions import ValidationError # field validation def clean_first_name(self): data = self.cleaned_data['first_name'] if data = 'Mike': raise ValidationError('Your name must not be Mike') return data # form validation def clean(self): first_name = self.cleaned_data['first_name'] last_name = self.cleaned_data['last_name'] if first_name + last_name = 'MikeTaylor': raise ValidationError('Your name must not be Mike Taylor') ``` ## Flash messages {.cols-1} ### Displaying messages ```python # Message tags # debug, info, success, warning and error messages.success(request, 'Login successful') messages.error(request, 'Login error') ``` ```html {% if messages %} {% for message in messages %} {% message %} {% message.tags %} {% endfor %} {% endif %} ``` ## User Model ### Pre-created User Model (pre-created) ```python # Get a reference to Django pre-created User model from django.contrib.auth import get_user_model User = get_user_model() # Or if you want to custom user model from django.contrib.auth.models import AbstractUser class User(AbstractUser): # add custom fields and methods # To make Django use that model go to settings.py and add: AUTH_USER_MODEL = 'app_name.User' ``` ## Authentication ### Authentication : LoginView ```python # LoginView is already pre-created by Django from django.contrib.auth.views import LoginView # Add a url to reach that view path('login/', LoginView.as_view(), name='login') # By default the LoginView will try to open a template name 'registration/login.html' and send a login form with it. ``` ```html {% extends "base.html" %} {% block content %} {% endblock content %} ``` #### Authentication : LogoutView ```python # LogoutView is already pre-created by Django from django.contrib.auth.views import LogoutView # Add a url to reach that view path('logout/', LoginView.as_view(), name='logout') # Include a link in a template href="{% url 'logout' %}">Logout # After link is execute, the user will be logout and redirect to LOGOUT_REDIRECT_URL specified in your settings.py ``` #### Authentication : SignupView ```python # Create a SignupView (that view is not created by default) # import sinupview form pre-created by Django from django.contrib.auth.forms import UserCreationForm from django.views.generic import CreateView class SignupView(CreateView): template_name = 'registration/signup.html' form_class = UserCreationForm def get_success_url(self): return reverse("login") ``` ```html {% extends "base.html" %} {% block content %} {% endblock content %} ``` ```python # Add a url to reach that view from posts.views import SignupView path('signup/', SignupView.as_view(), name='signup') ``` ```python # Optional: Customize the UserCreationForm # (forms.py) from django.contrib.auth import get_user_model from django.contrib.auth.forms import UserCreationForm User = get_user_model() class CustomUserCreationForm(UserCreattionForm): class Meta: model = User fields = ['username'] fields_classes = {'username': UsernameField} ``` #### Optional pre-created Authentication routes ```python # urls.py urlpatterns += path('', include('django.contrib.auth.urls')) # /login, /lougout, /signup, etc. ``` #### Template Authentication helpers ```html Login Signup Logout {% if request.user.is_authenticated %} Logged in as: {{ request.user.username }} {% endif %} ``` #### Authorization: LoginRequiredMixin and login_required ```python from django.contrib.auth.mixins import LoginRequiredMixin # Restrict views to auth user only (views.py) class PostsCreateView(LoginRequiredMixin, generic.CreateView): ... ... from django.contrib.auth.decorators import login_required @login_required(login_url='/login') def search_page(request): ... ... ``` #### Manual Authentication , Login and Logout ```python from django.contrib.auth import authenticate, login def login_page(request): if request.method == "POST": username = request.POST.get("username") password = request.POST.get("password") user = authenticate(request, username=username, password=password) if user is not None: login(request, user) return redirect("index") return render(request, "registration/login.html", {}) def logout_page(request): logout(request) return redirect("index") ``` #### User Change password ```python # set_password will hash the password user.set_password('raw password') ``` ## Create Custom Accounts Model ```python ~$ python manage.py startapp accounts ``` ```python # Add accounts app to settings.py INSTALLED_APPS = [ … , 'accounts.apps.AccountsConfig', ] . . . AUTH_USER_MODEL = 'accounts.User' ``` ```python # accounts/models.py from django.db import models from django.contrib.auth.models import BaseUserManager, AbstractBaseUser, PermissionsMixin class UserManager(BaseUserManager): def create_user(self, username, email, password=None, **extra_fields): if not username: raise ValueError('Users must have an username') if not email: raise ValueError('Users must have an email') user = self.model(email=email, **extra_fields) user.set_password(password) user.save(using=self._db) return user def create_superuser(self, username, email, password=None, **extra_fields): extra_fields.setdefault('is_staff', True) extra_fields.setdefault('is_superuser', True) extra_fields.setdefault('is_active', True) user = self.create_user(username, email, password=password, **extra_fields) user.save(using=self._db) return user class User(AbstractBaseUser, PermissionsMixin): username = models.CharField(verbose_name='Username', max_length=255, unique=True) email = models.EmailField(verbose_name='email', max_length=255, unique=True) phone = models.BigIntegerField(verbose_name='Phone Number', unique=True, blank=True, null=True) is_active = models.BooleanField(default=True, verbose_name="is_active") is_staff = models.BooleanField(default=False, verbose_name="is_staff") is_superuser = models.BooleanField(default=False, verbose_name="is_superuser") objects = UserManager() # We can use any field for username USERNAME_FIELD = 'username' # or 'email' or 'phone' REQUIRED_FIELDS = ['username', 'email'] def __str__(self): return self.username class Meta: verbose_name = "User" verbose_name_plural = "Users" ``` ```python # accounts/forms.py from django import forms from django.contrib.auth.forms import ReadOnlyPasswordHashField from django.core.exceptions import ValidationError from accounts.models import User from django.utils.translation import gettext_lazy as _ class UserCreationForm(forms.ModelForm): password1 = forms.CharField(label='Password', widget=forms.PasswordInput) password2 = forms.CharField(label='Password confirmation', widget=forms.PasswordInput) class Meta: model = User fields = ('username', 'email', 'phone', 'is_active', 'is_staff') def clean_password2(self): password1 = self.cleaned_data.get("password1") password2 = self.cleaned_data.get("password2") if password1 and password2 and password1 != password2: raise ValidationError("Passwords don't match") return password2 def save(self, commit=True): user = super().save(commit=False) user.set_password(self.cleaned_data["password1"]) if commit: user.save() return user class UserChangeForm(forms.ModelForm): password = ReadOnlyPasswordHashField() class Meta: model = User fields = ('username', 'email', 'phone', 'is_active', 'is_staff') def clean_password(self): return self.initial["password"] class LoginForm(forms.Form): email = forms.CharField( widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Email'}), label='Email') password = forms.CharField( widget=forms.PasswordInput(attrs={'class': 'form-control', 'placeholder': 'Password'}),label='Password') class RegisterForm(forms.ModelForm): password1 = forms.CharField(label='Password', widget=forms.PasswordInput( attrs={'class': 'form-control'})) password2 = forms.CharField(label='Password confirmation', widget=forms.PasswordInput(attrs={'class': 'form-control'})) class Meta: model = User fields = ('username', 'email', 'phone') widgets = { # Optional 'username': forms.TextInput(attrs={'class': 'form-control'}), 'email': forms.EmailInput(attrs={'class': 'form-control'}), 'phone': forms.NumberInput( attrs={'class': 'form-control', 'type': 'tel', 'maxlength': '11', 'minlength': '11', 'onkeypress': 'return isNumber(event)', 'required': 'false'})} def clean_password2(self): password1 = self.cleaned_data.get("password1") password2 = self.cleaned_data.get("password2") if password1 and password2 and password1 != password2: raise ValidationError("Passwords don't match") else: return password2 def save(self, commit=True): user = super().save(commit=False) user.set_password(self.cleaned_data["password1"]) if commit: user.save() return user class EditProfileForm(forms.ModelForm): class Meta: model = User fields = ('username', 'email', 'phone') class ChangePassword(forms.Form): password1 = forms.CharField(label=_('Password'), widget=forms.PasswordInput( attrs={'class': 'form-control', 'placeholder': 'Password'})) password2 = forms.CharField(label=_('Password confirmation'), widget=forms.PasswordInput( attrs={'class': 'form-control', 'placeholder': 'Re-Enter Password'})) def clean_password2(self): password1 = self.cleaned_data.get("password1") password2 = self.cleaned_data.get("password2") if password1 and password2 and password1 != password2: raise ValidationError("Passwords don't match") else: return password2 ``` ```python # accounts/admin.py from django import forms from django.contrib import admin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.contrib.auth.forms import ReadOnlyPasswordHashField from django.core.exceptions import ValidationError from django.contrib.auth.models import Group from accounts.models import User class UserCreationForm(forms.ModelForm): password1 = forms.CharField(label='Password', widget=forms.PasswordInput) password2 = forms.CharField(label='Password confirmation', widget=forms.PasswordInput) class Meta: model = User fields = ('username', 'email', 'phone') def clean_password2(self): # Check that the two password entries match password1 = self.cleaned_data.get("password1") password2 = self.cleaned_data.get("password2") if password1 and password2 and password1 != password2: raise ValidationError("Passwords don't match") return password2 def save(self, commit=True): user = super().save(commit=False) user.set_password(self.cleaned_data["password1"]) if commit: user.save() return user class UserChangeForm(forms.ModelForm): password = ReadOnlyPasswordHashField() class Meta: model = User fields = ('username', 'email', 'phone', 'password', 'is_active', 'is_staff') class UserAdmin(BaseUserAdmin): form = UserChangeForm add_form = UserCreationForm list_display = ('username', 'email', 'is_active', 'is_staff', 'is_superuser') list_editable = ('is_staff', 'is_active') list_filter = ('is_staff', 'groups') fieldsets = ( (None, {'fields': ( 'username', 'email', 'phone', 'password')}), ('Permissions', {'fields': ('is_staff',)}), ('Group Permissions', { 'fields': ('is_active', 'is_superuser', 'groups', 'user_permissions'), }) ) add_fieldsets = ( (None, { 'classes': ('wide',), 'fields': ('username', 'email', 'phone', 'password1', 'password2'), }), ('Group Permissions', { 'fields': ('is_active', 'is_superuser', 'groups', 'user_permissions'), }) ) search_fields = ('username', 'email', 'phone') ordering = ('username', 'email', 'phone') filter_horizontal = ('groups', 'user_permissions',) admin.site.register(User, UserAdmin) # unregister the Group model from admin. # admin.site.unregister(Group) ``` ```python # accounts/urls.py from django.urls import path from accounts import views app_name = 'accounts' urlpatterns = [ path('login/', views.userLogin, name='login'), path('register/', views.userRegister, name='register'), path('logout/', views.LogoutPage, name='logout') ] ``` ```python # accounts/views.py from django.shortcuts import render, redirect from django.contrib.auth import login, logout, authenticate from django.contrib.auth.decorators import login_required from django.utils.translation import gettext_lazy as _ from accounts.forms import LoginForm, RegisterForm from django.contrib import messages from accounts.models import User def userRegister(request): form = RegisterForm() if request.method == 'POST': form = RegisterForm(request.POST) if form.is_valid(): cd = form.cleaned_data if not User.objects.filter(email=cd['username']).exists(): if not User.objects.filter(email=cd['email']).exists(): user = User.objects.create_user( username=cd['username'], phone=cd['phone'], email=cd['email'], password=cd['password1']) user.save() login(request, user) messages.success(request, _("You successfully registered a user"), extra_tags="success") return redirect('app_name:home') else: messages.error(request, _("This Email is exists"), extra_tags="warning") else: messages.error(request, _("This Username is exists"), extra_tags="warning") else: import json er = json.loads(form.errors.as_json()) for e in er: messages.error(request, er[e][0]['message'], 'warning') return render(request, 'accounts/register.html', {'form': form}) def userLogin(request): if not request.user.is_active: if request.method == 'POST': form = LoginForm(request.POST) if form.is_valid(): cd = form.cleaned_data if User.objects.filter(username=cd['username']).exists(): user = authenticate(request, username=cd['username'], password=cd['password']) if user is not None: login(request, user) messages.success(request, _("logged in successfully"), extra_tags="success") return redirect('app_name:home') else: messages.error(request, _("your username Or Password is wrong"), extra_tags="warning") else: messages.error(request, _("No account created with this username"), extra_tags="warning") return redirect('accounts:login') else: messages.error(request, _("Please enter your information correctly"), extra_tags="warning") else: form = LoginForm() return render(request, 'accounts/login.html', {'form': form}) else: return redirect('app_name:home') @login_required() def LogoutPage(request): logout(request) messages.success(request, _("You Logged Out successfully"), extra_tags="success") return redirect('app_name:home') ``` ## Send Email ```python # settings.py EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" # Send email function from django.core.email import send_mail send_mail( subject = "A new post has been created", message = "Go to the web site to see the detail", from_email = "test@test.com", recipient_list = ["test2@text.com"] ) ``` ## Signals ```python # models.py from django.db.models.signals import post_save, pre_save def post_user_created_signal(sender, instance, created, **kwargs): if created: UserProfile.objects.create(user=instance) # Launch the post_user_created_signal method if User model is save post_save.connect(post_user_created_signal, sender=User) ``` ## Seed ```python from app_name.models import Product, Category from django.shortcuts import HttpResponse from faker import Faker def seed(request): Product.objects.all().delete() Category.objects.all().delete() category = Category() category.name = "Sports" category.save() category = Category() category.name = "Home" category.save() fake = Faker() for _ in range(100): product = Product() product.name = fake.unique.word() product.short_description = fake.sentence() product.main_picture = fake.image_url() product.price = fake.random_digit() * 10 product.category = Category.objects.order_by('?').first() product.save() return HttpResponse('Seeded') ``` ## Environment Variables ### .env key/value file ```python $ pip install python-decouple ``` Create a file name '.env' in the root folder of your project ```python SECRET_KEY = 'your secret key' ALLOWED_HOST = 127.0.0.1 ``` In settings.py change security related settings to point to the .env file ```python from decouple import config SECRET_KEY = config('SECRET_KEY') ALLOWED_HOST = config('ALLOWED_HOST') ``` ## Asynchronous Tasks ### Django Celery Redis Celery is a distributed task queue that can collect, record, schedule, and perform tasks outside of your main program. #### Step 1: Install Celery Using pip ```python ~$ pip install celery # pip install celery[redis] ``` #### Step 2. Add celery.py File in Your Project Module ```python # your_project/celery.py import os from celery import Celery os.environ.setdefault('DJANGO_SETTINGS_MODULE','your_project_name.settings') app = Celery('your_project_name') app.config_from_object('django.conf:settings', namespace='CELERY') app.autodiscover_tasks() @app.task(bind=True) def debug_task(self): print(f'Request: {self.request!r}') ``` #### Step 3: Import the Celery App to Django To ensure that the Celery app is loaded when Django starts, add the following code into the `__init__.py` file that sits on the project module beside on settings.py file. ```python # your_project/__init__.py from .celery import app as celery_app __all__ = ('celery_app',) ``` #### Step 4: Download and Run Redis as a Celery ‘broker’ ```python ~$ redis-server ``` You can test that Redis is working properly by typing this into your terminal: ```python ~$ redis-cli ping ``` Redis should reply with PONG - try it! #### Step 5: Add Redis as a Dependency in the Django Project: ```python ~$ pip install redis ``` #### Step 6: Celery Stuff Configure to the Django Settings File Once Redis is up, add the following code to your settings.py file and use celery-result ```python ~$ pip install django-celery-results ``` This extension enables you to store Celery task results using the Django ORM.Welcome, <%= username %>!
<% } else { %>Please log in.
<% } %> ``` ### Using loops ```htmlMy page
<%- include('footer'); -%> ``` ## Client-side support {.cols-2} ### Example ```html ``` ### Caveats ```js let str = "Hello <%= include('file', {person: 'John'}); %>", fn = ejs.compile(str, { client: true }); // include callback fn(data, null, function (path, d) { // path -> 'file' // d -> {person: 'John'} // Put your code here // Return the contents of file as a string }); // returns rendered string ``` ## Options {.cols-1} ### Options list | Option | Description | | ------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | cache | Compiled functions are cached, requires filename | | filename | Used by cache to key caches, and for includes | | root | Set project root for includes with an absolute path (e.g. `/file.ejs`). Can be an array to try to resolve include from multiple directories. | | views | An array of paths to use when resolving includes with relative paths. | | context | Function execution context | | compileDebug | When false, no debug instrumentation is compiled | | client | Returns standalone compiled function | | delimiter | Character to use for inner delimiter, by default `%` | | openDelimiter | Character to use for opening delimiter, by default `<` | | closeDelimiter | Character to use for closing delimiter, by default `>` | | debug | Outputs generated function body | | strict | When set to `true`, generated function is in strict mode | | \_with | Whether or not to use with() {} constructs. If `false`, then the locals will be stored in the locals object. (Implies `--strict`) | | localsName | Name to use for the object storing local variables when not using with defaults to `locals` | | rmWhitespace | Remove all safe-to-remove whitespace, including leading and trailing whitespace. It also enables a safer version of `-%> `line slurping for all scriptlet tags (it does not strip new lines of tags in the middle of a line). | | escape | The escaping function used with `<%=` construct. It is used in rendering and is `.toString()`ed in the generation of client functions. (By default escapes XML). | | outputFunctionName | Set to a string (e.g., 'echo' or 'print') for a function to print output inside scriptlet tags. | | async | When true, EJS will use an async function for rendering. (Depends on async/await support in the JS runtime. | ## Tags {.cols-1} ### Tags list | Tag | Description | | ----------------- | :------------------------------------------------------------------- | | `<%` | 'Scriptlet' tag, for control-flow, no output | |<%\_ | 'Whitespace Slurping' Scriptlet tag, strips all whitespace before it |
| `<%=` | Outputs the value into the template (HTML escaped) |
| `<%-` | Outputs the unescaped value into the template |
| `<%#` | Comment tag, no execution, no output |
| `<%%` | Outputs a literal `<%` |
| `%>` | Plain ending tag |
| `-%>` | Trim-mode ('newline slurp') tag, trims following newline |
| \_%> | 'Whitespace Slurping' ending tag, removes all whitespace after it |
## CLI {.cols-1}
### CLI list
| Option | Description |
| ------------------------------------ | :------------------------------------------------------------------------------------------ |
| `cache` | Compiled functions are cached, requires filename |
| `-o` / `--output-file FILE` | Write the rendered output to FILE rather than stdout. |
| `-f` / `--data-file FILE` | Must be JSON-formatted. Use parsed input from FILE as data for rendering. |
| `-i` / `--data-input STRING` | Must be JSON-formatted and URI-encoded. Use parsed input from STRING as data for rendering. |
| `-m` / `--delimiter CHARACTER` | Use CHARACTER with angle brackets for open/close (defaults to %). |
| `-p` / `--open-delimiter CHARACTER` | Use CHARACTER instead of left angle bracket to open. |
| `-c` / `--close-delimiter CHARACTER` | Use CHARACTER instead of right angle bracket to close. |
| `-s` / `--strict` | When set to `true`, generated function is in strict mode |
| `-n` / `--no-with` | Use `locals` object for vars rather than using `with` (implies --strict). |
| `-l` / `--locals-name` | Name to use for the object storing local variables when not using `with`. |
| `-w` / `--rm-whitespace` | Remove all safe-to-remove whitespace, including leading and trailing whitespace. |
| `-d` / `--debug` | Outputs generated function body |
| `-h` / `--help` | Display this help message. |
| `-V` / `-v` / `--version` | Display the EJS version. |
Examples of use :
```shell
$ ejs -p [ -c ] ./template_file.ejs -o ./output.html
$ ejs ./test/fixtures/user.ejs name=Lerxst
$ ejs -n -l _ ./some_template.ejs -f ./data_file.json
```
================================================
FILE: source/_posts/emacs.md
================================================
---
title: Emacs
date: 2020-12-17 16:21:49
background: bg-[#7752a9]
tags:
- editor
- text
- shortcut
categories:
- Toolkit
intro: |
[Emacs](https://www.gnu.org/software/emacs) is the extensible, customizable, self-documenting real time display text editor.
This reference was made for Emacs 27.
plugins:
- copyCode
---
## Getting started
### Starting Emacs
To enter Emacs, just type its name:
```shell
$ emacs
```
---
| - | - |
| ----------- | :--------------------- |
| `C-z` | Suspend Emacs |
| `C-x` `C-c` | Exit Emacs permanently |
{.shortcuts}
### Global Description {.secondary}
| - | - |
| --------- | :------------------------------------------ |
| `C-ul>li\*5
```html
Click here to continue
``` ### ID and CLASS attributes {.row-span-2} `#header` ```html ``` `.title` ```html ``` `form#search.wide` ```html ``` `p.class1.class2.class3` ```html ``` ### Implicit tag names {.row-span-2} `.class` ```html ``` `em>.class` ```html ``` `ul>.class` ```html
div>(header>ul>li\*2>a)+footer>p
```html
```
(div>dl>(dt+dd)\*4)+footer>p
```html
ul>li.item$\*3
```html
h$[title=item$]{Header $}\*3
```html
ul>li.item$$$\*3
```html
ul>li.item$@-\*3
```html
ul>li.item$@2\*3
```html
Hi!
{% endif %} ``` ### Static Files ```html ``` ## Sessions & Cookies {.cols-2} ### Using Sessions ```python from flask import session app.secret_key = "secret" @app.route("/login") def login(): session["user"] = "admin" return "Logged in" ``` ### Access Cookies ```python from flask import request, make_response @app.route("/cookie") def cookie(): resp = make_response("Set cookie") resp.set_cookie("site", "Flask") return resp ``` ## JSON API & Middleware {.cols-2} ### JSON Response ```python from flask import jsonify @app.route("/api") def api(): return jsonify(message="Hello") ``` ### Middleware ```python @app.before_request def before(): print("Before") @app.after_request def after(res): print("After") return res ``` ## Error Handling & Blueprints {.cols-2} ### Error Handling ```python @app.errorhandler(404) def not_found(e): return "Page not found", 404 ``` ### Blueprint ```python from flask import Blueprint admin = Blueprint("admin", __name__, url_prefix="/admin") @admin.route("/") def dash(): return "Admin" app.register_blueprint(admin) ``` ## Project Structure {.cols-2} ### File Structure ```bash project/ ├── app.py ├── templates/ │ └── index.html ├── static/ │ └── style.css └── config.py ``` ### Run Server ```bash python app.py # or using CLI export FLASK_APP=app.py flask run ``` ================================================ FILE: source/_posts/fortnite.md ================================================ --- title: Fortnite date: 2022-11-23 16:23:31.699229 background: bg-[#8d2fc9] label: tags: - - categories: - Keyboard Shortcuts intro: | A visual cheat-sheet for the 26 default keyboard shortcuts found in Fortnite --- ## Keyboard Shortcuts ### Main Controls | Shortcut | Action | | ------------ | ----------------------------------------- | | `R` | Reload | | `Q` | Switch between combat mode and build mode | | `Space` | Jump | | `Left Ctrl` | Crouch | | `Left Shift` | Sprint | | `=` | Auto run | | `W` | Move forward | | `S` | Move backwards | | `A` | Move left | | `D` | Move right | | `M` | Toggle map | | `Tab` | Toggle inventory | | `E` | Use or interact with object | | `F` | Select pickaxe | | `1-5` | Select weapon slot 1-5 | {.shortcuts} ### Building | Shortcut | Action | | -------- | ------------------------------------------------------- | | `R` | Rotate building piece | | `Z` | Wall mode | | `X` | Floor mode | | `C` | Stair mode | | `V` | Pyramid mode | | `Y` | Trap mode | | `F3` | Select trap | | `H` | Upgrade building piece of repair damaged building piece | | `G` | Edit building piece | {.shortcuts} ### Communication | Shortcut | Action | | -------- | ------ | | `Enter` | Chat | | `B` | Emote | {.shortcuts} ## Also see - [Keyboard shortcuts for Fortnite](https://fortnite.gamepedia.com/Controls) _(fortnite.gamepedia.com)_ ================================================ FILE: source/_posts/framer-x.md ================================================ --- title: Framer X date: 2022-11-23 16:23:31.701096 background: bg-[#2151ed] label: Mac tags: - - mac categories: - Keyboard Shortcuts intro: | A visual cheat-sheet for the 45 keyboard shortcuts found in Framer X. This application is MacOS-only. --- ## Keyboard Shortcuts ### Tools | Shortcut | Action | | -------- | ---------- | | `F` | Frame | | `U` | Round | | `T` | Text | | `S` | Stack | | `L` | Link | | `Space` | Pan Canvas | {.shortcuts} ### Graphics | Shortcut | Action | | ----------------- | --------- | | `G` | Graphic | | `P` | Path | | `R` | Rectangle | | `O` | Oval | | `V` | Vector | | `Cmd` `G` | Group | | `Cmd` `Shift` `G` | Ungroup | {.shortcuts} ### Layout | Shortcut | Action | | ------------------- | -------------- | | `Cmd` `Enter` | Add Frame | | `Cmd` `Opt` `Enter` | Add Stack | | `Cmd` `Del` | Remove Wrapper | | `Cmd` `Opt` `Up` | Move Forward | | `Cmd` `Opt` `Down` | Move Backward | {.shortcuts} ### Components | Shortcut | Action | | ----------------- | ------------------ | | `Cmd` `K` | Create from Design | | `Cmd` `Shift` `K` | Create from Code | {.shortcuts} ### Text | Shortcut | Action | | --------- | --------------- | | `Cmd` `B` | Bold | | `Cmd` `I` | Italic | | `Cmd` `U` | Underline | | `Cmd` `T` | Select Typeface | {.shortcuts} ### Editing | Shortcut | Action | | ------------------------ | ------------------- | | `Cmd` `(arrows)` | Object Size | | `Cmd` `Shift` `(arrows)` | Object Size by 10px | | `0-9` | Opacity | | `Opt` | Show Distance | | `Cmd` `D` | Duplicate in Place | | `Cmd` `Opt` `C` | Copy Style | | `Cmd` `Opt` `V` | Paste Style | | `Ctrl` `C` | Color Picker | | `Cmd` `A` | Select All Layers | | `Cmd` `Shift` `A` | Select All Siblings | | `Cmd` `Opt` `A` | Select All Children | {.shortcuts} ### View | Shortcut | Action | | ---------- | --------------------- | | `Z` | Zoom | | `Cmd` `+` | Zoom In | | `Cmd` `-` | Zoom Out | | `Cmd` `1` | Zoom to Fit | | `Cmd` `2` | Zoom to Fit Selection | | `Cmd` `0` | Zoom to 100% | | `Ctrl` `R` | Show Rulers | {.shortcuts} ### Window | Shortcut | Action | | ----------------- | -------- | | `Cmd` `M` | Minimize | | `Cmd` `Shift` `1` | Welcome | | `Cmd` `P` | Preview | {.shortcuts} ## Also see - [Keyboard shortcuts for Framer X](https://www.framer.com/support/using-framer-x/shortcuts/) _(www.framer.com)_ ================================================ FILE: source/_posts/gimp.md ================================================ --- title: GIMP date: 2022-11-23 16:23:31.696743 background: bg-[#554f42] label: tags: - - categories: - Keyboard Shortcuts intro: | A visual cheat-sheet for the 97 keyboard shortcuts found in GIMP --- ## Keyboard Shortcuts ### Toolbox {.row-span-2} | Shortcut | Action | | ----------- | ---------------- | | `R` | Rectangle select | | `E` | Ellipse select | | `F` | Free select | | `U` | Fuzzy select | | `Shift` `O` | Select by color | | `I` | Scissors | | `B` | Paths | | `O` | Color picker | | `M` | Move | | `Shift` `C` | Crop and resize | | `Shift` `R` | Rotate | | `Shift` `T` | Scale | | `Shift` `S` | Shear | | `Shift` `P` | Perspective | | `Shift` `F` | Flip | | `T` | Text | | `Shift` `B` | Bucket fill | | `L` | Blend | | `N` | Pencil | | `P` | Paintbrush | | `Shift` `E` | Eraser | | `A` | Airbrush | | `K` | Ink | | `C` | Clone | | `V` | Convolve | | `S` | Smudge | | `Shift` `D` | Dodge or burn | | `X` | Swap colors | | `D` | Default colors | {.shortcuts} ### File | Shortcut | Action | | ---------------- | --------------------------- | | `Ctrl` `N` | New image | | `Ctrl` `O` | Open image | | `Ctrl` `Alt` `N` | Open image as new layer | | `Ctrl` `D` | Duplicate image | | `Ctrl` `1-0` | Open recent image 1-10 | | `Ctrl` `S` | Save image | | `Ctrl` `S` | Save image under a new name | | `Ctrl` `Q` | Quit | {.shortcuts} ### Dialogs | Shortcut | Action | | ------------------- | ----------------------------------- | | `Ctrl` `L` | Layers | | `Ctrl` `Shift` `B` | Brushes | | `Ctrl` `Shift` `P` | Patterns | | `Ctrl` `G` | Gradients | | `Ctrl` `Shift` `T` | Tool options | | `Ctrl` `P` | Palettes | | `Ctrl` `Shift` `I` | Info window | | `Ctrl` `Shift` `N` | Navigation window | | `Tab` | Jump to next widget | | `Shift` `Tab` | Jump to previous widget | | `Enter` | Set the new value | | `Space` | Activate the current button or list | | `Ctrl` `Alt` `PgUp` | In a multi-tab dialog, switch tabs | | `Shift` `L` | Open location | | `Alt` `Up` | Up folder | | `Alt` `Down` | Down folder | | `Alt` `Home` | Home folder | | `Esc` | Close dialog | {.shortcuts} ### View | Shortcut | Action | | ------------------ | --------------------- | | `F10` | Main menu | | `Shift` `F10` | Drop-down menu | | `F11` | Toggle fullscreen | | `Shift` `Q` | Toggle quickmask | | `Ctrl` `W` | Close document window | | `+` | Zoom in | | `-` | Zoom out | | `1` | Zoom 1:1 | | `Ctrl` `E` | Shrink wrap | | `Ctrl` `Shift` `E` | Fit image in window | | `Ctrl` `Shift` `R` | Toggle rulers | | `Ctrl` `Shift` `T` | Toggle guides | {.shortcuts} ### Layers | Shortcut | Action | | ---------- | ---------------------- | | `PgUp` | Select the layer above | | `PgDn` | Select the layer below | | `Home` | Select the first layer | | `End` | Select the last layer | | `Ctrl` `M` | Merge visible layers | | `Ctrl` `H` | Anchor layer | {.shortcuts} ### Edit {.row-span-2} | Shortcut | Action | | ------------------ | -------------------------- | | `Ctrl` `Z` | Undo | | `Ctrl` `Y` | Redo | | `Ctrl` `C` | Copy selection | | `Ctrl` `X` | Cut selection | | `Ctrl` `Shift` `C` | Copy visible | | `Ctrl` `Shift` `V` | Paste as new image | | `Ctrl` `V` | Paste clipboard | | `Ctrl` `K` | Clears selection | | `Ctrl` `Shift` `C` | Named copy selection | | `Ctrl` `Shift` `X` | Named cut selection | | `Ctrl` `Shift` `V` | Named paste clipboard | | `Ctrl` `,` | Fill with foreground color | | `Ctrl` `.` | Fill with background color | | `Ctrl` `;` | Fill with pattern | {.shortcuts} ### Selections | Shortcut | Action | | ------------------ | ----------------- | | `Ctrl` `T` | Toggle selections | | `Ctrl` `A` | Select all | | `Ctrl` `Shift` `A` | Select none | | `Ctrl` `I` | Invert selection | | `Ctrl` `Shift` `L` | Float selection | | `Shift` `V` | Path to selection | {.shortcuts} ### Plug-Ins | Shortcut | Action | | ------------------ | ------------------- | | `Ctrl` `F` | Repeat last plug-in | | `Ctrl` `Shift` `F` | Reshow last plug-in | {.shortcuts} ### Help | Shortcut | Action | | ------------ | ------------ | | `F1` | Help | | `Shift` `F1` | Context help | {.shortcuts} ## Also see - [Keyboard shortcuts for GIMP](https://www.gimpusers.com/gimp/hotkeys) _(www.gimpusers.com)_ ================================================ FILE: source/_posts/git.md ================================================ --- title: Git date: 2020-11-25 18:28:43 background: bg-[#d7593e] tags: - github - gitlab - version - VCS categories: - Linux Command intro: This cheat sheet summarizes commonly used Git command line instructions for quick reference. plugins: - copyCode --- ## Getting Started ### Create a Repository Create a new local repository ```shell script $ git init [project name] ``` Clone a repository ```shell script $ git clone git_url ``` Clone a repository into a specified directory ```shell script $ git clone git_url my_directory ``` ### Make a change {.row-span-2} Show modified files in working directory, staged for your next commit ```shell script $ git status ``` Stages the file, ready for commit ```shell script $ git add [file] ``` Stage all changed files, ready for commit ```shell script $ git add . ``` Commit all staged files to version history ```shell script $ git commit -m "commit message" ``` Commit all your tracked files to version history ```shell script $ git commit -am "commit message" ``` Discard changes in working directory which is not staged ```shell script $ git restore [file] ``` Unstage a staged file or file which is staged ```shell script $ git restore --staged [file] ``` Unstage a file, keeping the file changes ```shell script $ git reset [file] ``` Revert everything to the last commit ```shell script $ git reset --hard ``` Diff of what is changed but not staged ```shell script $ git diff ``` Diff of what is staged but not yet committed ```shell script $ git diff --staged ``` Apply any commits of current branch ahead of specified one ```shell script $ git rebase [branch] ``` ### Configuration Set the name that will be attached to your commits and tags ```shell script $ git config --global user.name "name" ``` Set an email address that will be attached to your commits and tags ```shell script $ git config --global user.email "email" ``` Enable some colorization of Git output ```shell script $ git config --global color.ui auto ``` Edit the global configuration file in a text editor ```shell script $ git config --global --edit ``` ### Working with Branches List all local branches ```shell script $ git branch ``` List all branches, local and remote ```shell script $ git branch -av ``` Switch to my_branch, and update working directory ```shell script $ git checkout my_branch ``` Create a new branch called new_branch ```shell script $ git checkout -b new_branch ``` Delete the branch called my_branch ```shell script $ git branch -d my_branch ``` Merge branchA into branchB ```shell script $ git checkout branchB $ git merge branchA ``` Tag the current commit ```shell script $ git tag my_tag ``` ### Observe your Repository Show the commit history for the currently active branch ```shell script $ git log ``` Show the commits on branchA that are not on branchB ```shell script $ git log branchB..branchA ``` Show the commits that changed file, even across renames ```shell script $ git log --follow [file] ``` Show the diff of what is in branchA that is not in branchB ```shell script $ git diff branchB...branchA ``` Show any object in Git in human-readable format ```shell script $ git show [SHA] ``` ### Synchronize Fetch down all the branches from that Git remote ```shell script $ git fetch [alias] ``` Merge a remote branch into your current branch to bring it up to date ```shell script $ git merge [alias]/[branch] # No fast-forward $ git merge --no-ff [alias]/[branch] # Only fast-forward $ git merge --ff-only [alias]/[branch] ``` Transmit local branch commits to the remote repository branch ```shell script $ git push [alias] [branch] ``` Fetch and merge any commits from the tracking remote branch ```shell script $ git pull ``` Merge just one specific commit from another branch to your current branch ```shell script $ git cherry-pick [commit_id] ``` ### Remote Add a git URL as an alias ```shell script $ git remote add [alias] [url] ``` Show the names of the remote repositories you've set up ```shell script $ git remote ``` Show the names and URLs of the remote repositories ```shell script $ git remote -v ``` Remove a remote repository ```shell script $ git remote rm [remote repo name] ``` Change the URL of the git repo ```shell script $ git remote set-url origin [git_url] ``` ### Temporary Commits Save modified and staged changes ```shell script $ git stash ``` List stack-order of stashed file changes ```shell script $ git stash list ``` Write working from top of stash stack ```shell script $ git stash pop ``` Discard the changes from top of stash stack ```shell script $ git stash drop ``` ### Tracking path Changes Delete the file from project and stage the removal for commit ```shell script $ git rm [file] ``` Change an existing file path and stage the move ```shell script $ git mv [existing-path] [new-path] ``` Show all commit logs with indication of any paths that moved ```shell script $ git log --stat -M ``` ### Ignoring Files ``` /logs/* # "!" means don't ignore !logs/.gitkeep /# Ignore Mac system files .DS_store # Ignore node_modules folder node_modules # Ignore SASS config files .sass-cache ``` A `.gitignore` file specifies intentionally untracked files that Git should ignore ## Git Tricks ### Rename branch - #### **Renamed** to `new_name` ```shell script $ git branch -m\` | Go to next inbox section |
| `Shift` \` | Go to previous inbox section |
{.shortcuts}
### Application
| Shortcut | Action |
| -------- | --------------------------- |
| `C` | Compose |
| `D` | Compose in a new tab |
| `/` | Search mail |
| `G` | Search chat contacts |
| `.` | Open more actions menu |
| `V` | Open move to menu |
| `L` | Open label as menu |
| `?` | Open keyboard shortcut help |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Gmail](https://support.google.com/mail/answer/6594?hl=en) _(support.google.com)_
================================================
FILE: source/_posts/gnome-desktop.md
================================================
---
title: Gnome Desktop
date: 2024-06-05 16:23:31.705009
background: bg-[#5885c9]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for Gnome Desktop
---
## Keyboard Shortcuts
### Actions
| Shortcut | Action |
| ------------- | ------------------- |
| `Alt+Super+8` | Turn zoom on or off |
| `Alt+Super+=` | Zoom in |
| `Alt+Super+-` | Zoom out |
{.shortcuts}
### Launchers
| Shortcut | Action |
| ------------ | ------------------- |
| `Super+F1` | Launch Help Browser |
| `Ctrl+Alt+T` | Launch Terminal |
{.shortcuts}
### Screenshots
| Shortcut | Action |
| ------------------ | --------------------------------- |
| `Shift+Ctrl+Alt+R` | Record a screencast interactively |
| `Shift+Print` | Take a screenshot |
| `Print` | Take a screenshot interactively |
| `Alt+Print` | Take a screenshot of a window |
{.shortcuts}
### System
| Shortcut | Action |
| -------------- | ------------------------------ |
| `Super+N` | Focus the active notification |
| `Super+L` | Lock screen |
| `Ctrl+Alt+Del` | Log out |
| `Super+F10` | Open the application menu |
| `Super+Escape` | Restore the keyboard shortcuts |
| `Super+A` | Show all applications |
| `Super+V` | Show the notification list |
| `Super+S` | Show the overview |
| `Alt+F2` | Show the run command prompt |
{.shortcuts}
### Typing
| Shortcut | Action |
| ------------------- | ------------------------------- |
| `Super+space` | Switch to next typing source |
| `Shift+Super+Space` | Switch to previous input source |
{.shortcuts}
### Windows
| Shortcut | Action |
| ------------- | ------------------------- |
| `Alt+Space` | Activate the window menu |
| `Alt+F1` | Close the window |
| `Super+H` | Hide window |
| `Super+Up` | Maximize window |
| `Alt+F7` | Move window |
| `Alt+F8` | Resize Window |
| `Super+Down` | Restore window |
| `Alt+F10` | Toggle maximization state |
| `Super+Left` | View split on left |
| `Super+Right` | View split on right |
{.shortcuts}
### Navigation
| Shortcut | Action |
| ----------------------- | -------------------------------------- |
| `Ctrl+Super+D` | Hide all normal windows |
| `Super+Page Up` | Move to workspace on the left |
| `Super+Page Down` | Move to workspace on the right |
| `Shift+Super+Down` | Move window one monitor down |
| `Shift+Super+Left` | Move window one monitor to the left |
| `Shift+Super+Right` | Move window one monitor to the right |
| `Shift+Super+Up` | Move window one monitor up |
| `Shift+Super+Page Up` | Move window one workspace to the left |
| `Shift+Super+Page Down` | Move window one workspace to the right |
| `Shift+Super+End` | Move window to last workspace |
| `Shift+Super+Home` | Move window to workspace 1 |
| `Super+Tab` | Switch applications |
| `Ctrl+Alt+Tab` | Switch system controls |
| `Ctrl+Alt+Escape` | Switch system controls directly |
| `Super+End` | Switch to last workspace |
| `Super+Home` | Switch to workspace 1 |
| `Alt+Tab` | Switch windows |
| `Alt+Escape` | Switch windows directly |
| `Alt+F6` | Switch windows of an app directly |
| `Super+` | Switch windows of an application |
{.shortcuts}
## Also see
- [Gnome Shell Cheatsheet](https://wiki.gnome.org/Projects/GnomeShell/CheatSheet) _(www.gnome.org)_
================================================
FILE: source/_posts/gnupg.md
================================================
---
title: GnuPG
categories:
- Linux Command
intro: A cheatsheet for GnuPG, the encryption and signing software.
---
## Getting Started
### Software
Gpg4win and the GPG Suite have OS-specific features.
- [GnuPG](https://gnupg.org/)
- [Gpg4win](https://www.gpg4win.org/) (Windows)
- [GPG Suite](https://gpgtools.org/) (macOS)
Sometimes GPG keys are referred as PGP keys. They're interchangeable, as they follow the
[OpenPGP Standard](https://www.rfc-editor.org/rfc/rfc9580.html).
### Create a key-pair
Generate your keys:
```shell script
$ gpg --generate-key
```
... or fully configure your keys.
```shell script
$ gpg --generate-full-keys
```
**Note:** Choose a strong passphrase! The encryption is only as strong as your passphrase.
### Key management
List your keys:
```shell script
$ gpg --list-keys
```
List your secret keys:
```shell script
$ gpg --list-secret-keys
```
Export your public key:
```shell script
$ gpg --export --armor \| | `-=` | \|= | \|\| | `<` | `<=` | `[` | `]` |
| \* | `^` | \*= | `^=` | `<-` | `>` | `>=` | `{` | `}` |
| `/` | `<<` | `/=` | `<<=` | `++` | `=` | `:=` | `,` | `;` |
| `%` | `>>` | `%=` | `>>=` | `--` | `!` | `...` | `.` | `:` |
| | `&^` | `&^=` | | | | | | |
## Also see {.cols-1}
- [Devhints](https://devhints.io/go) _(devhints.io)_
- [A tour of Go](https://tour.go.dev/welcome/1) _(tour.go.dev)_
- [Go wiki](https://github.com/golang/go/wiki/) _(github.com)_
- [Effective Go](https://go.dev/doc/effective_go) _(go.dev)_
- [Go by Example](https://gobyexample.com/) _(gobyexample.com)_
- [Awesome Go](https://awesome-go.com/) _(awesome-go.com)_
- [JustForFunc Youtube](https://www.youtube.com/channel/UC_BzFbxG2za3bp5NRRRXJSw) _(youtube.com)_
- [Style Guide](https://github.com/golang/go/wiki/CodeReviewComments) _(github.com)_
================================================
FILE: source/_posts/google-chrome.md
================================================
---
title: Google Chrome
date: 2022-11-23 16:23:31.696190
background: bg-[#ca4732]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 65 keyboard shortcuts found in Google Chrome
---
## Keyboard Shortcuts {.cols-2}
### Tab and window
| Shortcut | Action |
| -------------------- | ----------------------------------------------------------- |
| `Ctrl` `N` | Open a new window |
| `Ctrl` `Shift` `N` | Open a new window in Incognito mode |
| `Ctrl` `T` | Open a new tab, and jump to it |
| `Ctrl` `Shift` `T` | Reopen the last closed tab, and jump to it |
| `Ctrl` `Tab` | Jump to the next open tab |
| `Ctrl` `Shift` `Tab` | Jump to the previous open tab |
| `Ctrl` `1-8` | Jump to a specific tab |
| `Ctrl` `9` | Jump to the last tab |
| `Alt` `Home` | Open your home page in the current tab |
| `Alt` `Left` | Open the previous page from your history in the current tab |
| `Alt` `Right` | Open the next page from your history in the current tab |
| `Ctrl` `W` | Close the current tab |
| `Ctrl` `Shift` `W` | Close the current window |
| `Alt` `Space` `N` | Minimize the current window |
| `Alt` `Space` `X` | Maximize the current window |
| `Alt` `F4` | Close the current window |
| `Ctrl` `Shift` `Q` | Quite Google Chrome |
{.shortcuts}
### Google Chrome features
| Shortcut | Action |
| ----------------------- | -------------------------------------------------- |
| `Alt` `F` | Open the Chrome menu |
| `Ctrl` `Shift` `B` | Show or hide the Bookmarks bar |
| `Ctrl` `Shift` `O` | Open the Bookmarks manager |
| `Ctrl` `H` | Open the History page in a new tab |
| `Ctrl` `J` | Open the Downloads page in a new tab |
| `Shift` `Esc` | Open the Chrome Task Manager |
| `Shift` `Alt` `T` | Set focus on the first item in the Chrome toolbar |
| `F10` | Set focus on the last item in the Chrome toolbar |
| `F6` | Switch focus to unfocused dialog (if showing) |
| `Ctrl` `F` | Open the Find Bar to search the current page |
| `Ctrl` `G` | Jump to the next match to your Find Bar search |
| `Ctrl` `Shift` `G` | Jump to the previous match to your Find Bar search |
| `F12` | Open Developer Tools |
| `Ctrl` `Shift` `Delete` | Open the Clear Browsing Data options |
| `F1` | Open the Chrome Help Center in a new tab |
| `Ctrl` `Shift` `M` | Log in a different user or browse as a Guest |
| `Alt` `Shift` `I` | Open a feedback form |
{.shortcuts}
### Address bar
| Shortcut | Action |
| ---------------- | ------------------------------------------------------------- |
| `(type)` `Enter` | Search with your default search engine |
| `(type)` `Tab` | Search using a different search engine |
| `Ctrl` `Enter` | Add www. and .com to a site name, and open in the current tab |
| `Alt` `Enter` | Open a new tab and perform a Google search |
| `Ctrl` `L` | Jump to the address bar |
| `Ctrl` `K` | Search from anywhere on the page |
| `Shift` `Delete` | Remove predictions from your address bar |
{.shortcuts}
### Webpage shortcuts
| Shortcut | Action |
| ------------------------ | ------------------------------------------------------------------ |
| `Ctrl` `P` | Open options to print the current page |
| `Ctrl` `S` | Open options to save the current page |
| `Ctrl` `R` | Reload the current page |
| `Ctrl` `Shift` `R` | Reload the current page, ignoring cached content |
| `Esc` | Stop the page loading |
| `Tab` | Browse clickable items moving forward |
| `Shift` `Tab` | Browse clickable items moving backward |
| `Ctrl` `O` | Open a file from your computer in Chrome |
| `Ctrl` `U` | Display non-editable HTML source code for the current page |
| `Ctrl` `D` | Save your current webpage as a bookmark |
| `Ctrl` `Shift` `D` | Save all open tabs as bookmarks in a new folder |
| `F11` | Turn full-screen mode on or off |
| `Ctrl` `+` | Make everything on the page bigger |
| `Ctrl` `-` | Make everything on the page smaller |
| `Ctrl` `0` | Return everything on the page to default size |
| `Space` | Scroll down a webpage, a screen at a time |
| `Shift` `Space` | Scroll up a webpage, a screen at a time |
| `Home` | Go to the top of the page |
| `End` | Go to the bottom of the page |
| `Shift` `(scroll mouse)` | Scroll horizontally on the page |
| `Ctrl` `Left` | Move your cursor to the front of the previous word in a text field |
| `Ctrl` `Right` | Move your cursor to the back of the next word in a text field |
| `Ctrl` `Backspace` | Delete the previous word in a text field |
| `Alt` `Home` | Open the Home page in the current tab |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Google Chrome](https://support.google.com/chrome/answer/157179?hl=en) _(support.google.com)_
================================================
FILE: source/_posts/google-drive.md
================================================
---
title: Google Drive
date: 2022-11-23 16:23:31.701360
background: bg-[#479b61]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 54 keyboard shortcuts found in Google Drive on the web
---
## Keyboard Shortcuts
### Navigation and views
| Shortcut | Action |
| -------- | ------------------------------------------ |
| `G` `N` | Go to navigation panel (folders list) |
| `G` `L` | Go to items view |
| `V` | Switch between grid and list in items view |
| `G` `D` | Go to details pane |
| `G` `T` | Go to top of application (Google bar) |
| `G` `A` | Go to download status |
| `G` `U` | Go to upload status |
| `D` | Show or hide details pane |
| `I` | Show or hide activity pane |
{.shortcuts}
### Select items
| Shortcut | Action |
| --------------- | ----------------------------- |
| `X` | Select or deselect item |
| `J/Down` | Select next item down |
| `K/Up` | Select next item up |
| `H/Left` | Select next item to the left |
| `L/Right` | Select next item to the right |
| `Shift` `Down` | Extend selection down |
| `Shift` `Up` | Extend selection up |
| `Shift` `Left` | Extend selection left |
| `Shift` `Right` | Extend selection right |
| `Shift` `A` | Select all visible items |
| `Shift` `N` | Clear all selections |
{.shortcuts}
### Move between items
| Shortcut | Action |
| -------------- | ------------------------------------- |
| `Ctrl` `Down` | Move down without changing selection |
| `Ctrl` `Up` | Move up without changing selection |
| `Ctrl` `Left` | Move left without changing selection |
| `Ctrl` `Right` | Move right without changing selection |
{.shortcuts}
### Take action on selected items
| Shortcut | Action |
| ------------------ | ------------------------------------------ |
| `Enter` | Open selected item |
| `N` | Rename selected item |
| `.` | Share selected items |
| `Z` | Move selected items to new folder |
| `S` | Star or unstar selected items |
| `Shift` `Z` | Add selected items to an additional folder |
| `Delete` | Remove selected items |
| `Ctrl` `Z` | Undo last action |
| `Ctrl` `Shift` `Z` | Redo last undone action |
{.shortcuts}
### Create new items
| Shortcut | Action |
| ----------- | ------------ |
| `Shift` `T` | Document |
| `Shift` `P` | Presentation |
| `Shift` `S` | Spreadsheet |
| `Shift` `D` | Drawing |
| `Shift` `F` | Folder |
| `Shift` `O` | Form |
{.shortcuts}
### Open menus
| Shortcut | Action |
| -------- | --------------------------- |
| `C` | Create menu |
| `A` | More actions menu |
| `F` | Current folder actions menu |
| `R` | Sort menu |
| `T` | Settings menu |
{.shortcuts}
### Application actions
| Shortcut | Action |
| ----------- | ------------------------------- |
| `Shift` `/` | Display keyboard shortcuts list |
| `Q` `Q` | Choose next visual density |
| `Ctrl` `F` | Find/find next |
| `Ctrl` `P` | Print |
| `M` | Show last message |
| `/` | Search your drive |
{.shortcuts}
### Preview mode actions
| Shortcut | Action |
| -------- | ---------- |
| `Esc` | Close |
| `Space` | Play/pause |
| `+/=` | Zoom in |
| `-` | Zoom out |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Google Drive](https://support.google.com/drive/answer/2563044?hl=en) _(support.google.com)_
================================================
FILE: source/_posts/google-search.md
================================================
---
title: Google Search
date: 2023-01-10 09:51:44
background: bg-[#d3594a]
tags:
categories:
- Other
intro: |
This quick reference cheat sheet lists of Google advanced search operators.
---
## Getting Started {.cols-2}
### Google Advanced Search Operators
| Operator | Description | Category |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `""` | Allows searching for a specific phrase - exact match search. Individual word prevents synonyms | Basic,Mail |
| `OR`/`AND` | Boolean search function for OR searches as Google defaults to AND between words - must be all caps | Basic,Mail |
| `\` | Implements OR | Basic |
| `()` | Allows grouping of operators and helps dictate order | Basic,Mail |
| `-` | Excludes a word from results | Basic,Mail |
| `*` | Acts as a wildcard and will match any word or phrase | Basic |
| `#..#` | # represents a number in this instance. Use to find numbers in a series. | Basic |
| `$` | Allows for search of USD | Basic |
| `€` | Allows for search of Euro | Basic |
| `in` | Allows searches for unit conversion (currency, unit or measure) | Basic |
| `~` | Prefix - Include synonyms (potentially defunct) | Basic |
| `+` | Prefix - Force exact match on single phrase | Basic,Mail |
| `AROUND(X)` | This is sandwiched between two words and the X declares how many words they must be mentioned between. I.e. if it’s (4) then the two keywords must be mentioned within 4 words of each other. | Advanced |
| `_` | Acts as wildcard for autocomplete | Advanced |
### Search with url
| Operator | Description | Category |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -------- |
| `inurl:` | Only returns results where the queried keyword(s) is present in the URL | Advanced |
| `allinurl:` | As above but only containing all of the specified words in the URL | Advanced |
| `blogurl:` | Find blog URLs under a specific domain. This was used in Google blog search, but I’ve found it does return some results in regular search. | Advanced |
| `site:` | Limit results to those from one site | Advanced |
| `related:` | Find similar domains to the queried domain | Advanced |
### Search with dates
| Operator | Description | Category |
| ------------ | ---------------------------------------------------------------------------------------------------- | ---------- |
| `daterange:` | Return results in a specified range (requires julian dates) | Advanced |
| `after:` | Allows you to search drive or mail for files modified or mail sent/received anytime after a set date | Drive,Mail |
| `before:` | Allows you to search drive or mail for files modified or mail sent/received before a certain date | Drive,Mail |
| `older:` | Search for messages older than a certain date | Mail |
| `newer:` | Search for messages newer than a certain date | Mail |
### Search files
| Operator | Description | Category |
| --------------- | ---------------------------------------------------------------------------------------------------- | ---------- |
| `filename:` | Search for messages with a particular type of file attached, or the exact name of a file | Mail |
| `type:` | Allows you to search drive by file type | Drive |
| `owner:` | Allows you to search drive by owner of file or folder | Drive |
| `to:` | Allows you to search drive for files shared with a specific person | Drive |
| `title:` | Searches drive for files with the keyword in their title alone | Drive |
| `source:domain` | Allows you to search for files or folders shared with everyone in your business | Drive |
| `filetype:` | Returns only files of a particular type associated with the keyword searched | Advanced |
| `ext:` | As above, based on extension | Advanced |
| `after:` | Allows you to search drive or mail for files modified or mail sent/received anytime after a set date | Drive,Mail |
| `before:` | Allows you to search drive or mail for files modified or mail sent/received before a certain date | Drive,Mail |
| `is:trashed` | Searches for the item in the Drive bin | Drive |
### Search with page content
| Operator | Description | Category |
| -------------- | ------------------------------------------------------------------------------------------------------------------- | -------- |
| `link:` | Find pages that link to the target domain | Advanced |
| `inanchor:` | Find pages linked to with the specified anchor text/ phrase. Data is heavily sampled. | Advanced |
| `allinanchor:` | Find pages with all individual terms after "inanchor:" in the inbound anchor text. | Advanced |
| `intitle:` | Returns pages based on the searched query appearing in their title | Advanced |
| `allintitle:` | Similar to intitle: but only returns titles where all the words in the title match | Advanced |
| `inposttile:` | Finds pages with keywords in their post titles (i.e. for researching blogs) | |
| `intext:` | Finds pages where the keyword(s) are mentioned within the page content. | Advanced |
| `allintext:` | Similar to “intext,” but only results containing all of the specified words somewhere on the page will be returned. | Advanced |
### Keywords
| Operator | Description | Category |
| ----------------- | ------------------------------------------------------------------------------------------------ | -------- |
| `Business` | type E.g. cafe, restaurant, bar etc will return a selection of appropriate businesses in the are | Maps |
| `Petrol/Charging` | Station EV near me or perol station near me returns | Maps |
| `Search` | for a message with a google sheet attached | Mail |
| `Search` | for a message with a google presentation attached | Mail |
### Search on emails
| Operator | Description | Category |
| ------------------ | ----------------------------------------------------------------------------------------------------- | ---------- |
| `+` | Prefix - Force exact match on single phrase | Basic,Mail |
| `()` | Allows grouping of operators and helps dictate order | Basic,Mail |
| `-` | Excludes a word from results | Basic,Mail |
| `""` | Allows searching for a specific phrase - exact match search. Individual word prevents synonyms | Basic,Mail |
| `OR`/`AND` | Boolean search function for OR searches as Google defaults to AND between words - must be all caps | Basic,Mail |
| `after:` | Allows you to search drive or mail for files modified or mail sent/received anytime after a set date | Drive,Mail |
| `before:` | Allows you to search drive or mail for files modified or mail sent/received before a certain date | Drive,Mail |
| `is:starred` | Searches only items that have been starred in drive | Drive,Mail |
| `from:` | Specify the sender in google mail | Mail |
| `to:` | Specify the recipient in google mail | Mail |
| `cc:` | Search by a recipient that was copied into an email | Mail |
| `bcc:` | Search by a recipient that was blind copied into an email | Mail |
| `older:` | Search for messages older than a certain date | Mail |
| `newer:` | Search for messages newer than a certain date | Mail |
| `Search` | for a message with a google sheet attached | Mail |
| `Search` | for a message with a google presentation attached | Mail |
| `AROUND` | Similar to the normal google search function, allows you to search for keywords near each other. | Mail |
| `subject:` | Search by keywords featured in the subject line | Mail |
| `{}` | Use for OR in mail instead of the OR function | Mail |
| `label:` | Search for messages that have a certain label | Mail |
| `has:attachment` | Search for messages that have an item attached | Mail |
| `has:drive` | Search for messages with a google drive attached | Mail |
| `has:document` | Search for messages with a google doc attached | Mail |
| `has:youtube` | Search for a message containing a youtube video | Mail |
| `list:` | Search for all messages from a particular mailing list | Mail |
| `in:anywhere` | Includes all folders in your search, including spam and bin | Mail |
| `is:important` | Search for messages that have been marked as important | Mail |
| `label:important` | Same as is:important | Mail |
| `is:snoozed` | Searches for messages that have been snoozed | Mail |
| `is:unread` | Searches for unread messages | Mail |
| `is:read` | searches for read messages only | Mail |
| `has:yellow-star` | Searches for messages with coloured star icon | Mail |
| `has:blue-info` | Searches for messages with colourd icon | Mail |
| `is:chat` | Searches for messagse from chat | Mail |
| `deliveredto:` | Search by email address for delivered messages | Mail |
| `category:` | Searches by messages based on category. Follow the colon with the categoy name, i.e. category:primary | Mail |
| `size:` | Messages larger than a certain size in bytes | Mail |
| `larger:` | Messages larger than a certain size in bytes | Mail |
| `smaller:` | Messages smaller than a certain size in bytes | Mail |
| `has:userlabels` | Search for messages that have custom user labels | Mail |
| `has:nouserlabels` | Search for messages that have no custom user labels | Mail |
### Some other useful search operators
| Operator | Description | Category |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| `define:` | Pulls a card response from Google displaying the dictionary definition of the word or phrase | Advanced |
| `cache:` | Returns the most up to date cache of an indexed web page | Advanced |
| `weather:` | Brings up the featured snipped for weather for that location | Advanced |
| `stocks:` | Returns stock information for the specified ticker | Advanced |
| `map:` | Force google map results for a particular query | Advanced |
| `movie:` | Find information for the specified movie (particularly useful when that movie has an ambiguous name). If the movie is still in theatres it’ll also return screen times | Advanced |
| `source:` | Use in google news, returns results from the specified source | Advanced |
| `loc:` | Returns results for a specific location | Advanced |
| `location:` | As above but with Google news | Advanced |
| `info:` | Returns information related to a domain (pages with domain text, similar on-site pages, cache etc) | Advanced |
| `near` | Part of the google maps lazy searches e.g. book shops near work | Maps |
## Also see
- [Google Search Operators Cheat Sheet](https://static.semrush.com/blog/uploads/files/39/12/39121580a18160d3587274faed6323e2.pdf)
_(static.semrush.com)_
================================================
FILE: source/_posts/gospinwheel.md
================================================
---
title: GoSpinWheel
date: 2025-12-16 17:20:00
background: bg-gradient-to-br from-indigo-500 via-purple-500 to-pink-500
tags:
- Tool
- Productivity
- Streaming
categories:
- Other
intro: Quick-reference cheatsheet for GoSpinWheel — a modern random wheel spinner, name picker, and decision maker.
plugins:
- copyCode
---
## Essentials
### What is GoSpinWheel?
**[GoSpinWheel random wheel spinner](https://gospinwheel.com)** is a free, modern online tool for random selection and decision making. It’s a privacy-focused alternative to older “wheel spinner” sites, with a clean UI made for everyday use.
- **Core use cases**: Giveaways, classroom name picking, party games, quick decisions.
- **Login**: Not required (uses local browser storage).
- **Cost**: Free to use.
### Unique Features {.col-span-2}
| Feature | Description |
| :------------------- | :------------------------------------------------------------------------------------- |
| **Multi-Wheel Sync** | Run up to 6 wheels at once (e.g., one for names, one for prizes). |
| **True Randomness** | Uses `crypto.getRandomValues()` instead of `Math.random()` for cryptographic fairness. |
| **Elimination Mode** | Option to temporarily remove a winner from the wheel after they are picked. |
| **Share Links** | Generate a shareable link to publish a wheel and send it to friends. |
| **Auto-Save & Sync** | Auto-saves to Local Storage and keeps your wheel state in sync on the same device. |
| **Import / Export** | Export wheel configurations for backup, then import them later to restore. |
| **Streamer Mode** | Optimized for OBS/Zoom with a clean UI and fullscreen capabilities. |
| **Privacy** | Data is stored locally in your browser, not on external servers. |
## Controls & Fairness
### Shortcuts & Actions
| Action | Description |
| :-------- | :------------- |
| `Space` | Start spinning |
| `Cmd` `K` | Search wheels |
{.shortcuts}
### Customization Options
- **Entries**: Add bulk names/items via the right panel.
- **Weight**: Adjust probability for specific items (advanced).
- **Themes**: Switch between light/dark, or custom color palettes.
- **Sound**: Toggle spin sounds and winning fanfares.
### Sharing & Backup
- **Share publicly**: Generate a share link and send it to friends (great for games, raffles, or classroom use).
- **Local Storage sync**: Changes are auto-saved and stay consistent on the same device/browser.
- **Export / import**: Save your wheel configuration locally (backup/transfer), then import it back anytime.
### Randomness Audit
**Fairness Tech**: Uses `crypto.getRandomValues()` (CSPRNG) instead of predictable `Math.random()`.
**Verification**:
- Visit the [GoSpinWheel randomness audit tool](https://gospinwheel.com/randomness-audit).
- Use the **Audit Tool** to run 10,000+ simulations.
- Verify the deviation is statistically insignificant.
## Popular Templates
### Party Games
- **[Truth or Dare](https://gospinwheel.com/truth-or-dare)**: Dual-wheel spinner for players and actions. Spice up the party.
- **[Who Pays?](https://gospinwheel.com/who-pays-for-dinner)**: Left wheel decides "What to eat", right wheel decides "Who pays".
- **[Love Calculator](https://gospinwheel.com/love-calculator)**: Will they text back? Ask the universe with this fun calculator.
- **[Rock Paper Scissors](https://gospinwheel.com/rock-paper-scissors)**: Need an impartial referee? Let the wheel throw for you.
### Utility Tools
- **[Name Picker](https://gospinwheel.com/name-picker)**: Pick winners fairly with weighted entries. Perfect for raffles and teams.
- **[Student Picker](https://gospinwheel.com/student-picker)**: The essential classroom tool. Pick students fairly for questions or tasks.
### Decision Making
- **[Yes or No](https://gospinwheel.com/yes-or-no)**: The fastest way to make a decision. Yes, No, or Maybe?
- **[What to Eat](https://gospinwheel.com/what-to-eat)**: Solve the "What should we eat?" debate instantly.
- **[Movie Picker](https://gospinwheel.com/movie-picker)**: Cure Netflix "doom scrolling" and pick a film for movie night.
## Comparison
### vs. Competitors {.col-span-3}
| Feature | GoSpinWheel | Wheel of Names | Picker Wheel |
| :-------------- | :-------------------: | :------------: | :-----------: |
| **Randomness** | **Crypto** (Verified) | Math.random() | Math.random() |
| **Ads** | **Minimal / None** | High | High |
| **Multi-Wheel** | **Yes (Sync)** | No | No |
| **UI/UX** | **Modern 2024** | Dated | Dated |
| **Speed** | **Fast** | Average | Average |
{.show-header}
================================================
FILE: source/_posts/graphql.md
================================================
---
title: GraphQL
date: 2021-07-15 20:51:44
background: bg-[#cc44a2]
tags:
- query
- API
categories:
- Programming
intro: |
This quick reference cheat sheet provides a brief overview of GraphQL.
plugins:
- copyCode
---
## Getting Started
### Overview
- An alternative approach to RESTful APIs
- GraphQL is a query language for APIs
- Easily describe the shape of the GraphQL API using clear shared terms.
- Clients issue queries/mutations to read and update data
- GraphQL syntax can express complex entity relations
- Libraries to implement GraphQL in [different languages](https://graphql.org/code/)
[GraphQL](https://graphql.org/) {.link-arrow}
### Schema
| | |
| -------------- | -------------------------------- |
| `schema` | GraphQL schema definition |
| `query` | Read and traverse data |
| `mutation` | Modify data or trigger an action |
| `subscription` | Run a query when an event occurs |
### Built-in Scalar Types
| | |
| --------- | -------------------------------------------- |
| `Int` | Signed 32‐bit integer |
| `Float` | Signed double-precision floating-point value |
| `String` | UTF‐8 character sequence |
| `Boolean` | true or false |
| `ID` | A Unique identifier |
### Type Definitions
| | |
| ----------- | ----------------- |
| `scalar` | Scalar Type |
| `type` | Object Type |
| `interface` | Interface Type |
| `union` | Union Type |
| `enum` | Enum Type |
| `input` | Input Object Type |
### Type Modifiers
| | |
| ------------ | --------------------------------- |
| `String` | Nullable String |
| `String!` | Non-null String |
| `[String]` | List of nullable Strings |
| `[String]!` | Non-null list of nullable Strings |
| `[String!]!` | Non-null list of non-null Strings |
### Input Arguments {.row-span-2}
#### Basic Input
```js
type Query {
users(limit: Int): [User]
}
```
#### Input with default value
```js
type Query {
users(limit: Int = 10): [User]
}
```
#### Input with multiple arguments
```js
type Query {
users(limit: Int, sort: String): [User]
}
```
#### Input with multiple arguments and default values
```js {.wrap}
type Query {
users(limit: Int = 10, sort: String): [User]
}
type Query {
users(limit: Int, sort: String = "asc"): [User]
}
type Query {
users(limit: Int = 10, sort: String = "asc"): [User]
}
```
### Input Types
```js
input ListUsersInput {
limit: Int
since_id: ID
}
```
```js
type Mutation {
users(params: ListUsersInput): [User]!
}
```
### Custom Scalars
```js
scalar Url
type User {
name: String
homepage: Url
}
```
### Interfaces
```js
interface Foo {
is_foo: Boolean
}
interface Goo {
is_goo: Boolean
}
type Bar implements Foo {
is_foo: Boolean
is_bar: Boolean
}
type Baz implements Foo, Goo {
is_foo: Boolean
is_goo: Boolean
is_baz: Boolean
}
```
Object implementing one or more Interfaces
### Unions
```js
type Foo {
name: String
}
type Bar {
is_bar: String
}
union SingleUnion = Foo
union MultipleUnion = Foo | Bar
type Root {
single: SingleUnion
multiple: MultipleUnion
}
```
Union of one or more Objects
### Enums
```js {.wrap}
enum USER_STATE {
NOT_FOUND
ACTIVE
INACTIVE
SUSPENDED
}
type Root {
stateForUser(userID: ID!): USER_STATE!
users(state: USER_STATE, limit: Int = 10): [User]
}
```
## Also see
- [GraphQL Schema Language Cheat Sheet](https://github.com/sogko/graphql-schema-language-cheat-sheet) _(github.com)_
================================================
FILE: source/_posts/grep.md
================================================
---
title: Grep
date: 2020-11-25 18:28:43
background: bg-indigo-400
tags:
- egrep
- search
- pattern
- text
categories:
- Linux Command
intro:
This cheat sheet is intended to be a quick reminder for the main concepts involved in using the command line program
grep and assumes you already understand its usage.
plugins:
- copyCode
---
## Getting Started {.cols-5}
### Usage {.col-span-2}
Search standard output (i.e. a stream of text)
```shell script
$ grep [options] search_string
```
Search for an exact string in file:
```shell script
$ grep [options] search_string path/to/file
```
Print lines in myfile.txt containing the string "mellon"
```shell script
$ grep 'mellon' myfile.txt
```
Wildcards are accepted in filename.
### Option examples {.col-span-3}
| Option | Example | Operation |
| ------ | ----------------------------------------- | ---------------------------------------------------- |
| `-i` | grep -i ^DA demo.txt | Forgets about case sensitivity |
| `-w` | grep -w "of" demo.txt | Search only for the full word |
| `-A` | grep -A 3 'Exception' error.log | Display 3 lines after matching string |
| `-B` | grep -B 4 'Exception' error.log | Display 4 lines before matching string |
| `-C` | grep -C 5 'Exception' error.log | Display 5 lines around matching string |
| `-r` | grep -r 'cheatsheets.zip' /var/log/nginx/ | Recursive search _(within subdirs)_ |
| `-v` | grep -v 'warning' /var/log/syslog | Return all lines which don't match the pattern |
| `-e` | grep -e '^al' filename | Use regex _(lines starting with 'al')_ |
| `-E` | grep -E 'ja(s\|cks)on' filename | Extended regex _(lines containing jason or jackson)_ |
| `-c` | grep -c 'error' /var/log/syslog | Count the number of matches |
| `-l` | grep -l 'robot' /var/log/\* | Print the name of the file(s) of matches |
| `-o` | grep -o search_string filename | Only show the matching part of the string |
| `-n` | grep -n "go" demo.txt | Show the line numbers of the matches |
## Grep regular expressions
### Refer
- [Regex syntax](/regex) _(cheatsheets.zip)_
- [Regex examples](/regex#regex-examples) _(cheatsheets.zip)_
Please refer to the full version of the regex cheat sheet for more complex requirements.
### Wildcards
| - | - |
| --------------- | -------------------------------------- |
| . | Any character. |
| `? ` | Optional and can only occur once. |
| `* ` | Optional and can occur more than once. |
| `+ ` | Required and can occur more than once. |
### Quantifiers
| - | - |
| --------------- | -------------------------------------------- |
| `{n} ` | Previous item appears exactly n times. |
| `{n,} ` | Previous item appears n times or more. |
| `{,m} ` | Previous item appears n times maximum. |
| `{n,m} ` | Previous item appears between n and m times. |
### POSIX
| - | - |
| --------------- | ----------------------------------------- |
| `[:alpha:] ` | Any lower and upper case letter. |
| `[:digit:] ` | Any number. |
| `[:alnum:] ` | Any lower and upper case letter or digit. |
| `[:space:] ` | Any whitespace. |
### Character
| - | - |
| --------------- | ----------------------------------------- |
| `[A-Za-z] ` | Any lower and upper case letter. |
| `[0-9] ` | Any number. |
| `[0-9A-Za-z]` | Any lower and upper case letter or digit. |
### Position
| | |
| ---- | ------------------ |
| `^ ` | Beginning of line. |
| `$ ` | End of line. |
| `^$` | Empty line. |
| `\<` | Start of word. |
| `\>` | End of word. |
================================================
FILE: source/_posts/guitar-pro.md
================================================
---
title: Guitar Pro
date: 2022-11-23 16:23:31.693917
background: bg-[#659af0]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 129 keyboard shortcuts found in Guitar Pro
---
## Keyboard Shortcuts
### Track
| Shortcut | Action |
| ----------------------- | ---------- |
| `Ctrl` `Shift` `Insert` | Add |
| `Ctrl` `Shift` `Delete` | Delete |
| `Ctrl` `Alt` `Up` | Move up |
| `Ctrl` `Alt` `Down` | Move down |
| `F6` | Properties |
{.shortcuts}
### Bar - General {.row-span-2}
| Shortcut | Action |
| --------------- | ------------------ | --------- |
| `Ctrl` `Insert` | Insert bar |
| `Ctrl` `Delete` | Delete bar |
| `K` | Clef |
| `Ctrl` `K` | Key signature |
| `Ctrl` `T` | Time signature |
| `Ctrl` `/` | Triplet feel |
| ` | ` | Free time |
| `[` | Repeat open |
| `]` | Repeat close |
| `D` | Directions |
| `Ctrl` `R` | Multi rest |
| `Ctrl` `Enter` | Force line break |
| `Shift` `7` | Prevent line break |
{.shortcuts}
### Bar - Section
| Shortcut | Action |
| ---------------- | ---------------- |
| `Shift` `Insert` | Insert or remove |
| `Alt` `Left` | Previous section |
| `Alt` `Right` | Next section |
{.shortcuts}
### Bar - Simile Mark
| Shortcut | Action |
| ------------------ | --------------- |
| `Shift` `5` | Repeat one bar |
| `Ctrl` `Shift` `5` | Repeat two bars |
{.shortcuts}
### Note - Duration
| Shortcut | Action |
| ------------------ | ------------------------------------------------- |
| `+/-` | Increase or decrease (whole note, half note, etc) |
| `Shift` `5` | Dotting |
| `Ctrl` `Shift` `5` | Double dotting |
| `/` | Triplet |
{.shortcuts}
### Note - General {.row-span-6}
| Shortcut | Action |
| ------------------ | ------------------------- |
| `Insert` | Insert a beat |
| `Shift` `Delete` | Delete the beats |
| `C` | Copy the beats at the end |
| `L` | Tie note |
| `Shift` `L` | Tie the beat |
| `F` | Fermata |
| `R` | Rest |
| `Ctrl` `D` | Brush downstroke |
| `Ctrl` `U` | Brush upstroke |
| `Ctrl` `Shift` `D` | Arpeggio down |
| `Ctrl` `Shift` `U` | Arpeggio up |
| `Shift` `R` | Rasgueado |
| `Shift` `D` | PickStroke down |
| `Shift` `U` | PickStroke up |
| `Shift` `-` | One semi-town down |
| `Shift` `+` | One semi-tone up |
| `Alt` `Down` | Shift down |
| `Alt` `Up` | Shift up |
| `A` | Chord |
| `Shift` `I` | Barre |
| `Shift` `2` | Timer |
| `T` | Text |
{.shortcuts}
### Effects - General {.row-span-6}
| Shortcut | Action |
| -------------------- | --------------------- |
| `X` | Dead note |
| `O` | Ghost note |
| `;` | Accented note |
| `Shift` `;` | Heavily accented note |
| `Shift` `1` | Staccato |
| `Shift` `-` | Tenuto |
| `Shift` `H` | Legato |
| `I` | Let ring |
| `[` | Palm mute note |
| `]` | Palm-mute on beat |
| `Y` | Natural harmonic |
| `Alt` `Y` | Artificial harmonic |
| `B` | Bend |
| `Shift` `W` | Tremolo bar |
| `H` | Hammer on or pull-off |
| `Shift` `9` | Left-hand tapping |
| `Shift` `0` | Tapping |
| `Shift` `4` | Slap |
| `Ctrl` `Shift` `4` | Pop |
| `N` | Trill |
| `Shift` `,` | Fade in |
| `Shift` `.` | Fade out |
| `Ctrl` `Shift` `./,` | Volume swell |
| `Alt` `O` | Wah open |
| `Alt` `C` | Wah close |
{.shortcuts}
### Note - Accidentals
| Shortcut | Action |
| ---------------- | --------------------- |
| `Ctrl` `Alt` `7` | Double flat |
| `Ctrl` `7` | Flat |
| `Ctrl` `8` | Natural |
| `Ctrl` `9` | Sharp |
| `Ctrl` `Alt` `9` | Double sharp |
| `Ctrl` `Alt` `8` | Change the accidental |
{.shortcuts}
### Effects - Grace Note
| Shortcut | Action |
| --------- | --------------- |
| `G` | Before the beat |
| `Alt` `G` | On the beat |
{.shortcuts}
### Effects - Vibrato
| Shortcut | Action |
| --------- | -------------------------- |
| `V` | Left-hand vibrato (slight) |
| `Alt` `V` | Left-hand vibrato (wide) |
{.shortcuts}
### Effects - Vibrato with Trem. Bar
| Shortcut | Action |
| --------- | ------------------------------- |
| `W` | Vibrato with trem. bar (slight) |
| `Alt` `W` | Vibrato with trem. bar (wide) |
{.shortcuts}
### Effects - Slide
| Shortcut | Action |
| --------- | ------------ |
| `S` | Legato slide |
| `Alt` `S` | Shift slide |
{.shortcuts}
### Effects - Tremolo
| Shortcut | Action |
| ----------- | ------------------ |
| `Shift` `'` | Thirty-second note |
{.shortcuts}
### Tools
| Shortcut | Action |
| ------------------ | ------------------------ |
| `F4` | Check the bars' duration |
| `Ctrl` `Shift` `M` | Move or swap voices |
{.shortcuts}
### Sound
| Shortcut | Action |
| -------------- | ----------------------------- |
| `Space` | Play |
| `Ctrl` `Space` | Play from the beginning |
| `Ctrl` `Home` | First bar |
| `Ctrl` `Left` | Rewind |
| `Ctrl` `Right` | Fast forward |
| `Ctrl` `End` | Last bar |
| `F9` | Play in loops (speed trainer) |
| `F2` | RSI (Realistic Sound Engine) |
{.shortcuts}
### View
| Shortcut | Action |
| ---------------- | -------------- |
| `Ctrl` `Alt` `D` | Design mode |
| `F3` | Multitrack |
| `Ctrl` `B` | Enable browser |
| `F6` | Fretboard |
| `F6` | Keyboard |
| `F6` | Drums |
| `F11` | Full screen |
{.shortcuts}
### Edit
| Shortcut | Action |
| ------------------ | ---------------- |
| `Ctrl` `Z` | Undo |
| `Ctrl` `Shift` `Z` | Redo |
| `Ctrl` `X` | Cut |
| `Ctrl` `C` | Copy |
| `Ctrl` `V` | Paste |
| `Ctrl` `Shift` `X` | Multitrack cut |
| `Ctrl` `Shift` `C` | Multitrack copy |
| `Ctrl` `Shift` `V` | Special paste |
| `Ctrl` `A` | Select all |
| `Ctrl` `G` | Go to |
| `F10` | Edit automations |
| `Ctrl` `1-4` | Voices |
{.shortcuts}
### General
| Shortcut | Action |
| ------------------ | ----------------- |
| `Ctrl` `N` | New steel guitar |
| `Ctrl` `O` | Open |
| `Ctrl` `W` | Close |
| `Ctrl` `S` | Save |
| `Ctrl` `Shift` `S` | Save As |
| `F5` | Score information |
| `F7` | Stylesheet |
| `F8` | Print preview |
| `Ctrl` `P` | Print |
| `F12` | Preferences |
| `Ctrl` `Q` | Quit |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Guitar Pro](https://shredaddict.com/guitar-pro-shortcuts/) _(shredaddict.com)_
================================================
FILE: source/_posts/homebrew.md
================================================
---
title: Homebrew
date: 2023-04-12
background: bg-[#fbb041]
tags:
- packages manager
- macos
categories:
- Toolkit
intro: This is a quick reference cheat sheet to getting started with homebrew.
plugins:
- copyCode
---
## Getting Started
### Install
If not installed, install Command Line Tools (CLT)
```bash
xcode-select --install
```
Install Homebrew :
```bash {.wrap}
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
[Official Website](https://brew.sh/) {.link-arrow}
### Commands
| | |
| -------------------------- | -------------------------------------- |
| `brew install git` | Install a package |
| `brew uninstall git` | Uninstall a package |
| `brew upgrade git` | Upgrade package |
| `brew unlink git` | Unlink |
| `brew link git` | Link |
| `brew list --versions git` | List the installed versions of package |
### Help
Display the version of Homebrew.
```bash
brew --version
```
Print Help Information
```bash
brew help
```
Print Help Info for a brew command
```bash
brew help I'm from CheatSheets.zip
Share quick reference cheat sheet.
``` See: [The Paragraph element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p) ### HTML link ```html CheatSheets Email Call Msg ``` --- | | | | | --- | -------- | --------------------------------------------------------------- | | | `href` | The URL that the hyperlink points to | | | `rel` | Relationship of the linked URL | | | `target` | Link target location:
```
---
| | | |
| --- | --------- | ---------------------------------------- |
| | `src` | Required, Image location _(URL \| Path)_ |
| | `alt` | Describe of the image |
| | `width` | Width of the image |
| | `height` | Height of the image |
| | `loading` | How the browser should load |
{.left-text}
See: [The Image Embed element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img)
### Text Formatting Tags
```html
Bold Text
This text is important
Italic Text
This text is emphasized
Underline Text
Pre-formatted Text
Source code
Text Block Quote``` ### Headings ```html
I Love CheatSheets.zip
```I Love CheatSheets.zip
## HTML Tables ### Table Example {.row-span-2} ```html| name | age |
| Roberta | 39 |
| Oliver | 25 |
| ](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th) | Defines a header cell in a table | | [\ |
|---|
| ](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td) | Defines a cell in a table |
| [\ | Attributes | Attribute | Description | | --------- | --------------------------------------------- | | `colspan` | Number of columns a cell should span | | `headers` | One or more header cells a cell is related to | | `rowspan` | Number of rows a cell should span | See: [td\#Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attributes) ### \ | Attributes
| Attribute | Description |
| -------------------------------------------------------------------------------- | --------------------------------------------- |
| `colspan` | Number of columns a cell should span |
| `headers` | One or more header cells a cell is related to |
| `rowspan` | Number of rows a cell should span |
| `abbr` | Description of the cell's content |
| [scope](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-scope) | The header element relates to |
See: [th\#Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attributes)
## HTML Lists
### Unordered list
```html
Hello from server ``` ## Core Attributes {.cols-3} ### `hx-get`, `hx-post`, etc. ```html Load Page ``` ### `hx-target` ```html ``` ### `hx-trigger` ```html ``` ## Swap & Out of Band {.cols-3} ### `hx-swap` ```html ``` - `outerHTML` - `innerHTML` - `beforebegin`, `afterbegin`, etc. ### `hx-swap-oob` ```html ``` _Useful for global updates from partials._ ### Swap Modifiers ```html hx-swap="outerHTML transition:true swap:1s" ``` ## Forms & Events {.cols-3} ### Auto POST on Submit ```html ``` ### `hx-include` ```html ``` ### `hx-vals` ```html ``` ## Advanced Features {.cols-3} ### Loading Indicator ```htmlLoading...
```
### `hx-push-url`
```html
Go
```
### Polling
```html
```
## Events & Extensions {.cols-3}
### Listen to Events
```js
document.body.addEventListener('htmx:afterSwap', (e) => {
console.log('Swap complete');
});
```
### Event Hooks
- `htmx:beforeRequest`
- `htmx:afterSwap`
- `htmx:responseError`
### Extensions
```html
```
## Example Use Case {.cols-2}
### Python Backend (Flask)
```python
@app.route("/hello")
def hello():
return "Hello, HTMX! " ``` ### HTML Client ```html ``` ================================================ FILE: source/_posts/http-status-code.md ================================================ --- title: HTTP Status Code background: bg-[#3b7dc0] date: 2020-12-26 16:09:09 tags: - response - server categories: - Other intro: | The HTTP status codes cheat sheet. A quick reference to every HTTP status code. plugins: - tooltip --- ## HTTP Status code ### Means - [1xx: Informational](#1xx-information){data-tooltip="It means the request has been received and the process is continuing."} - [2xx: Success](#2xx-successful){data-tooltip="It means the action was successfully received, understood, and accepted."} - [3xx: Redirection](#3xx-redirection){data-tooltip="It means further action must be taken in order to complete the request."} - [4xx: Client Error](#4xx-client-error){data-tooltip="It means the request contains incorrect syntax or cannot be fulfilled."} - [5xx: Server Error](#5xx-server-error){data-tooltip="It means the server failed to fulfill an apparently valid request."} ### 2xx. Successful {.row-span-2} - [200: OK](https://tools.ietf.org/html/rfc7231#section-6.3.1){data-tooltip="The request is OK."} - [201: Created](https://tools.ietf.org/html/rfc7231#section-6.3.2){data-tooltip="The request is complete, and a new resource is created."} - [202: Accepted](https://tools.ietf.org/html/rfc7231#section-6.3.3){data-tooltip="The request is accepted for processing, but the processing is not complete."} - [203: Non-Authoritative Information](https://tools.ietf.org/html/rfc7231#section-6.3.4){data-tooltip="The information in the entity header is from a local or third-party copy, not from the original server."} - [204: No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5){data-tooltip="A status code and a header are given in the response, but there is no entity-body in the reply."} - [205: Reset Content](https://tools.ietf.org/html/rfc7231#section-6.3.6){data-tooltip="The browser should clear the form used for this transaction for additional input."} - [206: Partial Content](https://tools.ietf.org/html/rfc7233#section-4.1){data-tooltip="The server is returning partial data of the size requested. Used in response to a request specifying a Range header. The server must specify the range included in the response with the Content-Range header."} - [207: Multi-Status](https://tools.ietf.org/html/rfc4918#section-11.1){data-tooltip="Provides status for multiple independent operations."} - [208: Already Reported](https://tools.ietf.org/html/rfc5842#section-7.1){data-tooltip="Used inside a DAV: propstat response element to avoid enumerating the internal members of multiple bindings to the same collection repeatedly."} - [226: IM Used](https://tools.ietf.org/html/rfc3229#section-10.4.1){data-tooltip="The server has fulfilled a request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance."} ### 4xx. Client Error {.row-span-3} - [400: Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1){data-tooltip="The server did not understand the request."} - [401: Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1){data-tooltip="The requested page needs a username and a password."} - [402: Payment Required](https://tools.ietf.org/html/rfc7231#section-6.5.2){data-tooltip="You can not use this code yet."} - [403: Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3){data-tooltip="Access is forbidden to the requested page."} - [404: Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4){data-tooltip="The server can not find the requested page."} - [405: Method Not Allowed](https://tools.ietf.org/html/rfc7231#section-6.5.5){data-tooltip="The method specified in the request is not allowed."} - [406: Not Acceptable](https://tools.ietf.org/html/rfc7231#section-6.5.6){data-tooltip="The server can only generate a response that is not accepted by the client."} - [407: Proxy Authentication Required](https://tools.ietf.org/html/rfc7235#section-3.2){data-tooltip="You must authenticate with a proxy server before this request can be served."} - [408: Request Timeout](https://tools.ietf.org/html/rfc7231#section-6.5.7){data-tooltip="The request took longer than the server was prepared to wait."} - [409: Conflict](https://tools.ietf.org/html/rfc7231#section-6.5.8){data-tooltip="The request could not be completed because of a conflict."} - [410: Gone](https://tools.ietf.org/html/rfc7231#section-6.5.9){data-tooltip="The requested page is no longer available."} - [411: Length Required](https://tools.ietf.org/html/rfc7231#section-6.5.10){data-tooltip="The "Content-Length" is not defined. The server will not accept the request without it."} - [412: Precondition Failed](https://tools.ietf.org/html/rfc7232#section-4.2){data-tooltip="The pre condition given in the request evaluated to false by the server."} - [413: Payload Too Large](https://tools.ietf.org/html/rfc7231#section-6.5.11){data-tooltip="The server will not accept the request, because the request entity is too large."} - [414: URI Too Long](https://tools.ietf.org/html/rfc7231#section-6.5.12){data-tooltip="The server will not accept the request, because the URL is too long. Occurs when you convert a "post" request to a "get" request with a long query information."} - [415: Unsupported Media Type](https://tools.ietf.org/html/rfc7231#section-6.5.13){data-tooltip="The server will not accept the request, because the media type is not supported."} - [416: Range Not Satisfiable](https://tools.ietf.org/html/rfc7233#section-4.4){data-tooltip="The requested byte range is not available and is out of bounds."} - [417: Expectation Failed](https://tools.ietf.org/html/rfc7231#section-6.5.14){data-tooltip="The expectation given in an Expect request-header field could not be met by this server."} - [421: Misdirected Request](https://tools.ietf.org/html/rfc7540#section-9.1.2){data-tooltip="The request was directed at a server that is not able to produce a response."} - [426: Upgrade Required](https://tools.ietf.org/html/rfc7231#section-6.5.15){data-tooltip="The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol."} - [428: Precondition Required](https://tools.ietf.org/html/rfc6585#section-3){data-tooltip="The origin server requires the request to be conditional."} - [429: Too Many Requests](https://tools.ietf.org/html/rfc6585#section-4){data-tooltip="The user has sent too many requests in a given amount of time."} - [431: Request Header Fields Too Large](https://tools.ietf.org/html/rfc6585#section-5){data-tooltip="The server is unwilling to process the request because its header fields are too large."} - [451: Unavailable For Legal Reasons](https://datatracker.ietf.org/doc/html/rfc7725#section-3){data-tooltip="This status code indicates that the server is denying access to the resource as a consequence of a legal demand."} ### 1xx. Information - [100: Continue](https://tools.ietf.org/html/rfc7231#section-6.2.1){data-tooltip="Only a part of the request has been received by the server, but as long as it has not been rejected, the client should continue with the request."} - [101: Switching Protocols](https://tools.ietf.org/html/rfc7231#section-6.2.2){data-tooltip="The server switches protocol."} - [102: Processing](https://tools.ietf.org/html/rfc2518#section-10.1){data-tooltip="An interim response used to inform the client that the server has accepted the complete request, but has not yet completed it."} - [103: Early Hints](https://tools.ietf.org/html/rfc8297){data-tooltip="Indicates to the client that the server is likely to send a final response with the header fields included in the informational response."} ### 3xx. Redirection - [300: Multiple Choices](https://tools.ietf.org/html/rfc7231#section-6.4.1){data-tooltip="A link list. The user can select a link and go to that location. Maximum five addresses."} - [301: Moved Permanently](https://tools.ietf.org/html/rfc7231#section-6.4.2){data-tooltip="The requested page has moved to a new URL."} - [302: Found](https://tools.ietf.org/html/rfc7231#section-6.4.3){data-tooltip="The requested page has moved temporarily to a new URL."} - [303: See Other](https://tools.ietf.org/html/rfc7231#section-6.4.4){data-tooltip="The requested page can be found under a different URL."} - [304: Not Modified](https://tools.ietf.org/html/rfc7232#section-4.1){data-tooltip="This is the response code to an If-Modified-Since or If-None-Match header, where the URL has not been modified since the specified date."} - [305: Use Proxy](https://tools.ietf.org/html/rfc7231#section-6.4.5){data-tooltip="The requested URL must be accessed through the proxy mentioned in the Location header."} - [306: Unused](https://tools.ietf.org/html/rfc7231#section-6.4.6){data-tooltip="This code was used in a previous version. It is no longer used, but the code is reserved."} - [307: Temporary Redirect](https://tools.ietf.org/html/rfc7231#section-6.4.7){data-tooltip="The requested page has moved temporarily to a new URL."} - [308: Permanent Redirect](https://tools.ietf.org/html/rfc7538#section-3){data-tooltip="The request and all future requests should be repeated using another URI."} ### 5xx. Server Error - [500: Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1){data-tooltip="The request was not completed. The server met an unexpected condition."} - [501: Not Implemented](https://tools.ietf.org/html/rfc7231#section-6.6.2){data-tooltip="The request was not completed. The server did not support the functionality required."} - [502: Bad Gateway](https://tools.ietf.org/html/rfc7231#section-6.6.3){data-tooltip="The request was not completed. The server received an invalid response from the upstream server."} - [503: Service Unavailable](https://tools.ietf.org/html/rfc7231#section-6.6.4){data-tooltip="The request was not completed. The server is temporarily overloading or down."} - [504: Gateway Timeout](https://tools.ietf.org/html/rfc7231#section-6.6.5){data-tooltip="The gateway has timed out."} - [505: HTTP Version Not Supported](https://tools.ietf.org/html/rfc7231#section-6.6.6){data-tooltip="The server does not support the "http protocol" version."} - [506: Variant Also Negotiates](https://tools.ietf.org/html/rfc2295#section-8.1){data-tooltip="Transparent content negotiation for the request results in a circular reference."} - [507: Insufficient Storage](https://tools.ietf.org/html/rfc4918#section-11.5){data-tooltip="The server is unable to store the representation needed to complete the request."} - [508: Loop Detected](https://tools.ietf.org/html/rfc5842#section-7.2){data-tooltip="The server detected an infinite loop while processing the request."} - [510: Not Extended](https://tools.ietf.org/html/rfc2774#section-7){data-tooltip="Further extensions to the request are required for the server to fulfill it."} - [511: Network Authentication Required](https://tools.ietf.org/html/rfc6585#section-6){data-tooltip="The client needs to authenticate to gain network access."} ================================================ FILE: source/_posts/idea.md ================================================ --- title: IntelliJ IDEA date: 2020-12-17 21:51:44 background: bg-gradient-to-r from-pink-500 via-violet-400 to-blue-400 hover:from-pink-700 hover:via-violet-600 hover:to-blue-500 tags: - jetbrains - java - shortcut categories: - Keyboard Shortcuts intro: | IntelliJ IDEA is a very good Java IDE, most of its commands have shortcuts to keep your hands from leaving the keyboard --- ## IDEA Windows & Linux Keymap ### Editing {.row-span-5} | shortcut | description | | -------------------------- | :----------------------------------------------- | | `Ctrl` `Space` | Basic code completion | | `Ctrl` `Shift` `Space` | Smart code completion | | `Ctrl` `Shift` `Enter` | Complete statement | | `Ctrl` `P` | Parameter info | | `Ctrl` `Q` | Quick documentation lookup | | `Shift` `F1` | External Doc | | `Ctrl` `hover` | Brief Info | | `Ctrl` `F1` | Error or warning at caret | | `Alt` `Insert` | Generate code | | `Ctrl` `O` | Override methods | | `Ctrl` `I` | Implement methods | | `Ctrl` `Alt` `T` | Surround with | | `Ctrl` `/` | Comment or uncomment line | | `Ctrl` `Shift` `/` | Comment or uncomment block | | `Ctrl` `W` | Select successively increasing code blocks | | `Ctrl` `Shift` `W` | Decrease current selection to previous state | | `Alt` `Q` | Context info | | `Alt` `Enter` | Show intention actions and quick-fixes | | `Ctrl` `Alt` `L` | Reformat code | | `Ctrl` `Alt` `O` | Optimize imports | | `Ctrl` `Alt` `I` | Auto-indent line(s) | | `Tab` | Indent selected lines | | `Shift` `Tab` | Unindent selected lines | | `Ctrl` `X` | Cut current line or selected block to clipboard | | `Ctrl` `C` | Copy current line or selected block to clipboard | | `Ctrl` `V` | Paste from clipboard | | `Ctrl` `Shift` `V` | Paste from recent buffers | | `Ctrl` `D` | Duplicate current line or selected block | | `Ctrl` `Y` | Delete line at caret | | `Ctrl` `Shift` `J` | Smart line join | | `Ctrl` `Enter` | Smart line split | | `Shift` `Enter` | Start new line | | `Ctrl` `Shift` `U` | Toggle case for word at caret or selected block | | `Ctrl` `Shift` `]` _/_ `[` | Select till code block end/start | | `Ctrl` `Backspace` | Delete to word end/start | | `Ctrl` `+` _/_ `-` | Expand/collapse code block | | `Ctrl` `Shift` `+` | Expand all | | `Ctrl` `Shift` `-` | Collapse all | | `Ctrl` `F4` | Close active editor tab | {.shortcuts} ### Usage Search | shortcut | description | | -------------------------- | :------------------------------ | | `Alt` `F7` _/_ `Ctrl` `F7` | Find usages/Find usages in file | | `Ctrl` `Shift` `F7` | Highlight usages in file | | `Ctrl` `Alt` `F7` | Show usages | {.shortcuts} ### Navigation {.row-span-4} | shortcut | description | | ------------------------------- | :---------------------------------------- | | `Ctrl` `N` | Go to class | | `Ctrl` `Shift` `N` | Go to file | | `Ctrl` `Alt` `Shift` `N` | Go to symbol | | `Alt` `Right` _/_ `Left` | Go to next / previous editor tab | | `F12` | Go back to previous tool window | | `Esc` | Go to editor | | `Shift` `Esc` | Hide active or last active window | | `Ctrl` `Shift` `F4` | Close active run, messages... | | `Ctrl` `G` | Go to line | | `Ctrl` `E` | Recent files popup | | `Ctrl` `Alt` `Left` _/_ `Right` | Navigate back / forward | | `Ctrl` `Shift` `Backspace` | Navigate to last edit location | | `Alt` `F1` | Select current file or symbol in any view | | `Ctrl` `B` _/_ `Ctrl` `Click` | Go to declaration | | `Ctrl` `Alt` `B` | Go to implementation(s) | | `Ctrl` `Shift` `I` | Open quick definition lookup | | `Ctrl` `Shift` `B` | Go to type declaration | | `Ctrl` `U` | Go to super-method / super-class | | `Alt` `Up` _/_ `Down` | Go to previous / next method | | `Ctrl` `]/[` | Move to code block end/start | | `Ctrl` `F12` | File structure popup | | `Ctrl` `H` | Type hierarchy | | `Ctrl` `Shift` `H` | Method hierarchy | | `Ctrl` `Alt` `H` | Call hierarchy | | `F2` _/_ `Shift` `F2` | Next/previous highlighted error | | `F4` _/_ `Ctrl` `Enter` | Edit source / View source | | `Alt` `Home` | Show navigation bar | | `F11` | Toggle bookmark | | `Ctrl` `F11` | Toggle bookmark with mnemonic | | `Ctrl` `0...9` | Go to numbered bookmark | | `Shift` `F11` | Show bookmarks | {.shortcuts} ### Search/Replace | shortcut | description | | ------------------ | :------------------------ | | `Double Shift` | Search everywhere | | `Ctrl` `F` | Find | | `F3` `Shift` `F3` | Find next / Find previous | | `Ctrl` `R` | Replace | | `Ctrl` `Shift` `F` | Find in path | | `Ctrl` `Shift` `R` | Replace in path | {.shortcuts} ### Live Templates | shortcut | description | | ---------------- | :------------------------------------------------ | | `Ctrl` `Alt` `J` | Surround with Live Template | | `Ctrl` `J` | Insert Live Template | | `iter` | Iteration according to Java SDK 1.5 style | | `inst` | Check object type with instanceof and downcast it | | `itco` | Iterate elements of java.util.Collection | | `itit` | Iterate elements of java.util.Iterator | | `itli` | Iterate elements of java.util.List | | `psf` | public static final | | `thr` | throw new | {.shortcuts} ### Refactoring | shortcut | description | | ---------------- | :---------------- | | `F5` | Copy | | `F6` | Move | | `Alt` `Delete` | Safe Delete | | `Shift` `F6` | Rename | | `Ctrl` `F6` | Change Signature | | `Ctrl` `Alt` `N` | Inline | | `Ctrl` `Alt` `M` | Extract Method | | `Ctrl` `Alt` `V` | Extract Variable | | `Ctrl` `Alt` `F` | Extract Field | | `Ctrl` `Alt` `C` | Extract Constant | | `Ctrl` `Alt` `P` | Extract Parameter | {.shortcuts} ### Debugging | shortcut | description | | ----------------------------- | :----------------------- | | `F8/F7` | Step over/Step into | | `Shift` `F7` _/_ `Shift` `F8` | Smart step into/Step out | | `Alt` `F9` | Run to cursor | | `Alt` `F8` | Evaluate expression | | `F9` | Resume program | | `Ctrl` `F8` | Toggle breakpoint | | `Ctrl` `Shift` `F8` | View breakpoints | {.shortcuts} ### Compile and Run | shortcut | description | | ---------------------------- | :--------------------------------------- | | `Ctrl` `F9` | Make project | | `Ctrl` `Shift` `F9` | Compile selected file, package or module | | `Alt` `Shift` `F10` _/_ `F9` | Select configuration and run/and debug | | `Shift` `F10` _/_ `F9` | Run/Debug | | `Ctrl` `Shift` `F10` | Run context configuration from editor | {.shortcuts} ### VCS/Local History | shortcut | description | | ------------------- | :-------------------- | | `Ctrl` `K` | Commit project to VCS | | `Ctrl` `T` | Update from VCS | | `Alt` `Shift` `C` | View recent changes | | `Alt` \` | VCS Operations Popup | {.shortcuts} ### General | shortcut | description | | ------------------------ | :----------------------------- | | `Alt` `0...9` | Open corresponding tool window | | `Ctrl` `S` | Save all | | `Ctrl` `Alt` `Y` | Synchronize | | `Ctrl` `Shift` `F12` | Toggle maximizing editor | | `Alt` `Shift` `F` | Add to Favorites | | `Alt` `Shift` `I` | Inspect current file | | `Ctrl` \` | Quick switch current scheme | | `Ctrl` `Alt` `S` | Open Settings dialog | | `Ctrl` `Alt` `Shift` `S` | Open Project Structure dialog | | `Ctrl` `Shift` `A` | Find Action | | `Ctrl` `Tab` | Switch between tool and tabs | {.shortcuts} ================================================ FILE: source/_posts/ini.md ================================================ --- title: INI date: 2022-12-30 09:51:44 background: bg-[#6d94c7] tags: categories: - Programming intro: | This is a quick reference cheat sheet for understanding and writing INI-format configuration files. plugins: - copyCode --- ## Getting Started ### Introduction - INI is a configuration file with a fixed standard format - Base elements are keys or properties - Each key consists of a **name** and a **value**, separated by an equal sign (`=`) - **key name** is displayed to the **left side** of the equals sign - Equal sign (`=`) and semicolon (`;`) are **reserved** characters - INI configuration method comes from the MS-DOS operating system Now an informal standard for many configurations, other operating systems may use `.conf` or `.cfg` as a suffix ### Example ```ini ; Here are the comments [owner] name=John Doe organization=Acme Products [database] ; Here are the comments server=192.0.2.42 port=143 file="acme payroll.dat" [section.subsection] foo = bar ``` ### Comments Comment (`;`) ```ini ; This is the comment text and will be ignored ``` Comment (`#`) ```ini # Here is the comment text, ⚠️ Some compilers support it ``` Comments after a line (`;`,`#`) _(not standard)_ ```ini var = a ; this is an inline comment foo = bar # this is another inline comment ``` Comments must appear alone on lines in some cases ### Sections - The name appears on a line by itself - Names are enclosed in square brackets `[` and `]` - No explicit `section end` delimiter - End at the next `section` declaration or at the end of the file - Section and attribute names are case insensitive ```ini [section] key1 = a key2 = b ``` The same as `JSON` below 👇 ```json { "section": { "key1": "a", "key2": "b" } } ``` ### Nesting (supported by some parsers) ```ini [section] domain = cheatsheets.zip [section.subsection] foo = bar ``` The same as `JSON` below 👇 ```json { "section": { "domain": "cheatsheets.zip" "subsection": { "foo": "bar" } } } ``` Nest to previous section (shorthand) ```ini [section] domain = cheatsheets.zip [.subsection] foo = bar ``` ### Escape character | sequence | meaning | | :------- | :----------------------------------------------------------------------------------------------- | | `\\` | \ (single backslash, escape escape character) | | `\'` | apostrophe | | `\"` | double quotes | | `\0` | null character | | `\a` | ringtone/alert/sound | | `\b` | Backspace, [Bell character] for some applications (https://en.wikipedia.org/wiki/Bell_character) | | `\t` | tab character | | `\r` | carriage return | | `\n` | newline | | `\;` | semicolon | | `\#` | number sign | | `\=` | equal sign | | `\:` | colon | | `\x????` | Unicode character for the hexadecimal code point corresponding to ???? | ### Array ```ini [section] domain = cheatsheets.zip array[]=first value array[]=second value ``` The same as `JSON` below 👇 ```json { "section": { "domain": "cheatsheets.zip", "array": ["first value", "second value"] } } ``` ### Interpreter - [@go-ini/ini](https://github.com/go-ini/ini) _(golang)_ - [@npm/ini](https://www.npmjs.com/package/ini) _(nodejs)_ - [@zonyitoo/rust-ini](https://github.com/zonyitoo/rust-inii) _(rust)_ - [@rxi/ini](https://www.npmjs.com/package/ini) _(c)_ - [@pulzed/mINI](https://github.com/pulzed/mINI) _(c++)_ - [@rickyah/ini-parser](https://github.com/rickyah/ini-parser) _(c#)_ - [@Enichan/Ini](https://github.com/Enichan/Ini) _(c#)_ ## See also - [INI file configuration](https://en.wikipedia.org/wiki/INI_file)_(wikipedia.org)_ ================================================ FILE: source/_posts/iso-639-1.md ================================================ --- title: ISO 639-1 Language Code date: 2022-01-11 17:21:54 tags: - code - i18n - language categories: - Other intro: | This is a list of the ISO language codes that conform to the ISO 639-1 standard, it provide reference for multi-language website. --- ## Getting Started {.cols-2} ### Introduction - The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) is a standardized nomenclature used to classify languages - The ISO 639-1 codes cover the world's major languages - These codes are a useful international and formal shorthand for indicating languages - Two-letter codes - Used to multilingual websites, aka Internationalization (`i18n`) - [i18n](https://en.wikipedia.org/wiki/Internationalization_and_localization) language codes {.marker-round} ### Multi-format of 639-1 codes - [Markdown Table](https://tableconvert.com/html-to-markdown?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [Template](https://tableconvert.com/html-to-template?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [LaTeX Table](https://tableconvert.com/html-to-latex?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [CSV](https://tableconvert.com/html-to-csv?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [Excel](https://tableconvert.com/html-to-excel?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [JSON Array](https://tableconvert.com/html-to-json?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [HTML Table](https://tableconvert.com/html-to-html?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [Insert SQL](https://tableconvert.com/html-to-sql?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [YAML Sequence](https://tableconvert.com/html-to-yaml?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [XML](https://tableconvert.com/html-to-xml?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [ASCII](https://tableconvert.com/html-to-ascii?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [MediaWiki Table](https://tableconvert.com/html-to-mediawiki?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [AsciiDoc Table](https://tableconvert.com/html-to-asciidoc?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [Jira Table](https://tableconvert.com/html-to-jira?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [Textile Table](https://tableconvert.com/html-to-textile?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [reStructuredText](https://tableconvert.com/html-to-restructuredtext?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [PHP Array](https://tableconvert.com/html-to-php?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [Ruby Array](https://tableconvert.com/html-to-ruby?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [ASP Array](https://tableconvert.com/html-to-asp?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [ActionScript](https://tableconvert.com/html-to-actionscript?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [BBCode](https://tableconvert.com/html-to-bbcode?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [PDF](https://tableconvert.com/html-to-pdf?data=https://cheatsheets.zip/iso-639-1#TableGenerator) - [JPEG](https://tableconvert.com/html-to-jpeg?data=https://cheatsheets.zip/iso-639-1#TableGenerator) {.cols-4 .marker-none} ## List of ISO 639-1 codes {.cols-1} ### Full codes | 639-1 code | ISO language name | Native name (endonym) | | ---------- | ------------------- | :-------------------- | | `aa` | Afar | Afaraf | | `ab` | Abkhaz | аҧсуа бызшәа | | `ae` | Avestan | avesta | | `af` | Afrikaans | Afrikaans | | `ak` | Akan | Akan | | `am` | Amharic | አማርኛ | | `an` | Aragonese | aragonés | | `ar` | Arabic | اللغة العربية | | `as` | Assamese | অসমীয়া | | `av` | Avaric | авар мацӀ | | `ay` | Aymara | aymar aru | | `az` | Azerbaijani | azərbaycan dili | | `ba` | Bashkir | башҡорт теле | | `be` | Belarusian | беларуская мова | | `bg` | Bulgarian | български език | | `bh` | Bihari | भोजपुरी | | `bi` | Bislama | Bislama | | `bm` | Bambara | bamanankan | | `bn` | Bengali | বাংলা | | `bo` | Tibetan | བོད་ཡིག | | `br` | Breton | brezhoneg | | `bs` | Bosnian | bosanski jezik | | `ca` | Catalan | Català | | `ce` | Chechen | нохчийн мотт | | `ch` | Chamorro | Chamoru | | `co` | Corsican | corsu | | `cr` | Cree | ᓀᐦᐃᔭᐍᐏᐣ | | `cs` | Czech | čeština | | `cu` | Old Church Slavonic | ѩзыкъ словѣньскъ | | `cv` | Chuvash | чӑваш чӗлхи | | `cy` | Welsh | Cymraeg | | `da` | Danish | dansk | | `de` | German | Deutsch | | `dv` | Divehi | Dhivehi | | `dz` | Dzongkha | རྫོང་ཁ | | `ee` | Ewe | Eʋegbe | | `el` | Greek | Ελληνικά | | `en` | English | English | | `eo` | Esperanto | Esperanto | | `es` | Spanish | Español | | `et` | Estonian | eesti | | `eu` | Basque | euskara | | `fa` | Persian | فارسی | | `ff` | Fula | Fulfulde | | `fi` | Finnish | suomi | | `fj` | Fijian | Vakaviti | | `fo` | Faroese | føroyskt | | `fr` | French | Français | | `fy` | Western Frisian | Frysk | | `ga` | Irish | Gaeilge | | `gd` | Scottish Gaelic | Gàidhlig | | `gl` | Galician | galego | | `gu` | Gujarati | ગુજરાતી | | `gv` | Manx | Gaelg | | `ha` | Hausa | هَوُسَ | | `he` | Hebrew | עברית | | `hi` | Hindi | हिन्दी | | `ho` | Hiri Motu | Hiri Motu | | `hr` | Croatian | Hrvatski | | `ht` | Haitian | Kreyòl ayisyen | | `hu` | Hungarian | magyar | | `hy` | Armenian | Հայերեն | | `hz` | Herero | Otjiherero | | `ia` | Interlingua | Interlingua | | `id` | Indonesian | Bahasa Indonesia | | `ie` | Interlingue | Interlingue | | `ig` | Igbo | Asụsụ Igbo | | `ii` | Nuosu | ꆈꌠ꒿ Nuosuhxop | | `ik` | Inupiaq | Iñupiaq | | `io` | Ido | Ido | | `is` | Icelandic | Íslenska | | `it` | Italian | Italiano | | `iu` | Inuktitut | ᐃᓄᒃᑎᑐᑦ | | `ja` | Japanese | 日本語 | | `jv` | Javanese | basa Jawa | | `ka` | Georgian | ქართული | | `kg` | Kongo | Kikongo | | `ki` | Kikuyu | Gĩkũyũ | | `kj` | Kwanyama | Kuanyama | | `kk` | Kazakh | қазақ тілі | | `kl` | Kalaallisut | kalaallisut | | `km` | Khmer | ខេមរភាសា | | `kn` | Kannada | ಕನ್ನಡ | | `ko` | Korean | 한국어 | | `kr` | Kanuri | Kanuri | | `ks` | Kashmiri | कश्मीरी | | `ku` | Kurdish | Kurdî | | `kv` | Komi | коми кыв | | `kw` | Cornish | Kernewek | | `ky` | Kyrgyz | Кыргызча | | `la` | Latin | latine | | `lb` | Luxembourgish | Lëtzebuergesch | | `lg` | Ganda | Luganda | | `li` | Limburgish | Limburgs | | `ln` | Lingala | Lingála | | `lo` | Lao | ພາສາ | | `lt` | Lithuanian | lietuvių kalba | | `lu` | Luba-Katanga | Tshiluba | | `lv` | Latvian | latviešu valoda | | `mg` | Malagasy | fiteny malagasy | | `mh` | Marshallese | Kajin M̧ajeļ | | `mi` | Māori | te reo Māori | | `mk` | Macedonian | македонски јазик | | `ml` | Malayalam | മലയാളം | | `mn` | Mongolian | Монгол хэл | | `mr` | Marathi | मराठी | | `ms` | Malay | Bahasa Malaysia | | `mt` | Maltese | Malti | | `my` | Burmese | ဗမာစာ | | `na` | Nauru | Ekakairũ Naoero | | `nb` | Norwegian Bokmål | Norsk bokmål | | `nd` | Northern Ndebele | isiNdebele | | `ne` | Nepali | नेपाली | | `ng` | Ndonga | Owambo | | `nl` | Dutch | Nederlands | | `nn` | Norwegian Nynorsk | Norsk nynorsk | | `no` | Norwegian | Norsk | | `nr` | Southern Ndebele | isiNdebele | | `nv` | Navajo | Diné bizaad | | `ny` | Chichewa | chiCheŵa | | `oc` | Occitan | occitan | | `oj` | Ojibwe | ᐊᓂᔑᓈᐯᒧᐎᓐ | | `om` | Oromo | Afaan Oromoo | | `or` | Oriya | ଓଡ଼ିଆ | | `os` | Ossetian | ирон æвзаг | | `pa` | Panjabi | ਪੰਜਾਬੀ | | `pi` | Pāli | पाऴि | | `pl` | Polish | Polski | | `ps` | Pashto | پښتو | | `pt` | Portuguese | Português | | `qu` | Quechua | Runa Simi | | `rm` | Romansh | rumantsch grischun | | `rn` | Kirundi | Ikirundi | | `ro` | Romanian | Română | | `ru` | Russian | Русский | | `rw` | Kinyarwanda | Ikinyarwanda | | `sa` | Sanskrit | संस्कृतम् | | `sc` | Sardinian | sardu | | `sd` | Sindhi | सिन्धी | | `se` | Northern Sami | Davvisámegiella | | `sg` | Sango | yângâ tî sängö | | `si` | Sinhala | සිංහල | | `sk` | Slovak | slovenčina | | `sl` | Slovenian | slovenščina | | `sn` | Shona | chiShona | | `so` | Somali | Soomaaliga | | `sq` | Albanian | Shqip | | `sr` | Serbian | српски језик | | `ss` | Swati | SiSwati | | `st` | Southern Sotho | Sesotho | | `su` | Sundanese | Basa Sunda | | `sv` | Swedish | Svenska | | `sw` | Swahili | Kiswahili | | `ta` | Tamil | தமிழ் | | `te` | Telugu | తెలుగు | | `tg` | Tajik | тоҷикӣ | | `th` | Thai | ไทย | | `ti` | Tigrinya | ትግርኛ | | `tk` | Turkmen | Türkmen | | `tl` | Tagalog | Wikang Tagalog | | `tn` | Tswana | Setswana | | `to` | Tonga | faka Tonga | | `tr` | Turkish | Türkçe | | `ts` | Tsonga | Xitsonga | | `tt` | Tatar | татар теле | | `tw` | Twi | Twi | | `ty` | Tahitian | Reo Tahiti | | `ug` | Uyghur | ئۇيغۇرچە | | `uk` | Ukrainian | Українська | | `ur` | Urdu | اردو | | `uz` | Uzbek | Ўзбек | | `ve` | Venda | Tshivenḓa | | `vi` | Vietnamese | Tiếng Việt | | `vo` | Volapük | Volapük | | `wa` | Walloon | walon | | `wo` | Wolof | Wollof | | `xh` | Xhosa | isiXhosa | | `yi` | Yiddish | ייִדיש | | `yo` | Yoruba | Yorùbá | | `za` | Zhuang | Saɯ cueŋƅ | | `zh` | Chinese | 中文 | | `zu` | Zulu | isiZulu | {.show-header} ================================================ FILE: source/_posts/java.md ================================================ --- title: Java date: 2021-03-10 19:50:01 background: bg-[#d33731] tags: - object-oriented - class categories: - Programming intro: | This cheat sheet is a crash course for Java beginners and help review the basic syntax of the Java language. plugins: - tooltip - copyCode --- ## Getting Started ### Hello.java {.row-span-2} ```java public class Hello { // main method public static void main(String[] args) { // Output: Hello, world! System.out.println("Hello, world!"); } } ``` Compiling and running ```bash $ javac Hello.java $ java Hello Hello, world! ``` ### Variables ```java int num = 5; float floatNum = 5.99f; char letter = 'D'; boolean bool = true; String site = "cheatsheets.zip"; ``` ### Primitive Data Types {.row-span-2} | Data Type | Size | Default | Range | | --------- | ------ | ------- | :------------------ | | `byte` | 1 byte | 0 | -128 ^to^ 127 | | `short` | 2 byte | 0 | -2^15^ ^to^ 2^15^-1 | | `int` | 4 byte | 0 | -2^31^ ^to^ 2^31^-1 | | `long` | 8 byte | 0 | -2^63^ ^to^ 2^63^-1 | | `float` | 4 byte | 0.0f | _N/A_ | | `double` | 8 byte | 0.0d | _N/A_ | | `char` | 2 byte | \\u0000 | 0 ^to^ 65535 | | `boolean` | _N/A_ | false | true / false | {.show-header} ### Strings ```java String first = "John"; String last = "Doe"; String name = first + " " + last; System.out.println(name); ``` See: [Strings](#java-strings) ### Loops ```java String word = "CheatSheets"; for (char c: word.toCharArray()) { System.out.print(c + "-"); } // Outputs: C-h-e-a-t-S-h-e-e-t-s- ``` See: [Loops](#java-loops) ### Arrays ```java char[] chars = new char[10]; chars[0] = 'a' chars[1] = 'b' String[] letters = {"A", "B", "C"}; int[] mylist = {100, 200}; boolean[] answers = {true, false}; ``` See: [Arrays](#java-arrays) ### Swap ```java int a = 1; int b = 2; System.out.println(a + " " + b); // 1 2 int temp = a; a = b; b = temp; System.out.println(a + " " + b); // 2 1 ``` ### Type Casting ```java // Widening // byte'; } ``` ### Nested ```javascript for (let i = 0; i < 2; i += 1) { for (let j = 0; j < 3; j += 1) { console.log(`${i}-${j}`); } } ``` ### for...in loop ```javascript const fruits = ['apple', 'orange', 'banana']; // 1. Print only indexes for (let index in fruits) { console.log(index); } // => 0 // => 1 // => 2 // 2. Print only values for (let index in fruits) { console.log(fruits[index]); } // => apple // => orange // => banana // 3. Print index with value for (let index in fruits) { console.log(index, fruits[index]); } // => 0 apple // => 1 orange // => 2 banana ``` ### for...of loop ```javascript const fruits = ['apple', 'orange', 'banana']; for (let fruit of fruits) { console.log(fruit); } // => apple // => orange // => banana for (let [index, value] of fruits.entries()) { console.log(index, value); } // => 0 apple // => 1 orange // => 2 banana ``` ## JavaScript Iterators {.cols-2} ### Functions Assigned to Variables ```javascript let plusFive = (number) => { return number + 5; }; // f is assigned the value of plusFive let f = plusFive; plusFive(3); // 8 // Since f has a function value, it can be invoked. f(9); // 14 ``` ### Callback Functions ```javascript const isEven = (n) => { return n % 2 == 0; }; let printMsg = (evenFunc, num) => { const isNumEven = evenFunc(num); console.log(`${num} is an even number: ${isNumEven}.`); }; // Pass in isEven as the callback function printMsg(isEven, 4); // => 4 is an even number: True. ``` ### Array.reduce() ```javascript const numbers = [1, 2, 3, 4]; const sum = numbers.reduce((accumulator, curVal) => { return accumulator + curVal; }); console.log(sum); // 10 ``` ### Array.map() ```javascript const members = ['Taylor', 'Donald', 'Don', 'Natasha', 'Bobby']; const announcements = members.map((member) => { return member + ' joined the contest.'; }); console.log(announcements); ``` ### Array.forEach() ```javascript const numbers = [28, 77, 45, 99, 27]; numbers.forEach((number) => { console.log(number); }); ``` ### Array.filter() ```javascript const randomNumbers = [4, 11, 42, 14, 39]; const filteredArray = randomNumbers.filter((n) => { return n > 5; }); ``` ## JavaScript Objects {.cols-2} ### Accessing Properties ```javascript const apple = { color: 'Green', price: { bulk: '$3/kg', smallQty: '$4/kg' } }; console.log(apple.color); // => Green console.log(apple.price.bulk); // => $3/kg ``` ### Naming Properties ```javascript // Example of invalid key names const trainSchedule = { // Invalid because of the space between words. platform num: 10, // Expressions cannot be keys. 40 - 10 + 2: 30, // A + sign is invalid unless it is enclosed in quotations. +compartment: 'C' } ``` ### Non-existent properties ```javascript const classElection = { date: 'January 12' }; console.log(classElection.place); // undefined ``` ### Mutable {.row-span-2} ```javascript const student = { name: 'Sheldon', score: 100, grade: 'A' }; console.log(student); // { name: 'Sheldon', score: 100, grade: 'A' } delete student.score; student.grade = 'F'; console.log(student); // { name: 'Sheldon', grade: 'F' } student = {}; // TypeError: Assignment to constant variable. ``` ### Assignment shorthand syntax ```javascript const person = { name: 'Tom', age: '22' }; const { name, age } = person; console.log(name); // 'Tom' console.log(age); // '22' ``` ### Delete operator ```javascript const person = { firstName: 'Matilda', age: 27, hobby: 'knitting', goal: 'learning JavaScript' }; delete person.hobby; // or delete person[hobby]; console.log(person); /* { firstName: "Matilda" age: 27 goal: "learning JavaScript" } */ ``` ### Objects as arguments ```javascript const origNum = 8; const origObj = { color: 'blue' }; const changeItUp = (num, obj) => { num = 7; obj.color = 'red'; }; changeItUp(origNum, origObj); // Will output 8 since integers are passed by value. console.log(origNum); // Will output 'red' since objects are passed // by reference and are therefore mutable. console.log(origObj.color); ``` ### Shorthand object creation ```javascript const activity = 'Surfing'; const beach = { activity }; console.log(beach); // { activity: 'Surfing' } ``` ### this Keyword ```javascript const cat = { name: 'Pipey', age: 8, whatName() { return this.name; } }; console.log(cat.whatName()); // => Pipey ``` ### Factory functions ```javascript // A factory function that accepts 'name', // 'age', and 'breed' parameters to return // a customized dog object. const dogFactory = (name, age, breed) => { return { name: name, age: age, breed: breed, bark() { console.log('Woof!'); } }; }; ``` ### Object methods ```javascript const engine = { // method shorthand, with one argument start(adverb) { console.log(`The engine starts up ${adverb}...`); }, // anonymous arrow function expression with no arguments sputter: () => { console.log('The engine sputters...'); } }; engine.start('noisily'); engine.sputter(); ``` ### Getters and setters ```javascript const myCat = { _name: 'Dottie', get name() { return this._name; }, set name(newName) { this._name = newName; } }; // Reference invokes the getter console.log(myCat.name); // Assignment invokes the setter myCat.name = 'Yankee'; ``` ### Destructuring ```javascript const obj = { name: 'John Doe', age: 8 }; const { name, age } = obj; console.log(name); console.log(age); ``` ## JavaScript Classes ### Static Methods ```javascript class Dog { constructor(name) { this._name = name; } introduce() { console.log('This is ' + this._name + ' !'); } // A static method static bark() { console.log('Woof!'); } } const myDog = new Dog('Buster'); myDog.introduce(); // Calling the static method Dog.bark(); ``` ### Class ```javascript class Song { constructor() { this.title; this.author; } play() { console.log('Song playing!'); } } const mySong = new Song(); mySong.play(); ``` ### Class Constructor ```javascript class Song { constructor(title, artist) { this.title = title; this.artist = artist; } } const mySong = new Song('Bohemian Rhapsody', 'Queen'); console.log(mySong.title); ``` ### Class Methods ```javascript class Song { play() { console.log('Playing!'); } stop() { console.log('Stopping!'); } } ``` ### extends ```javascript // Parent class class Media { constructor(info) { this.publishDate = info.publishDate; this.name = info.name; } } // Child class class Song extends Media { constructor(songData) { super(songData); this.artist = songData.artist; } } const mySong = new Song({ artist: 'Queen', name: 'Bohemian Rhapsody', publishDate: 1975 }); ``` ## JavaScript Modules {.cols-2} ### Export ```javascript // myMath.js // Default export export default function add(x, y) { return x + y; } // Normal export export function subtract(x, y) { return x - y; } // Multiple exports function multiply(x, y) { return x * y; } function duplicate(x) { return x * 2; } export { multiply, duplicate }; ``` ### Import ```javascript // main.js import add, { subtract, multiply, duplicate } from './myMath.js'; console.log(add(6, 2)); // 8 console.log(subtract(6, 2)) // 4 console.log(multiply(6, 2)); // 12 console.log(duplicate(5)) // 10 // index.html ``` ### Export Module ```javascript // myMath.js function add(x, y) { return x + y; } function subtract(x, y) { return x - y; } function multiply(x, y) { return x * y; } function duplicate(x) { return x * 2; } // Multiple exports in node.js module.exports = { add, subtract, multiply, duplicate }; ``` ### Require Module ```javascript // main.js const myMath = require('./myMath.js'); console.log(myMath.add(6, 2)); // 8 console.log(myMath.subtract(6, 2)); // 4 console.log(myMath.multiply(6, 2)); // 12 console.log(myMath.duplicate(5)); // 10 ``` ## JavaScript Promises {.cols-2} ### Promise states {.row-span-2} ```javascript const promise = new Promise((resolve, reject) => { const res = true; // An asynchronous operation. if (res) { resolve('Resolved!'); } else { reject(Error('Error')); } }); promise.then( (res) => console.log(res), (err) => console.error(err) ); ``` ### Executor function ```javascript const executorFn = (resolve, reject) => { resolve('Resolved!'); }; const promise = new Promise(executorFn); ``` ### setTimeout() ```javascript const loginAlert = () => { console.log('Login'); }; setTimeout(loginAlert, 6000); ``` ### .then() method ```javascript const promise = new Promise((resolve, reject) => { setTimeout(() => { resolve('Result'); }, 200); }); promise.then( (res) => { console.log(res); }, (err) => { console.error(err); } ); ``` ### Promise.catch() ```javascript const promise = new Promise((resolve, reject) => { setTimeout(() => { reject(Error('Promise Rejected Unconditionally.')); }, 1000); }); promise.then((res) => { console.log(value); }); promise.catch((err) => { console.error(err); }); ``` ### Promise.all() ```javascript const promise1 = new Promise((resolve, reject) => { setTimeout(() => { resolve(3); }, 300); }); const promise2 = new Promise((resolve, reject) => { setTimeout(() => { resolve(2); }, 200); }); Promise.all([promise1, promise2]).then((res) => { console.log(res[0]); console.log(res[1]); }); ``` ### Promise.allSettled() ```javascript const promise1 = Promise.resolve(3); const promise2 = new Promise((resolve, reject) => { setTimeout(() => { reject(2); }, 100); }); Promise.allSettled([promise1, promise2]).then((res) => { console.log(res[0].status); console.log(res[1].status); }); ``` ### Avoiding nested Promise and .then() ```javascript const promise = new Promise((resolve, reject) => { setTimeout(() => { resolve('*'); }, 1000); }); const twoStars = (star) => { return star + star; }; const oneDot = (star) => { return star + '.'; }; const print = (val) => { console.log(val); }; // Chaining them all together promise.then(twoStars).then(oneDot).then(print); ``` ### Creating ```javascript const executorFn = (resolve, reject) => { console.log('The executor function of the promise!'); }; const promise = new Promise(executorFn); ``` ### Chaining multiple .then() ```javascript const promise = new Promise((resolve) => setTimeout(() => resolve('dAlan'), 100) ); promise .then((res) => { return res === 'Alan' ? Promise.resolve('Hey Alan!') : Promise.reject('Who are you?'); }) .then( (res) => { console.log(res); }, (err) => { console.error(err); } ); ``` ### Fake http Request with Promise ```javascript const mock = (success, timeout = 1000) => { return new Promise((resolve, reject) => { setTimeout(() => { if (success) { resolve({ status: 200, data: {} }); } else { reject({ message: 'Error' }); } }, timeout); }); }; const someEvent = async () => { try { await mock(true, 1000); } catch (e) { console.log(e.message); } }; ``` ## JavaScript Async-Await {.cols-2} ### Asynchronous ```javascript function helloWorld() { return new Promise((resolve) => { setTimeout(() => { resolve('Hello World!'); }, 2000); }); } const msg = async function () { //Async Function Expression const msg = await helloWorld(); console.log('Message:', msg); }; const msg1 = async () => { //Async Arrow Function const msg = await helloWorld(); console.log('Message:', msg); }; msg(); // Message: Hello World! <-- after 2 seconds msg1(); // Message: Hello World! <-- after 2 seconds ``` ### Resolving Promises ```javascript let pro1 = Promise.resolve(5); let pro2 = 44; let pro3 = new Promise(function (resolve, reject) { setTimeout(resolve, 100, 'foo'); }); Promise.all([pro1, pro2, pro3]).then(function (values) { console.log(values); }); // expected => Array [5, 44, "foo"] ``` ### Async Await Promises ```javascript function helloWorld() { return new Promise((resolve) => { setTimeout(() => { resolve('Hello World!'); }, 2000); }); } async function msg() { const msg = await helloWorld(); console.log('Message:', msg); } msg(); // Message: Hello World! <-- after 2 seconds ``` ### Error Handling ```javascript let json = '{ "age": 30 }'; // incomplete data try { let user = JSON.parse(json); // <-- no errors console.log(user.name); // no name! } catch (e) { console.error('Invalid JSON data!'); } ``` ### Aysnc await operator ```javascript function helloWorld() { return new Promise((resolve) => { setTimeout(() => { resolve('Hello World!'); }, 2000); }); } async function msg() { const msg = await helloWorld(); console.log('Message:', msg); } msg(); // Message: Hello World! <-- after 2 seconds ``` ## JavaScript Requests ### JSON ```json const jsonObj = { "name": "Rick", "id": "11A", "level": 4 }; ``` Also see: [JSON cheatsheet](/json) ### XMLHttpRequest ```javascript const xhr = new XMLHttpRequest(); xhr.open('GET', 'mysite.com/getjson'); ``` `XMLHttpRequest` is a browser-level API that enables the client to script data transfers via JavaScript, NOT part of the JavaScript language. ### GET ```javascript const req = new XMLHttpRequest(); req.responseType = 'json'; req.open('GET', '/getdata?id=65'); req.onload = () => { console.log(xhr.response); }; req.send(); ``` ### POST {.row-span-2} ```javascript const data = { fish: 'Salmon', weight: '1.5 KG', units: 5 }; const xhr = new XMLHttpRequest(); xhr.open('POST', '/inventory/add'); xhr.responseType = 'json'; xhr.send(JSON.stringify(data)); xhr.onload = () => { console.log(xhr.response); }; ``` ### fetch api {.row-span-2} ```javascript fetch(url, { method: 'POST', headers: { 'Content-type': 'application/json', 'apikey': apiKey }, body: data }).then(response => { if (response.ok) { return response.json(); } throw new Error('Request failed!'); }, networkError => { console.log(networkError.message) }) } ``` ### JSON Formatted ```javascript fetch('url-that-returns-JSON') .then((response) => response.json()) .then((jsonResponse) => { console.log(jsonResponse); }); ``` ### promise url parameter fetch api ```javascript fetch('url') .then( response => { console.log(response); }, rejection => { console.error(rejection.message); ); ``` ### Fetch API Function ```javascript fetch('https://api-xxx.com/endpoint', { method: 'POST', body: JSON.stringify({ id: '200' }) }) .then( (response) => { if (response.ok) { return response.json(); } throw new Error('Request failed!'); }, (networkError) => { console.log(networkError.message); } ) .then((jsonResponse) => { console.log(jsonResponse); }); ``` ### async await syntax {.col-span-2} ```javascript const getSuggestions = async () => { const wordQuery = inputField.value; const endpoint = `${url}${queryParams}${wordQuery}`; try { const response = await fetch(endpoint, { cache: 'no-cache' }); if (response.ok) { const jsonResponse = await response.json(); } } catch (error) { console.log(error); } }; ``` ================================================ FILE: source/_posts/jest.md ================================================ --- title: Jest Cheat Sheet date: 2022-09-09 00:00:00 background: bg-blue-500 description: A complete cheat sheet on Jest for testing React applications effectively. tags: React Testing Jest categories: - Testing intro: Jest is a JavaScript testing framework designed by Facebook. It works out of the box with modern JavaScript apps especially those built with React or Node.js. Its main goal is to simplify testing by providing all required features in one package test runner, assertion library, mocking, spies, coverage reports, and snapshot testing. --- --- ## A Quick Overview to Jest Jest is a delightful JavaScript testing framework maintained by Facebook. It is widely used for **unit testing**, **integration testing**, and even **end-to-end testing** in modern JavaScript and Node.js applications. Jest comes with a powerful set of features, including a built-in test runner, assertion library, mocking utilities, snapshot testing, and test coverage reporting. This guide targets **Jest v20** and gives a concise yet practical overview of how to use it effectively. ### Key Concepts Explained - **`describe()`**: Used to group related test cases into a test suite. - **`test()` / `it()`**: Define a single test case. `it()` is just a BDD-style alias for `test()`. - **`expect()`**: Assertion library that checks whether a value meets expectations. - **`beforeEach()` / `afterEach()`**: Runs code before or after every test in a suite. - **`beforeAll()` / `afterAll()`**: Runs setup/teardown code once before or after all tests. - **`.only` / `.skip`**: Focus or ignore specific tests/suites. - **Snapshot testing**: Captures the rendered output and compares it across test runs. - **Mock functions**: Simulate function behavior or monitor how functions are called. - **Timer mocks**: Test time-based behavior like `setTimeout()` and `setInterval()`. - **Async testing**: Write tests that handle Promises or `async/await`. --- ### 🚀 Quick Start ```bash npm install --save-dev jest babel-jest ``` Add this to your `package.json`: ```json "scripts": { "test": "jest" } ``` Run your tests: ```bash npm test -- --watch ``` 📖 See: [Getting Started](https://jestjs.io/docs/getting-started) --- ## ✍️ Writing Tests ```js describe('My work', () => { test('works', () => { expect(2).toEqual(2); }); }); ``` - **describe**: Group related tests. - **test** or **it**: Define individual test cases. - **expect**: Make assertions. 🔄 `it()` is an alias for `test()`. --- ## 🔧 Setup Hooks Use these for setup/teardown routines: ```js beforeEach(() => { ... }); afterEach(() => { ... }); beforeAll(() => { ... }); afterAll(() => { ... }); ``` --- ## 🎯 Focusing or Skipping Tests **Focusing tests:** ```js describe.only(...); it.only(...); // or fit() ``` **Skipping tests:** ```js describe.skip(...); it.skip(...); // or xit() ``` --- ## 🏁 Optional CLI Flags | Flag | Description | | --------------------- | --------------------------------------- | | `--coverage` | Show test coverage summary | | `--detectOpenHandles` | Detect unclosed handles (e.g., sockets) | | `--runInBand` | Run tests serially (useful for CI) | --- ## ✅ Expectations (Matchers) ### Basic ```js expect(value).not.toBe(value); expect(value).toEqual(value); expect(value).toBeTruthy(); ``` > Note: `toEqual` performs deep equality. ### Snapshots ```js expect(value).toMatchSnapshot(); expect(value).toMatchInlineSnapshot(); ``` > Inline snapshots require Prettier. ### Errors ```js expect(fn).toThrow(error); expect(fn).toThrowErrorMatchingSnapshot(); ``` ### Booleans ```js expect(value).toBeFalsy(); expect(value).toBeNull(); expect(value).toBeTruthy(); expect(value).toBeUndefined(); expect(value).toBeDefined(); ``` ### Numbers ```js expect(value).toBeCloseTo(number, digits); expect(value).toBeGreaterThan(number); expect(value).toBeLessThanOrEqual(number); ``` ### Objects ```js expect(value).toBeInstanceOf(Class); expect(value).toMatchObject(obj); expect(value).toHaveProperty('key', value); ``` ### Arrays/Strings ```js expect(value).toContain(item); expect(value).toHaveLength(number); expect(value).toMatch(/pattern/); ``` ### Custom Matchers ```js expect.extend(customMatchers); expect.any(Constructor); expect.assertions(1); ``` --- ## ⏱️ Async Tests ### Promises ```js test('resolves correctly', () => { return somePromise().then(data => { expect(data).toEqual(...); }); }); ``` ### Async/Await ```js test('awaits correctly', async () => { const result = await asyncFunc(); expect(result).toBe(...); }); ``` 📖 See: [Jest Async Testing](https://jestjs.io/docs/asynchronous) --- ## 📸 Snapshot Testing ```js it('renders correctly', () => { const output = something(); expect(output).toMatchSnapshot(); }); ``` For React components: ```js import renderer from 'react-test-renderer'; it('matches snapshot', () => { const tree = renderer.create( \` | Cancel Form |
{.shortcuts}
### Agile Shortcuts
| Shortcut | Action |
| -------- | ----------------------------- |
| `J` | Next Issue |
| `K` | Previous Issue |
| `N` | Next Column |
| `P` | Previous Column |
| `-` | Expand/Collapse All Swimlanes |
| `T` | Hide/Show Detail View |
| `O` | View Issue |
| `Enter` | Add a New Line |
| `Enter` | Submit changes |
| `Esc` | Cancel changes |
| `I` | Assign to Me |
| `S` `T` | Send to Top |
| `S` `B` | Send to Bottom |
| `E` | Edit Issue |
| `Z` | Projector Mode |
{.shortcuts}
### Issue Actions and Navigator Shortcuts
| Shortcut | Action |
| -------- | ---------------------- |
| `O` | View selected issue |
| `J` | Next Issue |
| `K` | Previous Issue |
| `U` | Back to the Navigator |
| `[` | Hide/Show Left Section |
| `N` | Next Activity |
| `P` | Previous Activity |
| `F` | Focus search field |
| `Esc` | Escape field |
| `E` | Edit Issue |
| `A` | Assign Issue |
| `M` | Comment on Issue |
| `L` | Edit Issue Labels |
| `S` | Share Issue |
| `.` | Operations dialog box |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Atlassian's Jira](https://confluence.atlassian.com/agile066/jira-agile-user-s-guide/using-keyboard-shortcuts)
_(confluence.atlassian.com)_
================================================
FILE: source/_posts/jquery.md
================================================
---
title: jQuery
date: 2020-12-24 21:08:21
background: bg-[#2c63a2]
tags:
- web
- js
- javascript
- library
categories:
- Programming
intro: |
This [jQuery](https://jquery.com/) cheat sheet is a great reference for both beginners and experienced developers.
plugins:
- tooltip
- copyCode
- runCode
---
## Getting Started
### Including jQuery
```html {.wrap}
```
#### Official CDN
```html {.wrap}
```
### jQuery syntax
```javascript
$(selector).methodOrFunction();
```
#### Example:
```javascript
$('#menu').on('click', function () {
$(this).hide();
});
$('body').css('background', 'red');
```
### jQuery document ready
```javascript
$(document).ready(function () {
// Runs after the DOM is loaded.
alert('DOM fully loaded!');
});
```
```javascript
$(function () {
// Runs after the DOM is loaded.
alert('DOM fully loaded!');
});
```
## jQuery Selectors
### Examples {.secondary}
```javascript
$('button').click(() => {
$(':button').css('color', 'red');
});
```
#### Combining selectors
```javascript
$('selector1, selector2 ...selectorn');
```
### Basics
- [*](https://api.jquery.com/all-selector/){data-tooltip="Selects all elements."}
- [.class](https://api.jquery.com/class-selector/){data-tooltip="Selects all elements with the given class. "}
- [element](https://api.jquery.com/element-selector/){data-tooltip="Selects all elements with the given tag name."}
- [#id](https://api.jquery.com/id-selector/){data-tooltip="Selects a single element with the given id attribute. "}
- [:hidden](https://api.jquery.com/hidden-selector/){data-tooltip="Selects all elements that are hidden."}
- [:visible](https://api.jquery.com/visible-selector/){data-tooltip="Selects all elements that are visible."}
- [:contains()](https://api.jquery.com/contains-selector/){data-tooltip="Select all elements that contain the specified text."}
- [:empty](https://api.jquery.com/empty-selector/){data-tooltip="Select all elements that have no children (including text nodes)."}
- [:has()](https://api.jquery.com/has-selector/){data-tooltip="Selects elements which contain at least one element that matches the specified selector."}
- [:parent](https://api.jquery.com/parent-selector/){data-tooltip="Select all elements that have at least one child node (either an element or text)."}
- [parent > child](https://api.jquery.com/child-selector/){data-tooltip="Selects all direct child elements specified by child of elements specified by parent."}
- [ancestor descendant](https://api.jquery.com/descendant-selector/){data-tooltip="Selects all elements that are descendants of a given ancestor."}
- [prev + next](https://api.jquery.com/next-adjacent-selector/){data-tooltip="Selects all next elements matching next that are immediately preceded by a sibling prev."}
- [prev ~ siblings](https://api.jquery.com/next-siblings-selector/){data-tooltip="Selects all sibling elements that follow after the prev element, have the same parent, and match the filtering siblings selector."}
{.marker-none .cols-3}
### Basic Filters
- [:animated](https://api.jquery.com/animated-selector/){data-tooltip="Select all elements that are in the progress of an animation at the time the selector is run."}
- [:eq()](https://api.jquery.com/eq-selector/){data-tooltip="Select the element at index n within the matched set."}
- [:even](https://api.jquery.com/even-selector/){data-tooltip="Selects even elements, zero-indexed. See also :odd."}
- [:first](https://api.jquery.com/first-selector/){data-tooltip="Selects the first matched DOM element."}
- [:gt()](https://api.jquery.com/gt-selector/){data-tooltip="Select all elements at an index greater than index within the matched set."}
- [:header](https://api.jquery.com/header-selector/){data-tooltip="Selects all elements that are headers, like h1, h2, h3 and so on."}
- [:lang()](https://api.jquery.com/lang-selector/){data-tooltip="Selects all elements of the specified language."}
- [:last](https://api.jquery.com/last-selector/){data-tooltip="Selects the last matched element."}
- [:lt()](https://api.jquery.com/lt-selector/){data-tooltip="Select all elements at an index less than index within the matched set."}
- [:not()](https://api.jquery.com/not-selector/){data-tooltip="Selects all elements that do not match the given selector."}
- [:odd](https://api.jquery.com/odd-selector/){data-tooltip="Selects odd elements, zero-indexed. See also :even."}
- [:root](https://api.jquery.com/root-selector/){data-tooltip="Selects the element that is the root of the document."}
- [:target](https://api.jquery.com/target-selector/){data-tooltip="Selects the target element indicated by the fragment identifier of the document's URI."}
{.marker-none .cols-3}
### Attribute
- [[name|="value"]](https://api.jquery.com/attribute-contains-prefix-selector/){data-tooltip="Selects elements that have the specified attribute with a value either equal to a given string or starting with that string followed by a hyphen (-)."}
- [[name*="value"]](https://api.jquery.com/attribute-contains-selector/){data-tooltip="Selects elements that have the specified attribute with a value containing a given substring."}
- [[name~="value"]](https://api.jquery.com/attribute-contains-word-selector/){data-tooltip="Selects elements that have the specified attribute with a value containing a given word, delimited by spaces."}
- [[name$="value"]](https://api.jquery.com/attribute-ends-with-selector/){data-tooltip="Selects elements that have the specified attribute with a value ending exactly with a given string. The comparison is case sensitive."}
- [[name="value"]](https://api.jquery.com/attribute-equals-selector/){data-tooltip="Selects elements that have the specified attribute with a value exactly equal to a certain value."}
- [[name!="value"]](https://api.jquery.com/attribute-not-equal-selector/){data-tooltip="Select elements that either don't have the specified attribute, or do have the specified attribute but not with a certain value."}
- [[name^="value"]](https://api.jquery.com/attribute-starts-with-selector/){data-tooltip="Selects elements that have the specified attribute with a value beginning exactly with a given string."}
- [[name]](https://api.jquery.com/has-attribute-selector/){data-tooltip="Selects elements that have the specified attribute, with any value. "}
- [[name="value"][name2="value2"]](https://api.jquery.com/multiple-attribute-selector/){data-tooltip="Matches elements that match all of the specified attribute filters."} {.col-span-2}
{.marker-none .cols-2}
### Child Filters
- [:first-child](https://api.jquery.com/first-child-selector/){data-tooltip="Selects all elements that are the first child of their parent."}
- [:first-of-type](https://api.jquery.com/first-of-type-selector/){data-tooltip="Selects all elements that are the first among siblings of the same element name."}
- [:last-child](https://api.jquery.com/last-child-selector/){data-tooltip="Selects all elements that are the last child of their parent."}
- [:last-of-type](https://api.jquery.com/last-of-type-selector/){data-tooltip="Selects all elements that are the last among siblings of the same element name."}
- [:nth-child()](https://api.jquery.com/nth-child-selector/){data-tooltip="Selects all elements that are the nth-child of their parent."}
- [:nth-last-child()](https://api.jquery.com/nth-last-child-selector/){data-tooltip="Selects all elements that are the nth-child of their parent, counting from the last element to the first."}
- [:nth-last-of-type()](https://api.jquery.com/nth-last-of-type-selector/){data-tooltip="Selects all the elements that are the nth-child of their parent in relation to siblings with the same element name, counting from the last element to the first."}
- [:nth-of-type()](https://api.jquery.com/nth-of-type-selector/){data-tooltip="Selects all elements that are the nth child of their parent in relation to siblings with the same element name."}
- [:only-child](https://api.jquery.com/only-child-selector/){data-tooltip="Selects all elements that are the only child of their parent."}
- [:only-of-type()](https://api.jquery.com/only-of-type-selector/){data-tooltip="Selects all elements that have no siblings with the same element name."}
{.marker-none .cols-2}
### Forms
- [:button](https://api.jquery.com/button-selector/){data-tooltip="Selects all button elements and elements of type button."}
- [:checkbox](https://api.jquery.com/checkbox-selector/){data-tooltip="Selects all elements of type checkbox."}
- [:checked](https://api.jquery.com/checked-selector/){data-tooltip="Matches all elements that are checked or selected."}
- [:disabled](https://api.jquery.com/disabled-selector/){data-tooltip="Selects all elements that are disabled."}
- [:enabled](https://api.jquery.com/enabled-selector/){data-tooltip="Selects all elements that are enabled."}
- [:focus](https://api.jquery.com/focus-selector/){data-tooltip="Selects element if it is currently focused."}
- [:file](https://api.jquery.com/file-selector/){data-tooltip="Selects all elements of type file."}
- [:image](https://api.jquery.com/image-selector/){data-tooltip="Selects all elements of type image."}
- [:input](https://api.jquery.com/input-selector/){data-tooltip="Selects all input, textarea, select and button elements."}
- [:password](https://api.jquery.com/password-selector/){data-tooltip="Selects all elements of type password."}
- [:radio](https://api.jquery.com/radio-selector/){data-tooltip="Selects all elements of type radio."}
- [:reset](https://api.jquery.com/reset-selector/){data-tooltip="Selects all elements of type reset."}
- [:selected](https://api.jquery.com/selected-selector/){data-tooltip="Selects all elements that are selected."}
- [:submit](https://api.jquery.com/submit-selector/){data-tooltip="Selects all elements of type submit."}
- [:text](https://api.jquery.com/text-selector/){data-tooltip="Selects all input elements of type text."}
{.marker-none .cols-3}
## jQuery Attributes
### Examples {.secondary .row-span-2}
```javascript
$('h2').css({
color: 'blue',
backgroundColor: 'gray',
fontSize: '24px'
});
```
#### jQuery addClass
```javascript
$('.button').addClass('active');
```
#### jQuery removeClass
```javascript
$('.button').on('mouseleave', (evt) => {
let e = evt.currentTarget;
$(e).removeClass('active');
});
```
#### jQuery .toggleClass
```javascript
$('.choice').toggleClass('highlighted');
```
### Attributes
- [.attr()](https://api.jquery.com/attr/){data-tooltip="Get the value of an attribute for the first element in the set of matched elements."}
- [.prop()](https://api.jquery.com/prop/){data-tooltip="Get the value of a property for the first element in the set of matched elements."}
- [.removeAttr()](https://api.jquery.com/removeAttr/){data-tooltip="Remove an attribute from each element in the set of matched elements."}
- [.removeProp()](https://api.jquery.com/removeProp/){data-tooltip="Remove a property for the set of matched elements."}
- [.val()](https://api.jquery.com/val/){data-tooltip="Get the current value of the first element in the set of matched elements."}
{.marker-none .cols-2}
#### Data
- [jQuery.data()](https://api.jquery.com/jQuery.data/){data-tooltip="Store arbitrary data associated with the specified element. Returns the value that was set."}
- [.data()](https://api.jquery.com/data/){data-tooltip="Store arbitrary data associated with the matched elements."}
- [jQuery.hasData()](https://api.jquery.com/jQuery.hasData/){data-tooltip="Determine whether an element has any jQuery data associated with it."}
- [jQuery.removeData()](https://api.jquery.com/jQuery.removeData/){data-tooltip="Remove a previously-stored piece of data."}
- [.removeData()](https://api.jquery.com/removeData/){data-tooltip="Remove a previously-stored piece of data."}
{.marker-none .cols-2}
### CSS
- [.addClass()](https://api.jquery.com/addClass/){data-tooltip="Adds the specified class(es) to each element in the set of matched elements."}
- [.hasClass()](https://api.jquery.com/hasClass/){data-tooltip="Determine whether any of the matched elements are assigned the given class."}
- [.removeClass()](https://api.jquery.com/removeClass/){data-tooltip="Remove a single class, multiple classes, or all classes from each element in the set of matched elements."}
- [.toggleClass()](https://api.jquery.com/toggleClass/){data-tooltip="Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument."}
- [.css()](https://api.jquery.com/css/){data-tooltip="Get the computed style properties for the first element in the set of matched elements."}
- [jQuery.cssHooks](https://api.jquery.com/jQuery.cssHooks/){data-tooltip="Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties."}
- [jQuery.cssNumber](https://api.jquery.com/jQuery.cssNumber/){data-tooltip="An object containing all CSS properties that may be used without a unit. The .css() method uses this object to see if it may append px to unitless values."}
- [jQuery.escapeSelector()](https://api.jquery.com/jQuery.escapeSelector/){data-tooltip="Escapes any character that has a special meaning in a CSS selector."}
{.marker-none .cols-2}
### Dimensions
- [.height()](https://api.jquery.com/height/){data-tooltip="Get the current computed height for the first element in the set of matched elements."}
- [.innerHeight()](https://api.jquery.com/innerHeight/){data-tooltip="Get the current computed height for the first element in the set of matched elements, including padding but not border."}
- [.innerWidth()](https://api.jquery.com/innerWidth/){data-tooltip="Get the current computed inner width for the first element in the set of matched elements, including padding but not border."}
- [.outerHeight()](https://api.jquery.com/outerHeight/){data-tooltip="Get the current computed outer height (including padding, border, and optionally margin) for the first element in the set of matched elements."}
- [.outerWidth()](https://api.jquery.com/outerWidth/){data-tooltip="Get the current computed outer width (including padding, border, and optionally margin) for the first element in the set of matched elements."}
- [.width()](https://api.jquery.com/width/){data-tooltip="Get the current computed width for the first element in the set of matched elements."}
{.marker-none .cols-2}
### Offset
- [.offset()](https://api.jquery.com/offset/){data-tooltip="Get the current coordinates of the first element in the set of matched elements, relative to the document."}
- [.offsetParent()](https://api.jquery.com/offsetParent/){data-tooltip="Get the closest ancestor element that is positioned."}
- [.position()](https://api.jquery.com/position/){data-tooltip="Get the current coordinates of the first element in the set of matched elements, relative to the offset parent."}
- [.scrollLeft()](https://api.jquery.com/scrollLeft/){data-tooltip="Get the current horizontal position of the scroll bar for the first element in the set of matched elements."}
- [.scrollTop()](https://api.jquery.com/scrollTop/){data-tooltip="Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element."}
{.marker-none .cols-2}
## jQuery Manipulation
### Examples {.secondary .row-span-3}
```javascript
/*Span.*/
$('span').after('Paragraph. '); /*Span.Paragraph. */ /*Span.*/ $('Span.').replaceAll('p'); /*Span. */ /*This is span.*/ $('span').wrap(''); /*This is span. */ ``` ### Copying - [.clone()](https://api.jquery.com/clone/){data-tooltip="Create a deep copy of the set of matched elements."} {.marker-none .cols-3} ### DOM Insertion, Around - [.wrap()](https://api.jquery.com/wrap/){data-tooltip="Wrap an HTML structure around each element in the set of matched elements."} - [.wrapAll()](https://api.jquery.com/wrapAll/){data-tooltip="Wrap an HTML structure around all elements in the set of matched elements."} - [.wrapInner()](https://api.jquery.com/wrapInner/){data-tooltip="Wrap an HTML structure around the content of each element in the set of matched elements."} {.marker-none .cols-3} ### DOM Insertion, Inside - [.append()](https://api.jquery.com/append/){data-tooltip="Insert content, specified by the parameter, to the end of each element in the set of matched elements."} - [.appendTo()](https://api.jquery.com/appendTo/){data-tooltip="Insert every element in the set of matched elements to the end of the target."} - [.html()](https://api.jquery.com/html/){data-tooltip="Get the HTML contents of the first element in the set of matched elements."} - [.prepend()](https://api.jquery.com/prepend/){data-tooltip="Insert content, specified by the parameter, to the beginning of each element in the set of matched elements."} - [.prependTo()](https://api.jquery.com/prependTo/){data-tooltip="Insert every element in the set of matched elements to the beginning of the target."} - [.text()](https://api.jquery.com/text/){data-tooltip="Get the combined text contents of each element in the set of matched elements, including their descendants."} {.marker-none .cols-3} ### DOM Insertion, Outside - [.after()](https://api.jquery.com/after/){data-tooltip="Insert content, specified by the parameter, after each element in the set of matched elements."} - [.before()](https://api.jquery.com/before/){data-tooltip="Insert content, specified by the parameter, before each element in the set of matched elements."} - [.insertAfter()](https://api.jquery.com/insertAfter/){data-tooltip="Insert every element in the set of matched elements after the target."} - [.insertBefore()](https://api.jquery.com/insertBefore/){data-tooltip="Insert every element in the set of matched elements before the target."} {.marker-none .cols-3} ### DOM Removal - [.detach()](https://api.jquery.com/detach/){data-tooltip="Remove the set of matched elements from the DOM."} - [.empty()](https://api.jquery.com/empty/){data-tooltip="Remove all child nodes of the set of matched elements from the DOM."} - [.remove()](https://api.jquery.com/remove/){data-tooltip="Remove the set of matched elements from the DOM."} - [.unwrap()](https://api.jquery.com/unwrap/){data-tooltip="Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place."} {.marker-none .cols-3} ### DOM Replacement - [.replaceAll()](https://api.jquery.com/replaceAll/){data-tooltip="Replace each target element with the set of matched elements."} - [.replaceWith()](https://api.jquery.com/replaceWith/){data-tooltip="Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed."} {.marker-none .cols-3} ## jQuery Traversing ### Filtering - [.eq()](https://api.jquery.com/eq/){data-tooltip="Reduce the set of matched elements to the one at the specified index."} - [.filter()](https://api.jquery.com/filter/){data-tooltip="Reduce the set of matched elements to those that match the selector or pass the function's test. "} - [.first()](https://api.jquery.com/first/){data-tooltip="Reduce the set of matched elements to the first in the set."} - [.has()](https://api.jquery.com/has/){data-tooltip="Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element."} - [.is()](https://api.jquery.com/is/){data-tooltip="Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments."} - [.last()](https://api.jquery.com/last/){data-tooltip="Reduce the set of matched elements to the final one in the set."} - [.map()](https://api.jquery.com/map/){data-tooltip="Pass each element in the current matched set through a function, producing a new jQuery object containing the return values."} - [.not()](https://api.jquery.com/not/){data-tooltip="Remove elements from the set of matched elements."} - [.slice()](https://api.jquery.com/slice/){data-tooltip="Reduce the set of matched elements to a subset specified by a range of indices."} {.marker-none .cols-3} ### Miscellaneous Traversing - [.add()](https://api.jquery.com/add/){data-tooltip="Create a new jQuery object with elements added to the set of matched elements."} - [.addBack()](https://api.jquery.com/addBack/){data-tooltip="Add the previous set of elements on the stack to the current set, optionally filtered by a selector."} - [.andSelf()](https://api.jquery.com/andSelf/){data-tooltip="Add the previous set of elements on the stack to the current set."} - [.contents()](https://api.jquery.com/contents/){data-tooltip="Get the children of each element in the set of matched elements, including text and comment nodes."} - [.each()](https://api.jquery.com/each/){data-tooltip="Iterate over a jQuery object, executing a function for each matched element. "} - [.end()](https://api.jquery.com/end/){data-tooltip="End the most recent filtering operation in the current chain and return the set of matched elements to its previous state."} {.marker-none .cols-3} ### Tree Traversal - [.children()](https://api.jquery.com/children/){data-tooltip="Get the children of each element in the set of matched elements, optionally filtered by a selector."} - [.closest()](https://api.jquery.com/closest/){data-tooltip="For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree."} - [.find()](https://api.jquery.com/find/){data-tooltip="Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element."} - [.next()](https://api.jquery.com/next/){data-tooltip="Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector."} - [.nextAll()](https://api.jquery.com/nextAll/){data-tooltip="Get all following siblings of each element in the set of matched elements, optionally filtered by a selector."} - [.nextUntil()](https://api.jquery.com/nextUntil/){data-tooltip="Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed."} - [.parent()](https://api.jquery.com/parent/){data-tooltip="Get the parent of each element in the current set of matched elements, optionally filtered by a selector."} - [.parents()](https://api.jquery.com/parents/){data-tooltip="Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector."} - [.parentsUntil()](https://api.jquery.com/parentsUntil/){data-tooltip="Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object."} - [.prev()](https://api.jquery.com/prev/){data-tooltip="Get the immediately preceding sibling of each element in the set of matched elements. If a selector is provided, it retrieves the previous sibling only if it matches that selector."} - [.prevAll()](https://api.jquery.com/prevAll/){data-tooltip="Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector."} - [.prevUntil()](https://api.jquery.com/prevUntil/){data-tooltip="Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object."} - [.siblings()](https://api.jquery.com/siblings/){data-tooltip="Get the siblings of each element in the set of matched elements, optionally filtered by a selector."} {.marker-none .cols-3} ## jQuery Events ### Examples {.secondary .row-span-6} ```javascript // A mouse event 'click' $('#menu-button').on('click', () => { $('#menu').show(); }); // A keyboard event 'keyup' $('#textbox').on('keyup', () => { $('#menu').show(); }); // A scroll event 'scroll' $('#menu-button').on('scroll', () => { $('#menu').show(); }); ``` #### Event object ```javascript $('#menu').on('click', (event) => { $(event.currentTarget).hide(); }); ``` #### Method chaining ```javascript $('#menu-btn') .on('mouseenter', () => { $('#menu').show(); }) .on('mouseleave', () => { $('#menu').hide(); }); ``` #### Prevents the event ```javascript $('p').click(function (event) { event.stopPropagation(); // Do something }); ``` ### Browser Events - [.error()](https://api.jquery.com/error/){data-tooltip="Bind an event handler to the error JavaScript event."} - [.resize()](https://api.jquery.com/resize/){data-tooltip="Bind an event handler to the resize JavaScript event, or trigger that event on an element."} - [.scroll()](https://api.jquery.com/scroll/){data-tooltip="Bind an event handler to the scroll JavaScript event, or trigger that event on an element."} {.marker-none .cols-3} ### Event Object {.row-span-6} - [event.currentTarget](https://api.jquery.com/event.currentTarget/){data-tooltip=" The current DOM element within the event bubbling phase. "} - [event.delegateTarget](https://api.jquery.com/event.delegateTarget/){data-tooltip="The element where the currently-called jQuery event handler was attached."} - [event.data](https://api.jquery.com/event.data/){data-tooltip="An optional object of data passed to an event method when the current executing handler is bound. "} - [event.isDefaultPrevented()](https://api.jquery.com/event.isDefaultPrevented/){data-tooltip="Returns whether event.preventDefault() was ever called on this event object. "} - [event.isImmediatePropagationStopped()](https://api.jquery.com/event.isImmediatePropagationStopped/){data-tooltip=" Returns whether event.stopImmediatePropagation() was ever called on this event object. "} - [event.isPropagationStopped()](https://api.jquery.com/event.isPropagationStopped/){data-tooltip=" Returns whether event.stopPropagation() was ever called on this event object. "} - [event.metaKey](https://api.jquery.com/event.metaKey/){data-tooltip="Indicates whether the META key was pressed when the event fired."} - [event.namespace](https://api.jquery.com/event.namespace/){data-tooltip="The namespace specified when the event was triggered."} - [event.pageX](https://api.jquery.com/event.pageX/){data-tooltip="The mouse position relative to the left edge of the document."} - [event.pageY](https://api.jquery.com/event.pageY/){data-tooltip="The mouse position relative to the top edge of the document."} - [event.preventDefault()](https://api.jquery.com/event.preventDefault/){data-tooltip="If this method is called, the default action of the event will not be triggered."} - [event.relatedTarget](https://api.jquery.com/event.relatedTarget/){data-tooltip="The other DOM element involved in the event, if any."} - [event.result](https://api.jquery.com/event.result/){data-tooltip="The last value returned by an event handler that was triggered by this event, unless the value was undefined."} - [event.stopImmediatePropagation()](https://api.jquery.com/event.stopImmediatePropagation/){data-tooltip="Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree."} - [event.stopPropagation()](https://api.jquery.com/event.stopPropagation/){data-tooltip="Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event."} - [event.target](https://api.jquery.com/event.target/){data-tooltip=" The DOM element that initiated the event. "} - [event.timeStamp](https://api.jquery.com/event.timeStamp/){data-tooltip="The difference in milliseconds between the time the browser created the event and January 1, 1970."} - [event.type](https://api.jquery.com/event.type/){data-tooltip="Describes the nature of the event."} - [event.which](https://api.jquery.com/event.which/){data-tooltip="For key or mouse events, this property indicates the specific key or button that was pressed."} {.marker-none .cols-1} ### Document Loading - [.load()](https://api.jquery.com/load-event/){data-tooltip="Bind an event handler to the load JavaScript event."} - [.ready()](https://api.jquery.com/ready/){data-tooltip="Specify a function to execute when the DOM is fully loaded."} - [.unload()](https://api.jquery.com/unload/){data-tooltip="Bind an event handler to the unload JavaScript event."} {.marker-none .cols-3} ### Event Handler Attachment - [.bind()](https://api.jquery.com/bind/){data-tooltip="Attach a handler to an event for the elements."} - [.delegate()](https://api.jquery.com/delegate/){data-tooltip="Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements."} - [.die()](https://api.jquery.com/die/){data-tooltip="Remove event handlers previously attached using .live() from the elements."} - [.live()](https://api.jquery.com/live/){data-tooltip="Attach an event handler for all elements which match the current selector, now and in the future."} - [.off()](https://api.jquery.com/off/){data-tooltip="Remove an event handler."} - [.on()](https://api.jquery.com/on/){data-tooltip="Attach an event handler function for one or more events to the selected elements."} - [.one()](https://api.jquery.com/one/){data-tooltip="Attach a handler to an event for the elements. The handler is executed at most once per element per event type."} - [.trigger()](https://api.jquery.com/trigger/){data-tooltip="Execute all handlers and behaviors attached to the matched elements for the given event type."} - [.triggerHandler()](https://api.jquery.com/triggerHandler/){data-tooltip="Execute all handlers attached to an element for an event."} - [.unbind()](https://api.jquery.com/unbind/){data-tooltip="Remove a previously-attached event handler from the elements."} - [.undelegate()](https://api.jquery.com/undelegate/){data-tooltip="Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements."} {.marker-none .cols-3} ### Form Events - [.blur()](https://api.jquery.com/blur/){data-tooltip="Bind an event handler to the blur JavaScript event, or trigger that event on an element."} - [.change()](https://api.jquery.com/change/){data-tooltip="Bind an event handler to the change JavaScript event, or trigger that event on an element."} - [.focus()](https://api.jquery.com/focus/){data-tooltip="Bind an event handler to the focus JavaScript event, or trigger that event on an element."} - [.focusin()](https://api.jquery.com/focusin/){data-tooltip="Bind an event handler to the focusin event."} - [.focusout()](https://api.jquery.com/focusout/){data-tooltip="Bind an event handler to the focusout JavaScript event."} - [.select()](https://api.jquery.com/select/){data-tooltip="Bind an event handler to the select JavaScript event, or trigger that event on an element."} - [.submit()](https://api.jquery.com/submit/){data-tooltip="Bind an event handler to the submit JavaScript event, or trigger that event on an element."} {.marker-none .cols-3} ### Keyboard Events - [.keydown()](https://api.jquery.com/keydown/){data-tooltip="Bind an event handler to the keydown JavaScript event, or trigger that event on an element."} - [.keypress()](https://api.jquery.com/keypress/){data-tooltip="Bind an event handler to the keypress JavaScript event, or trigger that event on an element."} - [.keyup()](https://api.jquery.com/keyup/){data-tooltip="Bind an event handler to the keyup JavaScript event, or trigger that event on an element."} {.marker-none .cols-3} ### Mouse Events - [.click()](https://api.jquery.com/click/){data-tooltip="Bind an event handler to the click JavaScript event, or trigger that event on an element."} - [.contextMenu()](https://api.jquery.com/contextmenu/){data-tooltip="Bind an event handler to the contextmenu JavaScript event, or trigger that event on an element."} - [.dblclick()](https://api.jquery.com/dblclick/){data-tooltip="Bind an event handler to the dblclick JavaScript event, or trigger that event on an element."} - [.hover()](https://api.jquery.com/hover/){data-tooltip="Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements."} - [.mousedown()](https://api.jquery.com/mousedown/){data-tooltip="Bind an event handler to the mousedown JavaScript event, or trigger that event on an element."} - [.mouseenter()](https://api.jquery.com/mouseenter/){data-tooltip="Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element."} - [.mouseleave()](https://api.jquery.com/mouseleave/){data-tooltip="Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element."} - [.mousemove()](https://api.jquery.com/mousemove/){data-tooltip="Bind an event handler to the mousemove JavaScript event, or trigger that event on an element."} - [.mouseout()](https://api.jquery.com/mouseout/){data-tooltip="Bind an event handler to the mouseout JavaScript event, or trigger that event on an element."} - [.mouseover()](https://api.jquery.com/mouseover/){data-tooltip="Bind an event handler to the mouseover JavaScript event, or trigger that event on an element."} - [.mouseup()](https://api.jquery.com/mouseup/){data-tooltip="Bind an event handler to the mouseup JavaScript event, or trigger that event on an element."} - [.toggle()](https://api.jquery.com/toggle-event/){data-tooltip="Bind two or more handlers to the matched elements, to be executed on alternate clicks."} {.marker-none .cols-3} ## jQuery Effects ### Examples {.secondary .row-span-2} ```javascript $('#menu-button').on('click', () => { // $('#menu').fadeIn(400, 'swing') $('#menu').fadeIn(); }); ``` #### fadeOut effect ```javascript $('#menu-button').on('click', () => { // $('#menu').fadeOut(400, 'swing') $('#menu').fadeOut(); }); ``` ### Basics - [.hide()](https://api.jquery.com/hide/){data-tooltip="Hide the matched elements."} - [.show()](https://api.jquery.com/show/){data-tooltip="Display the matched elements."} - [.toggle()](https://api.jquery.com/toggle/){data-tooltip="Display or hide the matched elements."} {.marker-none .cols-3} ### Sliding - [.slideDown()](https://api.jquery.com/slideDown/){data-tooltip="Display the matched elements with a sliding motion."} - [.slideToggle()](https://api.jquery.com/slideToggle/){data-tooltip="Display or hide the matched elements with a sliding motion."} - [.slideUp()](https://api.jquery.com/slideUp/){data-tooltip="Hide the matched elements with a sliding motion."} {.marker-none .cols-3} ### Custom - [.animate()](https://api.jquery.com/animate/){data-tooltip="Perform a custom animation of a set of CSS properties."} - [.clearQueue()](https://api.jquery.com/clearQueue/){data-tooltip="Remove from the queue all items that have not yet been run."} - [.delay()](https://api.jquery.com/delay/){data-tooltip="Set a timer to delay execution of subsequent items in the queue."} - [.dequeue()](https://api.jquery.com/dequeue/){data-tooltip="Execute the next function on the queue for the matched elements."} - [jQuery.dequeue()](https://api.jquery.com/jQuery.dequeue/){data-tooltip="Execute the next function on the queue for the matched element."} - [.finish()](https://api.jquery.com/finish/){data-tooltip="Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements."} - [jQuery.fx.interval](https://api.jquery.com/jQuery.fx.interval/){data-tooltip="The rate (in milliseconds) at which animations fire."} - [jQuery.fx.off](https://api.jquery.com/jQuery.fx.off/){data-tooltip="Globally disable all animations."} - [jQuery.speed](https://api.jquery.com/jQuery.speed/){data-tooltip="Creates an object containing a set of properties ready to be used in the definition of custom animations."} - [.queue()](https://api.jquery.com/queue/){data-tooltip="Show the queue of functions to be executed on the matched elements."} - [jQuery.queue()](https://api.jquery.com/jQuery.queue/){data-tooltip="Show the queue of functions to be executed on the matched element."} - [.stop()](https://api.jquery.com/stop/){data-tooltip="Stop the currently-running animation on the matched elements."} {.marker-none .cols-3} ### Fading - [.fadeIn()](https://api.jquery.com/fadeIn/){data-tooltip="Display the matched elements by fading them to opaque."} - [.fadeOut()](https://api.jquery.com/fadeOut/){data-tooltip="Hide the matched elements by fading them to transparent."} - [.fadeTo()](https://api.jquery.com/fadeTo/){data-tooltip="Adjust the opacity of the matched elements."} - [.fadeToggle()](https://api.jquery.com/fadeToggle/){data-tooltip="Display or hide the matched elements by animating their opacity."} {.marker-none .cols-3} ## jQuery Ajax ### Examples {.secondary .row-span-2} ```javascript $.ajax({ url: this.action, type: this.method, data: $(this).serialize() }) .done(function (server_data) { console.log('success' + server_data); }) .fail(function (jqXHR, status, err) { console.log('fail' + err); }); ``` ### Global Ajax Event Handlers - [.ajaxComplete()](https://api.jquery.com/ajaxComplete/){data-tooltip="Register a handler to be called when Ajax requests complete. This is an AjaxEvent."} - [.ajaxError()](https://api.jquery.com/ajaxError/){data-tooltip="Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event."} - [.ajaxSend()](https://api.jquery.com/ajaxSend/){data-tooltip="Attach a function to be executed before an Ajax request is sent. This is an Ajax Event."} - [.ajaxStart()](https://api.jquery.com/ajaxStart/){data-tooltip="Register a handler to be called when the first Ajax request begins. This is an Ajax Event."} - [.ajaxStop()](https://api.jquery.com/ajaxStop/){data-tooltip="Register a handler to be called when all Ajax requests have completed. This is an Ajax Event."} - [.ajaxSuccess()](https://api.jquery.com/ajaxSuccess/){data-tooltip="Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event."} {.marker-none .cols-2} ### Helper Functions - [jQuery.param()](https://api.jquery.com/jQuery.param/){data-tooltip="Create a serialized representation of an array, a plain object, or a jQuery object suitable for use in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input elements with name/value properties."} - [.serialize()](https://api.jquery.com/serialize/){data-tooltip="Encode a set of form elements as a string for submission."} - [.serializeArray()](https://api.jquery.com/serializeArray/){data-tooltip="Encode a set of form elements as an array of names and values."} {.marker-none .cols-2} ### Low-Level Interface - [jQuery.ajax()](https://api.jquery.com/jQuery.ajax/){data-tooltip="Perform an asynchronous HTTP (Ajax) request."} - [jQuery.prefilter()](https://api.jquery.com/jQuery.ajaxPrefilter/){data-tooltip="Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax()."} - [jQuery.ajaxSetup()](https://api.jquery.com/jQuery.ajaxSetup/){data-tooltip="Set default values for future Ajax requests. Its use is not recommended."} - [jQuery.ajaxTransport()](https://api.jquery.com/jQuery.ajaxTransport/){data-tooltip="Creates an object that handles the actual transmission of Ajax data."} {.marker-none .cols-2} ### Shorthand Methods - [jQuery.get()](https://api.jquery.com/jQuery.get/){data-tooltip="Load data from the server using a HTTP GET request."} - [jQuery.getJSON()](https://api.jquery.com/jQuery.getJSON/){data-tooltip="Load JSON-encoded data from the server using a GET HTTP request."} - [jQuery.getScript()](https://api.jquery.com/jQuery.getScript/){data-tooltip="Load a JavaScript file from the server using a GET HTTP request, then execute it."} - [jQuery.post()](https://api.jquery.com/jQuery.post/){data-tooltip="Send data to the server using a HTTP POST request."} - [.load()](https://api.jquery.com/load/){data-tooltip="Load data from the server and place the returned HTML into the matched elements."} {.marker-none .cols-2} ## Miscellaneous ### jQuery Object - [jQuery()](https://api.jquery.com/jQuery/){data-tooltip="Accepts a string containing a CSS selector which is then used to match a set of elements."} - [jQuery.noConflict()](https://api.jquery.com/jQuery.noConflict/){data-tooltip="Relinquish jQuery's control of the $ variable."} - [jQuery.sub()](https://api.jquery.com/jQuery.sub/){data-tooltip="Creates a new copy of jQuery whose properties and methods can be modified without affecting the original jQuery object."} - [jQuery.holdReady()](https://api.jquery.com/jQuery.holdReady/){data-tooltip="Holds or releases the execution of jQuery's ready event."} - [jQuery.when()](https://api.jquery.com/jQuery.when/){data-tooltip="Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events."} {.marker-none .cols-2} ### Deferred Object {.row-span-2} - [jQuery.Deferred()](https://api.jquery.com/jQuery.Deferred/){data-tooltip=" A factory function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function."} - [deferred.always()](https://api.jquery.com/deferred.always/){data-tooltip=" Add handlers to be called when the Deferred object is either resolved or rejected. "} - [deferred.done()](https://api.jquery.com/deferred.done/){data-tooltip=" Add handlers to be called when the Deferred object is resolved. "} - [deferred.fail()](https://api.jquery.com/deferred.fail/){data-tooltip=" Add handlers to be called when the Deferred object is rejected. "} - [deferred.isRejected()](https://api.jquery.com/deferred.isRejected/){data-tooltip=" Determine whether a Deferred object has been rejected. "} - [deferred.isResolved()](https://api.jquery.com/deferred.isResolved/){data-tooltip=" Determine whether a Deferred object has been resolved. "} - [deferred.notify()](https://api.jquery.com/deferred.notify/){data-tooltip=" Call the progressCallbacks on a Deferred object with the given args. "} - [deferred.notifyWith()](https://api.jquery.com/deferred.notifyWith/){data-tooltip=" Call the progressCallbacks on a Deferred object with the given context and args. "} - [deferred.pipe()](https://api.jquery.com/deferred.pipe/){data-tooltip=" Utility method to filter and/or chain Deferreds. "} - [deferred.progress()](https://api.jquery.com/deferred.progress/){data-tooltip=" Add handlers to be called when the Deferred object generates progress notifications."} - [deferred.promise()](https://api.jquery.com/deferred.promise/){data-tooltip=" Return a Deferred's Promise object. "} - [deferred.reject()](https://api.jquery.com/deferred.reject/){data-tooltip=" Reject a Deferred object and call any failCallbacks with the given args. "} - [deferred.rejectWith()](https://api.jquery.com/deferred.rejectWith/){data-tooltip=" Reject a Deferred object and call any failCallbacks with the given context and args. "} - [deferred.resolve()](https://api.jquery.com/deferred.resolve/){data-tooltip=" Resolve a Deferred object and call any doneCallbacks with the given args. "} - [deferred.resolveWith()](https://api.jquery.com/deferred.resolveWith/){data-tooltip=" Resolve a Deferred object and call any doneCallbacks with the given context and args. "} - [deferred.state()](https://api.jquery.com/deferred.state/){data-tooltip="Determine the current state of a Deferred object. "} - [deferred.then()](https://api.jquery.com/deferred.then/){data-tooltip="Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. "} - [.promise()](https://api.jquery.com/promise/){data-tooltip=" Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. "} {.marker-none .cols-2} ### Utilities {.row-span-3} - [jQuery.boxModel](https://api.jquery.com/jQuery.boxModel/){data-tooltip="States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model."} - [jQuery.browser](https://api.jquery.com/jQuery.browser/){data-tooltip="Contains flags for the useragent, read from navigator.userAgent. This property was removed in jQuery 1.9 and is available only through the jQuery.migrate plugin. Please try to use feature detection instead."} - [jQuery.contains()](https://api.jquery.com/jQuery.contains/){data-tooltip="Check to see if a DOM element is a descendant of another DOM element."} - [jQuery.each()](https://api.jquery.com/jQuery.each/){data-tooltip="A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties."} - [jQuery.extend()](https://api.jquery.com/jQuery.extend/){data-tooltip="Merge the contents of two or more objects together into the first object."} - [jQuery.globalEval()](https://api.jquery.com/jQuery.globalEval/){data-tooltip="Execute some JavaScript code globally."} - [jQuery.grep()](https://api.jquery.com/jQuery.grep/){data-tooltip="Finds the elements of an array which satisfy a filter function. The original array is not affected."} - [jQuery.inArray()](https://api.jquery.com/jQuery.inArray/){data-tooltip="Search for a specified value within an array and return its index (or -1 if not found)."} - [jQuery.isArray()](https://api.jquery.com/jQuery.isArray/){data-tooltip="Determine whether the argument is an array."} - [jQuery.isEmptyObject()](https://api.jquery.com/jQuery.isEmptyObject/){data-tooltip="Check to see if an object is empty (contains no enumerable properties)."} - [jQuery.isFunction()](https://api.jquery.com/jQuery.isFunction/){data-tooltip="Determines if its argument is callable as a function."} - [jQuery.isNumeric()](https://api.jquery.com/jQuery.isNumeric/){data-tooltip="Determines whether its argument represents a JavaScript number."} - [jQuery.isPlainObject()](https://api.jquery.com/jQuery.isPlainObject/){data-tooltip="Check to see if an object is a plain object."} - [jQuery.isWindow()](https://api.jquery.com/jQuery.isWindow/){data-tooltip="Determine whether the argument is a window."} - [jQuery.isXMLDoc()](https://api.jquery.com/jQuery.isXMLDoc/){data-tooltip="Check to see if a DOM node is within an XML document (or is an XML document)."} - [jQuery.makeArray()](https://api.jquery.com/jQuery.makeArray/){data-tooltip="Convert an array-like object into a true JavaScript array."} - [jQuery.map()](https://api.jquery.com/jQuery.map/){data-tooltip="Translate all items in an array or object to new array of items."} - [jQuery.merge()](https://api.jquery.com/jQuery.merge/){data-tooltip="Merge the contents of two arrays together into the first array. "} - [jQuery.noop()](https://api.jquery.com/jQuery.noop/){data-tooltip="An empty function."} - [jQuery.now()](https://api.jquery.com/jQuery.now/){data-tooltip="Return a number representing the current time."} - [jQuery.parseHTML()](https://api.jquery.com/jQuery.parseHTML/){data-tooltip="Parses a string into an array of DOM nodes."} - [jQuery.parseJSON()](https://api.jquery.com/jQuery.parseJSON/){data-tooltip="Takes a well-formed JSON string and returns the resulting JavaScript value."} - [jQuery.parseXML()](https://api.jquery.com/jQuery.parseXML/){data-tooltip="Parses a string into an XML document."} - [jQuery.proxy()](https://api.jquery.com/jQuery.proxy/){data-tooltip="Takes a function and returns a new one that will always have a particular context."} - [jQuery.support](https://api.jquery.com/jQuery.support/){data-tooltip="A collection of properties that represent the presence of different browser features or bugs. Intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance. For your own project's feature-detection needs, we strongly recommend the use of an external library such as Modernizr instead of dependency on properties in jQuery.support."} - [jQuery.trim()](https://api.jquery.com/jQuery.trim/){data-tooltip="Remove the whitespace from the beginning and end of a string."} - [jQuery.type()](https://api.jquery.com/jQuery.type/){data-tooltip="Determine the internal JavaScript [[Class]] of an object."} - [jQuery.unique()](https://api.jquery.com/jQuery.unique/){data-tooltip="Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers."} - [jQuery.uniqueSort()](https://api.jquery.com/jQuery.uniqueSort/){data-tooltip="Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers."} {.marker-none .cols-2} ### DOM Element Methods - [.get()](https://api.jquery.com/get/){data-tooltip="Retrieve one of the elements matched by the jQuery object."} - [.index()](https://api.jquery.com/index/){data-tooltip="Search for a given element from among the matched elements."} - [.size()](https://api.jquery.com/size/){data-tooltip="Return the number of elements in the jQuery object."} - [.toArray()](https://api.jquery.com/toArray/){data-tooltip="Retrieve all the elements contained in the jQuery set, as an array."} {.marker-none .cols-2} ### Internals - [.jquery](https://api.jquery.com/jquery-2/){data-tooltip="A string containing the jQuery version number."} - [.context](https://api.jquery.com/context/){data-tooltip="The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document."} - [jQuery.error()](https://api.jquery.com/jQuery.error/){data-tooltip="Takes a string and throws an exception containing it."} - [.length](https://api.jquery.com/length/){data-tooltip="The number of elements in the jQuery object."} - [.pushStack()](https://api.jquery.com/pushStack/){data-tooltip="Add a collection of DOM elements onto the jQuery stack."} - [.selector](https://api.jquery.com/selector/){data-tooltip="A selector representing selector passed to jQuery(), if any, when creating the original set."} {.marker-none .cols-2} ### Callbacks Object - [jQuery.Callbacks()](https://api.jquery.com/jQuery.Callbacks/){data-tooltip="A multi-purpose callbacks list object that provides a powerful way to manage callback lists."} - [callbacks.add()](https://api.jquery.com/callbacks.add/){data-tooltip="Add a callback or a collection of callbacks to a callback list."} - [callbacks.disable()](https://api.jquery.com/callbacks.disable/){data-tooltip="Disable a callback list from doing anything more."} - [callbacks.disabled()](https://api.jquery.com/callbacks.disabled/){data-tooltip="Determine if the callbacks list has been disabled."} - [callbacks.empty()](https://api.jquery.com/callbacks.empty/){data-tooltip="Remove all of the callbacks from a list."} - [callbacks.fire()](https://api.jquery.com/callbacks.fire/){data-tooltip="Call all of the callbacks with the given arguments."} - [callbacks.fired()](https://api.jquery.com/callbacks.fired/){data-tooltip="Determine if the callbacks have already been called at least once."} - [callbacks.fireWith()](https://api.jquery.com/callbacks.fireWith/){data-tooltip="Call all callbacks in a list with the given context and arguments."} - [callbacks.has()](https://api.jquery.com/callbacks.has/){data-tooltip="Determine whether or not the list has any callbacks attached. If a callback is provided as an argument, determine whether it is in a list."} - [callbacks.lock()](https://api.jquery.com/callbacks.lock/){data-tooltip="Lock a callback list in its current state."} - [callbacks.locked()](https://api.jquery.com/callbacks.locked/){data-tooltip="Determine if the callbacks list has been locked."} - [callbacks.remove()](https://api.jquery.com/callbacks.remove/){data-tooltip="Remove a callback or a collection of callbacks from a callback list."} {.marker-none .cols-2} ================================================ FILE: source/_posts/json.md ================================================ --- title: JSON date: 2021-09-14 18:26:55 background: bg-[#646464] tags: - config - format categories: - Programming intro: | This is a quick reference cheat sheet for understanding and writing JSON format configuration files. plugins: - copyCode --- ## Getting Started ### Introduction [JSON](https://json.org/) is a lightweight text-based open standard designed for human-readable data interchange. - JSON stands for JavaScript Object Notation - JSON is easy to read and write. - JSON is language agnostic data-interchange format - JSON filename extension is `.json` - JSON Internet Media type is `application/json` {.marker-round} ### Examples ```json { "name": "Jason", "age": 39, "height": 1.92, "gender": "M", "salary": 70000, "married": true, "children": [ { "name": "Tom", "age": 9, "gender": "M" }, { "name": "Ava", "age": 7, "gender": "F" } ] } ``` ### Types | Type | Description | | --------- | :-------------------------------------- | | `Number` | Double precision floating-point | | `String` | Series of characters | | `Boolean` | `true` or `false` | | `Array` | Ordered sequence of values | | `Value` | String, Number, Boolean, null etc | | `Object` | Unordered collection of key/value pairs | | `null` | Null or Empty | ### String {.row-span-3} | | | | ---- | :------------------------- | | `\"` | Double quote | | `\\` | Backslash | | `\/` | Forward slash | | `\b` | Backspace | | `\f` | Form feed | | `\n` | Newline | | `\r` | Carriage return | | `\t` | Tab | | `\u` | Trailed by four hex digits | #### Examples ```json {.wrap} { "url": "https://cheatsheets.zip", "msg": "Hi,\n\"CheatSheets.zip\"", "intro": "Share quick reference and cheat sheet for developers." } ``` #### Invalid String ```json { "foo": "bar" } ``` Have to be delimited by double quotes ### Number {.row-span-2} | Type | Description | | ---------- | :------------------------------------- | | `Integer` | Digits 1-9, 0 and positive or negative | | `Fraction` | Fractions like 0.3, 3.9 | | `Exponent` | Exponent like e, e+, e-, E, E+, E | #### Examples ```json { "positive": 12, "negative": -1, "fraction": 10.25, "exponent": 1.0e2, "zero": 0 } ``` #### Invalid Number ```json { "foo": 0xff } ``` In JSON you can use only Decimal Literals ### Objects ```json { "color": "Purple", "id": "210", "composition": { "R": 70, "G": 39, "B": 89 }, "empty_object": {} } ``` Multiple key/value pairs separated by a comma ### Arrays ```json [1, 2, 3, 4, 5] ``` Begins with `[` and ends with `]` ### Array of objects ```json { "children": [ { "name": "Jimmy Smith", "age": 15 }, { "name": "Sammy Sosa", "age": 12 } ] } ``` ### Object of arrays ```json { "attributes": ["a1", "a2"], "methods": ["getter", "setter"], "empty_array": [] } ``` ### 2D Array ```json { "my_sequences": [ [1, 2, 3], [4, 5, 6], [7, 8, 9, 0], [10, 11] ] } ``` ### Object of objects ```json { "Mark McGwire": { "hr": 65, "avg": 0.278 }, "Sammy Sosa": { "hr": 63, "avg": 0.288 } } ``` ### Nested ```json { "Jack": { "id": 1, "name": "Franc", "salary": 25000, "hobby": ["a", "b"], "location": { "country": "A", "city": "A-A" } } } ``` ## Access JSON in JavaScript ### Access Object ```javascript let myObject = { name: 'Jason', last: 'Doe', age: 39, gender: 'M', salary: 70000, married: true }; ``` --- | | | | ------------------ | :-------- | | `myObject.name` | "Jason" | | `myObject["name"]` | "Jason" | | `myObject.age` | 39 | | `myObject.other` | undefined | | `myObject[0]` | undefined | ### Access Nested {.row-span-2} ```javascript let myObject = { ref: { name: 0, last: 1, age: 2, gender: 3, salary: 4, married: 5 }, jdoe: ['Jason', 'Doe', 39, 'M', 70000, true], jsmith: ['Tom', 'Smith', 42, 'F', 80000, true] }; ``` --- | | | | ------------------------ | :----------------------- | | `myObject.ref.age` | 2 | | `myObject["ref"]["age"]` | 2 | | `myObject.jdoe` | ["Jason", "Doe", 39 ...] | | `myObject.jsmith[3]` | "F" | | `myObject[1]` | undefined | ### Access Array of Objects {.row-span-2} ```javascript let myArray = [ { name: 'Jason', last: 'Doe', age: 39, gender: 'M', salary: 70000, married: true }, { name: 'Tom', last: 'Smith', age: 42, gender: 'F', salary: 80000, married: true }, { name: 'Amy', last: 'Burnquist', age: 29, gender: 'F', salary: 60000, married: false } ]; ``` --- | | | | ------------------- | :------------------------- | | `myArray[0]` | `{`"name": "Jason", ...`}` | | `myArray[1].name` | "Tom" | | `myArray[1][2]` | 42 | | `myArray[3]` | undefined | | `myArray[3].gender` | TypeError: Cannot read... | ### Access Array ```javascript let myArray = ['Jason', 'Doe', 39, 'M', 70000, true]; ``` --- | | | | ------------ | :-------- | | `myArray[1]` | "Doe" | | `myArray[5]` | true | | `myArray[6]` | undefined | ## Also see {.cols-1} - [JSON](https://www.json.org/json-en.html) _(json.org)_ - [JSON Editor Online](http://jsoneditoronline.org/) _(jsoneditoronline.org)_ - [Convert JSON Array to Markdown Table, CSV and more](https://tableconvert.com/json-to-markdown) _(tableconvert.com)_ ================================================ FILE: source/_posts/kanbanmail.md ================================================ --- title: KanbanMail date: 2022-11-23 16:23:31.698423 background: bg-[#4d74e6] label: tags: - - categories: - Keyboard Shortcuts intro: | A visual cheat-sheet for the 29 keyboard shortcuts found in KanbanMail --- ## Keyboard Shortcuts ### Global | Shortcut | Action | | ---------- | ----------------- | | `Ctrl` `\` | Toggle split view | {.shortcuts} ### Board | Shortcut | Action | | ---------- | -------------------------------------------- | | `C` | Open composer | | `Ctrl` `N` | New note in the to-do column | | `/` | Focus the search bar | | `Esc` | Clear search, if it's on | | `1-5` | Select the first thread in column \Hello,``` Create a view by placing a file with the `.blade.php` extension in the `resources/views` directory. ### Pass Data to Views #### As an array ```php return view('greetings', ['name' => 'Victoria']); ``` #### Using with() ```php return view('greeting') ->with('name', 'Victoria') ->with('occupation', 'Astronaut'); ``` Access each value using the data's keys ```htmlHello, {{ $name }}Hello,``` ### view helper Return a view from a route with the `view()` helper ```php Route::get('/', function () { return view('greeting', ['name' => 'James']); }); ``` See: [View Routes](#view-routes) and [Helpers](#helpers) ### Subdirectories ```php // resources/views/admin.profile.blade.php return view('admin.profile'); ``` ## Blade Templates ### Intro - [Laravel Docs - Blade Templates](https://laravel.com/docs/8.x/blade) Blade is the templating engine included in Laravel that also allows you to use plain PHP. ### Views Blade views are returned using the `view()` helper ```php Route::get('/', function () { return view('welcome', ['name' => 'Samantha']); }); ``` See: [Views](#view-helper) ### Comments ```html {{-- This comment will not be present in the rendered HTML --}} ``` ### Directives {.row-span-3} #### if Statements ```php @if (count($records) === 1) I have one record! @elseif (count($records) > 1) I have multiple records! @else I don't have any records! @endif ``` #### isset & empty ```php @isset($records) // $records is defined and is not null... @endisset @empty($records) // $records is "empty"... @endempty ``` #### Authentication ```php @auth // The user is authenticated... @endauth @guest // The user is not authenticated... @endguest ``` #### Loops ```html @for ($i = 0; $i < 10; $i++) The current value is {{ $i }} @endfor @foreach ($users as $user)This is user {{ $user->id }} @endforeach @forelse ($users as $user)No users @endforelse @while (true)I'm looping forever. @endwhile ``` Loop Iteration: ```php @foreach ($users as $user) @if ($loop->first) This is the first iteration. @endif @if ($loop->last) This is the last iteration. @endifThis is user {{ $user->id }} @endforeach ``` See more: [Laravel Loop Variable](https://laravel.com/docs/8.x/blade#the-loop-variable) ### Displaying Data Blade's echo statements `{{ }}` are automatically sent through PHP's `htmlspecialchars` function to prevent XSS attacks. Display the contents of the name variable: ```html Hello, {{ $name }}. ``` Display results of a PHP function: ```html The current UNIX timestamp is {{ time() }}. ``` Display data without escaping with `htmlspecialchars` ```html Hello, {!! $name !!}. ``` ### Including Subviews Include a Blade view from within another view. All variables that are available to the parent view are also available to the included view ```html
@include('shared.errors')
```
### Raw PHP
Execute a block of plain PHP
```php
@php
$counter = 1;
@endphp
```
### Stacks
Blade allows you to push to named stacks which can be rendered in another view or layout.
Useful for javascript libraries required by child views
```html
@push('scripts')
@endpush
```
Render the stack
```html
@stack('scripts')
```
Prepend to the beginning of a stack
```php
@push('scripts')
This will be second...
@endpush
// Later...
@prepend('scripts')
This will be first...
@endprepend
```
## Forms
### Intro
- [Laravel Docs - Forms](https://laravel.com/docs/8.x/blade#forms)
### CSRF Field
Include a hidden CSRF token field to validate the request
```html
```
See: [CSRF Protection](#csrf-protection)
### Method Field
Since HTML forms can't make `PUT`, `PATCH`, or `DELETE` requests, you will need to add a hidden `_method` field to spoof
these HTTP verbs:
```html
```
### Validation Errors
```html
@error('title')
{{ $message }}
@enderror
```
See: [Validation](#validation-cols-3)
### Repopulating Forms
When redirecting due to a validation error, request input is flashed to the session.
Retrieve the input from the previous request with the `old` method
```php
$title = $request->old('title');
```
Or the `old()` helper
```html
```
## Validation
### Intro
- [Laravel Docs - Validation](https://laravel.com/docs/8.x/validation)
If validation fails, a redirect response to the previous URL will be generated.
If the incoming request is an XHR request, a JSON response with the validation error messages will be returned.
### Logic
```php
// in routes/web.php
Route::get('/post/create', [App\Http\Controllers\PostController::class, 'create']);
Route::post('/post', [App\Http\Controllers\PostController::class, 'store']);
// in app/Http/Controllers/PostController...
public function store(Request $request)
{
$validated = $request->validate([
// input name => validation rules
'title' => 'required|unique:posts|max:255',
'body' => 'required',
]);
// The blog post is valid...
}
```
### Rules {.row-span-5}
Can also be passed as an array
```php
$validatedData = $request->validate([
'title' => ['required', 'unique:posts', 'max:255'],
'body' => ['required'],
]);
```
#### after:date
Field must be a value after a given date.
```php
'start_date' => 'required|date|after:tomorrow'
```
Instead of a date string, you may specify another field to compare against the date
```php
'finish_date' => 'required|date|after:start_date'
```
See [before:date](#beforedate)
#### after_or_equal:date
Field must be a value after or equal to the given date.
See [after:date](#afterdate)
#### before:date
Field must be a value preceding the given date.
The name of another field may be supplied as the value of `date`.
See [after:date](#afterdate)
#### alpha_num
Field must be entirely alpha-numeric characters
#### boolean
Field must be able to be cast as a `boolean`.
Accepted input are `true`, `false`, `1`, `0`, `"1"`, and `"0"`
#### confirmed
Field must have a matching field of `{field}_confirmation`.
For example, if the field is password, a matching `password_confirmation` field must be present
#### current_password
Field must match the authenticated user's password.
#### date
Field must be a valid, non-relative date according to the `strtotime` PHP function.
#### email
Field must be formatted as an email address.
#### file
Field must be a successfully uploaded file.
See: [Uploaded Files](#uploaded-files)
#### max:value
Field must be less than or equal to a maximum value.
Strings, numerics, arrays, and files are evaluated like the [size](#sizevalue) rule.
#### min:value
Field must have a minimum value.
Strings, numerics, arrays, and files are evaluated like the [size](#sizevalue) rule.
#### mimetypes:text/plain,...
File must match one of the given MIME types:
```php
'video' => 'mimetypes:video/avi,video/mpeg,video/quicktime'
```
File's contents will be read and the framework will attempt to guess the MIME type, regardless of the client's provided
MIME type.
#### mimes:foo,bar,...
Field must have a MIME type corresponding to one of the listed extensions.
```php
'photo' => 'mimes:jpg,bmp,png'
```
File's contents will be read and the framework will attempt to guess the MIME type, regardless of the client's provided
MIME type.
[Full listing of MIME types & extensions](https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)
#### nullable
Field may be null.
#### numeric
Field must be numeric.
#### password
Field must match the authenticated user's password.
#### prohibited
Field must be empty or not present.
#### prohibited_if:anotherfield,value,...
Field must be empty or not present if the _anotherfield_ field is equal to any value.
#### prohibited_unless:anotherfield,value,...
Field must be empty or not present unless the _anotherfield_ field is equal to any value.
#### required
Field must be present in the input data and not empty.
A field is considered "empty" if one of the following conditions are true:
- The value is `null`.
- The value is an empty string.
- The value is an empty array or empty `Countable` object.
- The value is an uploaded file with no path.
#### required_with:foo,bar,...
Field must be present and not empty, only if any of the other specified fields are present and not empty
#### size:value
Field must have a size matching the given value.
- For strings: number of characters
- For numeric data: integer value (must also have the `numeric` or `integer` rule).
- For arrays: count of the array
- For files: file size in kilobytes
```php
// Validate that a string is exactly 12 characters long...
'title' => 'size:12';
// Validate that a provided integer equals 10...
'seats' => 'integer|size:10';
// Validate that an array has exactly 5 elements...
'tags' => 'array|size:5';
// Validate that an uploaded file is exactly 512 kilobytes...
'image' => 'file|size:512';
```
#### unique:table,column
Field must not exist within the given database table
#### url
Field must be a valid URL
[See all available rules](https://laravel.com/docs/8.x/validation#available-validation-rules)
### Validate Passwords
Ensure passwords have an adequate level of complexity
```php
$validatedData = $request->validate([
'password' => ['required', 'confirmed', Password::min(8)],
]);
```
`Password` rule object allows you to easily customize the password complexity requirements
```php
// Require at least 8 characters...
Password::min(8)
// Require at least one letter...
Password::min(8)->letters()
// Require at least one uppercase and one lowercase letter...
Password::min(8)->mixedCase()
// Require at least one number...
Password::min(8)->numbers()
// Require at least one symbol...
Password::min(8)->symbols()
```
Ensure a password has not been compromised in a public password data breach leak
```php
Password::min(8)->uncompromised()
```
> _Uses the [k-Anonymity](https://en.wikipedia.org/wiki/K-anonymity) model via the
> [haveibeenpwned.com](https://haveibeenpwned.com) service without sacrificing the user's privacy or security_
Methods can be chained
```php
Password::min(8)
->letters()
->mixedCase()
->numbers()
->symbols()
->uncompromised()
```
### Display Validation Errors
```php
Create Post@if ($errors->any())
\\`{a}\\|KaTeX:\` | \\ | \\\\ | Backslash |
| \` | \\\` | Backtick |
| \* | \\\* | Asterisk |
| \_ | \\\_ | Underscore |
| \{\} | \\\{\\\} | Curly braces |
| \[\] | \\\[\\\] | Square brackets |
| \(\) | \\\(\\\) | Parentheses |
| \# | \\\# | Hash mark |
| \+ | \\\+ | Plus sign |
| \- | \\\- | Minus sign \(hyphen\) |
| \. | \\\. | Dot |
| \! | \\\! | Exclamation mark |
{.show-header}
================================================
FILE: source/_posts/matlab.md
================================================
---
title: MATLAB
date: 2023-01-03 09:51:44
background: bg-[#692316]
tags:
categories:
- Programming
intro: |
This quick reference cheat sheet provides an example introduction to using the [MATLAB](https://mathworks.cn/) scientific computing language to get started quickly
plugins:
- copyCode
---
## Getting Started
### Introduction
MATLAB is short for `matrix laboratory`
---
- [MATLAB official website](https://www.mathworks.com)
### Matrix and array operations {.row-span-3}
MATLAB allows you to use a single arithmetic operator or function to manipulate all values in a matrix
```matlab
a + 10
```
MATLAB will execute the above statement and return the following results:
```
ans = 3×3
11 13 15
12 14 16
17 18 20
```
---
```matlab
sin(a)
```
MATLAB will execute the above statement and return the following results:
```
ans = 3×3
0.8415 0.1411 -0.9589
0.9093 -0.7568 -0.2794
0.6570 0.9894 -0.5440
```
To transpose a matrix, use single quotes (`'`)
```matlab
a'
```
---
```
ans = 3×3
1 2 7
3 4 8
5 6 10
```
Perform standard matrix multiplication using the `*` operator, which computes the inner product between rows and columns
```matlab
p = a*inv(a)
```
---
```
p = 3×3
1.0000 0 0
0 1.0000 0
0 0 1.0000
```
### concatenation {.row-span-2}
Concatenation is the process of joining arrays to form larger arrays. In fact, the first array is formed by
concatenating its elements. Pairs of square brackets `[]` are concatenation operators.
```matlab
A = [a,a]
```
---
```
A = 3×6
1 3 5 1 3 5
2 4 6 2 4 6
7 8 10 7 8 10
```
Concatenating arrays next to each other using commas is called horizontal concatenation. Each array must have the same
number of rows. Likewise, semicolons can be used for vertical concatenation if the arrays have the same number of
columns.
```matlab
A = [a; a]
```
---
```
A = 6×3
1 3 5
2 4 6
7 8 10
1 3 5
2 4 6
7 8 10
```
### Matrices and arrays {.row-span-3}
To create an array with four elements per row, separate elements with commas (`,`) or spaces
```matlab
a = [1 2 3 4]
```
MATLAB will execute the above statement and return the following results:
```
a = 1×4
1 2 3 4
```
#### Create a matrix with multiple rows
```matlab
a = [1 3 5; 2 4 6; 7 8 10]
```
---
```
a = 3×3
1 3 5
2 4 6
7 8 10
```
#### 5×1 column vector of zeros
```matlab
z = zeros(5,1)
```
---
```
z = 5×1
0
0
0
0
0
```
### Complex number
A complex number has a real part and an imaginary part, and the imaginary unit is the square root of -1.
```matlab
sqrt(-1)
```
---
```
ans = 0.0000 + 1.0000i
```
To represent the imaginary part of a complex number, use i or j.
```matlab
c = [3+4i, 4+3j; -i, 10j]
```
---
```
c = 2×2 complex
3.0000 + 4.0000i 4.0000 + 3.0000i
0.0000 - 1.0000i 0.0000 +10.0000i
```
## Basic knowledge
### Input the command
| - | - |
| ------------------------------------------------------------------------------- | :------------------------------------------------------------------------ |
| [ans](https://www.mathworks.com/help/matlab/ref/ans.html) | Most recently calculated answer |
| [clc](https://www.mathworks.com/help/matlab/ref/clc.html) | Clear the command line window |
| [diary](https://www.mathworks.com/help/matlab/ref/diary.html) | Record the text of the command line window into the log file |
| [format](https://www.mathworks.com/help/matlab/ref/format.html) | Set the output display format |
| [home](https://www.mathworks.com/help/matlab/ref/home.html) | Send cursor reset |
| [iskeyword](https://www.mathworks.com/help/matlab/ref/iskeyword.html) | Determine if the input is a MATLAB keyword |
| [more](https://www.mathworks.com/help/matlab/ref/more.html) | Control paging output in the command line window |
| [commandwindow](https://www.mathworks.com/help/matlab/ref/commandwindow.html) | Select command window |
| [commandhistory](https://www.mathworks.com/help/matlab/ref/commandhistory.html) | Open command history window |
#### Objects
| - | - |
| -------------------------------------------------------------------------- | :----------------------------------------------- |
| [DisplayFormatOptions](https://www.mathworks.com/help/matlab/ref/ans.html) | Output display format in the command line window |
### Matrices and Arrays {.row-span-5}
Create and combine arrays
| - | - |
| ----------------------------------------------------------------- | :---------------------------------------------------------------- |
| [zeros](https://www.mathworks.com/help/matlab/ref/zeros.html) | Create an array of all zeros |
| [ones](https://www.mathworks.com/help/matlab/ref/ones.html) | Create an array of all 1s |
| [rand](https://www.mathworks.com/help/matlab/ref/rand.html) | Uniformly distributed random numbers |
| [true](https://www.mathworks.com/help/matlab/ref/true.html) | Logical value 1 (true) |
| [false](https://www.mathworks.com/help/matlab/ref/false.html) | logical 0 (false) |
| [eye](https://www.mathworks.com/help/matlab/ref/eye.html) | identity matrix |
| [diag](https://www.mathworks.com/help/matlab/ref/diag.html) | Create a diagonal matrix or get the diagonal elements of a matrix |
| [blkdiag](https://www.mathworks.com/help/matlab/ref/blkdiag.html) | block diagonal matrix |
| [cat](https://www.mathworks.com/help/matlab/ref/double.cat.html) | Concatenate arrays. |
| [horzcat](https://www.mathworks.com/help/matlab/ref/horzcat.html) | Concatenate arrays horizontally |
| [vertcat](https://www.mathworks.com/help/matlab/ref/vertcat.html) | Concatenate arrays vertically |
| [repelem](https://www.mathworks.com/help/matlab/ref/repelem.html) | Repeat array element copy |
| [repmat](https://www.mathworks.com/help/matlab/ref/repmat.html) | Repeat array copy |
Create grid
| - | - |
| --------------------------------------------------------------------- | :-------------------------------------- |
| [linspace](https://www.mathworks.com/help/matlab/ref/linspace.html) | Generate linearly spaced vectors |
| [logspace](https://www.mathworks.com/help/matlab/ref/logspace.html) | Generate logarithmic spaced vectors |
| [freqspace](https://www.mathworks.com/help/matlab/ref/freqspace.html) | frequency spacing of frequency response |
| [meshgrid](https://www.mathworks.com/help/matlab/ref/meshgrid.html) | 2D and 3D grids |
| [ndgrid](https://www.mathworks.com/help/matlab/ref/ndgrid.html) | Rectangular grid in N-dimensional space |
Determine size, shape and order
| - | - |
| --------------------------------------------------------------------------- | :--------------------------------------------------------- |
| [length](https://www.mathworks.com/help/matlab/ref/length.html) | The length of the largest array dimension |
| [size](https://www.mathworks.com/help/matlab/ref/size.html) | array size |
| [ndims](https://www.mathworks.com/help/matlab/ref/double.ndims.html) | Number of dimensions of the array |
| [numel](https://www.mathworks.com/help/matlab/ref/double.numel.html) | the number of array elements |
| [isscalar](https://www.mathworks.com/help/matlab/ref/isscalar.html) | Determine whether the input is a scalar |
| [issorted](https://www.mathworks.com/help/matlab/ref/issorted.html) | Determine if the array is sorted |
| [issortedrows](https://www.mathworks.com/help/matlab/ref/issortedrows.html) | Determine whether the rows of a matrix or table are sorted |
| [isvector](https://www.mathworks.com/help/matlab/ref/isvector.html) | Determine whether the input is a vector |
| [ismatrix](https://www.mathworks.com/help/matlab/ref/ismatrix.html) | Determine whether the input is a matrix |
| [isrow](https://www.mathworks.com/help/matlab/ref/isrow.html) | Determine whether the input is a row vector |
| [iscolumn](https://www.mathworks.com/help/matlab/ref/iscolumn.html) | Determine whether the input is a column vector |
| [isempty](https://www.mathworks.com/help/matlab/ref/isempty.html) | Determine whether the array is empty |
Refactor and rearrange
| - | - |
| ----------------------------------------------------------------------------------- | :--------------------------------------- |
| [sort](https://www.mathworks.com/help/matlab/ref/sort.html) | Sort array |
| elements [sortrows](https://www.mathworks.com/help/matlab/ref/double.sortrows.html) | Sort matrix rows or table rows |
| [flip](https://www.mathworks.com/help/matlab/ref/flip.html) | Flip the order of elements |
| [fliplr](https://www.mathworks.com/help/matlab/ref/fliplr.html) | Flip the array from left to right |
| [flipud](https://www.mathworks.com/help/matlab/ref/flipud.html) | Flip the array from top to bottom |
| [rot90](https://www.mathworks.com/help/matlab/ref/rot90.html) | Rotate an array by 90 degrees |
| [transpose](https://www.mathworks.com/help/matlab/ref/transpose.html) | Transpose a vector or matrix |
| [ctranspose](https://www.mathworks.com/help/matlab/ref/ctranspose.html) | complex conjugate transpose |
| [permute](https://www.mathworks.com/help/matlab/ref/permute.html) | permute array dimension |
| [ipermute](https://www.mathworks.com/help/matlab/ref/ipermute.html) | Inverse permutation of array dimensions. |
| [circshift](https://www.mathworks.com/help/matlab/ref/circshift.html) | Circular shift array |
| [shiftdim](https://www.mathworks.com/help/matlab/ref/shiftdim.html) | shift array dimension |
| [reshape](https://www.mathworks.com/help/matlab/ref/reshape.html) | Reshape array |
| [squeeze](https://www.mathworks.com/help/matlab/ref/squeeze.html) | Remove dimensions of length 1 |
index
| - | - |
| ----------------------------------------------------------------- | :----------------------------------------------------------------------------------- |
| [colon](https://www.mathworks.com/help/matlab/ref/colon.html) | vector creation, array subscript and for loop iteration |
| [end](https://www.mathworks.com/help/matlab/ref/end.html) | Terminate a code block or indicate the maximum array index |
| [ind2sub](https://www.mathworks.com/help/matlab/ref/ind2sub.html) | Convert linear index to subscript |
| [sub2ind](https://www.mathworks.com/help/matlab/ref/sub2ind.html) | Convert subscript to linear index |
### Value type {.row-span-2}
Create numeric variables
| - | - |
| --------------------------------------------------------------- | :------------------------------- |
| [double](https://www.mathworks.com/help/matlab/ref/double.html) | double precision array |
| [single](https://www.mathworks.com/help/matlab/ref/single.html) | single precision array |
| [int8](https://www.mathworks.com/help/matlab/ref/int8.html) | 8-bit signed integer array |
| [int16](https://www.mathworks.com/help/matlab/ref/int16.html) | 16-bit signed integer array |
| [int32](https://www.mathworks.com/help/matlab/ref/int32.html) | 32-bit signed integer array |
| [int64](https://www.mathworks.com/help/matlab/ref/int64.html) | 64-bit signed integer array |
| [uint8](https://www.mathworks.com/help/matlab/ref/uint8.html) | Array of 8-bit unsigned integers |
| [uint16](https://www.mathworks.com/help/matlab/ref/uint16.html) | 16-bit unsigned integer array |
| [uint32](https://www.mathworks.com/help/matlab/ref/uint32.html) | 32-bit unsigned integer array |
| [uint64](https://www.mathworks.com/help/matlab/ref/uint64.html) | 64-bit unsigned integer array |
Convert between numeric types
| - | - |
| ------------------------------------------------------------------- | :------------------------------------------------------ |
| [cast](https://www.mathworks.com/help/matlab/ref/cast.html) | Convert variables to different data types |
| [typecast](https://www.mathworks.com/help/matlab/ref/typecast.html) | Convert data types without changing the underlying data |
Query type and value
| - | - |
| ---------------------------------------------------------------------- | :---------------------------------------------------- |
| [allfinite](https://www.mathworks.com/help/matlab/ref/allfinite.html") | Determine if all array elements are finite |
| [anynan](https://www.mathworks.com/help/matlab/ref/anynan.html") | Determine if any array element is NaN |
| [isinteger](https://www.mathworks.com/help/matlab/ref/isinteger.html) | Determine whether the input is an integer array |
| [isfloat](https://www.mathworks.com/help/matlab/ref/isfloat.html) | Determine whether the input is a floating-point array |
| [isnumeric](https://www.mathworks.com/help/matlab/ref/isnumeric.html) | Determine whether the input is a numeric array |
| [isreal](https://www.mathworks.com/help/matlab/ref/isreal.html) | Determine whether the array uses complex storage |
| [isfinite](https://www.mathworks.com/help/matlab/ref/isfinite.html) | Determine which array elements are finite |
| [isinf](https://www.mathworks.com/help/matlab/ref/isinf.html) | Determine which array elements are infinite |
| [isnan](https://www.mathworks.com/help/matlab/ref/isnan.html) | Determine which array elements are NaN |
Value range
| - | - |
| ------------------------------------------------------------------- | :-------------------------------------------------------------------- |
| [eps](https://www.mathworks.com/help/matlab/ref/eps.html) | Floating point relative precision |
| [flintmax](https://www.mathworks.com/help/matlab/ref/flintmax.html) | The largest consecutive integer in floating point format |
| [Inf](https://www.mathworks.com/help/matlab/ref/inf.html) | Create an array with all values `Inf` |
| [intmax](https://www.mathworks.com/help/matlab/ref/intmax.html) | The maximum value of a specific integer type |
| [intmin](https://www.mathworks.com/help/matlab/ref/intmin.html) | The minimum value of a specific integer type |
| [NaN](https://www.mathworks.com/help/matlab/ref/nan.html) | Create an array where all values are NaN |
| [realmax](https://www.mathworks.com/help/matlab/ref/realmax.html) | The largest positive floating point number |
| [realmin](https://www.mathworks.com/help/matlab/ref/realmin.html) | Minimum standard floating point number |
### Loops and conditional statements
| - | - |
| -------------------------------------------------------------------------------- | :---------------------------------------------------------------- |
| [if, elseif, else](https://www.mathworks.com/help/matlab/ref/if.html) | Execute statement when condition is true |
| [switch, case, otherwise](https://www.mathworks.com/help/matlab/ref/switch.html) | Execute one of multiple sets of statements |
| [for](https://www.mathworks.com/help/matlab/ref/for.html) | A `for` loop used to repeat a specified number of times |
| [while](https://www.mathworks.com/help/matlab/ref/while.html) | A `while` loop that executes repeatedly while a condition is true |
| [try, catch](https://www.mathworks.com/help/matlab/ref/try.html) | Execute the statement and catch the resulting error |
| [break](https://www.mathworks.com/help/matlab/ref/break.html) | Terminate execution of a for or while loop |
| [return](https://www.mathworks.com/help/matlab/ref/return.html) | Return control to the calling script or function |
| [continue](https://www.mathworks.com/help/matlab/ref/continue.html) | Passes control to the next iteration of a `for` or `while` loop |
| [pause](https://www.mathworks.com/help/matlab/ref/pause.html) | Temporarily suspend the execution of `MATLAB` |
| [parfor](https://www.mathworks.com/help/matlab/ref/parfor.html) | Parallel for loop |
| [end](https://www.mathworks.com/help/matlab/ref/end.html) | Terminate a code block or indicate the maximum array index |
{.style-list}
### Array of strings
| - | - |
| ----------------------------------------------------------------- | :----------------------------------------------------- |
| [string](https://www.mathworks.com/help/matlab/ref/string.html) | string array |
| [strings](https://www.mathworks.com/help/matlab/ref/strings.html) | Create a string array that does not contain characters |
| [join](https://www.mathworks.com/help/matlab/ref/join.html) | Merge strings |
| [plus](https://www.mathworks.com/help/matlab/ref/plus.html) | Add numbers, append strings |
### Character array
| - | - |
| ----------------------------------------------------------------- | :------------------------------------------- |
| [char](https://www.mathworks.com/help/matlab/ref/char.html) | character array |
| [cellstr](https://www.mathworks.com/help/matlab/ref/cellstr.html) | Convert to a cell array of character vectors |
| [blanks](https://www.mathworks.com/help/matlab/ref/blanks.html) | Create a blank character array |
| [newline](https://www.mathworks.com/help/matlab/ref/newline.html) | Create newline |
### Character or string array
| - | - |
| ----------------------------------------------------------------- | :---------------------------------------- |
| [compose](https://www.mathworks.com/help/matlab/ref/compose.html) | Format data into multiple strings |
| [sprintf](https://www.mathworks.com/help/matlab/ref/sprintf.html) | Format data as string or character vector |
| [strcat](https://www.mathworks.com/help/matlab/ref/strcat.html) | Concatenate strings horizontally |
| [append](https://www.mathworks.com/help/matlab/ref/append.html) | Merge strings |
### Char or string -convert input arguments
| - | - |
| --------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------- |
| [convertCharsToStrings](https://www.mathworks.com/help/matlab/ref/convertcharstostrings.html) | convert character array to string array, other arrays remain unchanged |
| [convertStringsToChars](https://www.mathworks.com/help/matlab/ref/convertstringstochars.html) | Convert string array to character array, other arrays remain unchanged |
| [convertContainedStringsToChars](https://www.mathworks.com/help/matlab/ref/convertcontainedstringstochars.html) | Convert an array of strings at any level of a cell array or structure {.style-list} |
### CHAR or STRING -convert between numeric and string
| - | - |
| ----------------------------------------------------------------------- | :---------------------------------- |
| [double](https://www.mathworks.com/help/matlab/ref/double.html) | double precision array |
| [string](https://www.mathworks.com/help/matlab/ref/string.html) | string array |
| [str2double](https://www.mathworks.com/help/matlab/ref/str2double.html) | Convert a string to a double value |
| [num2str](https://www.mathworks.com/help/matlab/ref/num2str.html) | Convert numbers to character arrays |
### Character or string -determine type and attributes {.row-span-2}
Type of data
| - | - |
| ------------------------------------------------------------------------------- | :------------------------------------------------------------------- |
| [ischar](https://www.mathworks.com/help/matlab/ref/ischar.html) | Determine whether the input is a character array |
| [iscellstr](https://www.mathworks.com/help/matlab/ref/iscellstr.html) | Determines if input is a cell array of character vectors |
| [isstring](https://www.mathworks.com/help/matlab/ref/isstring.html) | Determine whether the input is an array of strings |
| [isStringScalar](https://www.mathworks.com/help/matlab/ref/isstringscalar.html) | Determine whether the input is a string array containing one element |
Text attribute
| - | - |
| --------------------------------------------------------------------- | :------------------------------------------------------------------------------ |
| [strlength](https://www.mathworks.com/help/matlab/ref/strlength.html) | string length |
| [isstrprop](https://www.mathworks.com/help/matlab/ref/isstrprop.html) | Determine which characters in the input string belong to the specified category |
| [isletter](https://www.mathworks.com/help/matlab/ref/isletter.html) | Determine which characters are letters |
| [isspace](https://www.mathworks.com/help/matlab/ref/isspace.html) | Determine which characters are whitespace characters |
### character or string -find and replace {.row-span-2}
Look up
| - | - |
| ----------------------------------------------------------------------- | :------------------------------------------------------- |
| [contains](https://www.mathworks.com/help/matlab/ref/contains.html) | Determine if there is a pattern in the string |
| [matches](https://www.mathworks.com/help/matlab/ref/matches.html) | Determine if a pattern matches a string |
| [count](https://www.mathworks.com/help/matlab/ref/count.html) | Count the number of occurrences of a pattern in a string |
| [endsWith](https://www.mathworks.com/help/matlab/ref/endswith.html) | Determine if a string ends with a pattern |
| [startsWith](https://www.mathworks.com/help/matlab/ref/startswith.html) | Determine whether a string starts with a pattern |
| [strfind](https://www.mathworks.com/help/matlab/ref/strfind.html) | Find a string in other strings |
| [sscanf](https://www.mathworks.com/help/matlab/ref/sscanf.html) | Read formatted data from a string |
replace
| - | - |
| ------------------------------------------------------------------------------- | :---------------------------------------------- |
| [replace](https://www.mathworks.com/help/matlab/ref/replace.html) | Find and replace one or more substrings |
| [replaceBetween](https://www.mathworks.com/help/matlab/ref/replacebetween.html) | Replace the substring between the start and end |
| [strrep](https://www.mathworks.com/help/matlab/ref/strrep.html) | Find and replace substring |
### String matching pattern -build pattern
| - | - |
| ----------------------------------------------------------------- | :-------------------------------------- |
| [pattern](https://www.mathworks.com/help/matlab/ref/pattern.html) | pattern for searching and matching text |
### String match pattern -character match pattern
| - | - |
| ------------------------------------------------------------------------------------------- | :---------------------------------------------- |
| [alphanumericsPattern](https://www.mathworks.com/help/matlab/ref/alphanumericspattern.html) | match alphanumeric characters |
| [characterListPattern](https://www.mathworks.com/help/matlab/ref/characterlistpattern.html) | Match characters in the list |
| [digitsPattern](https://www.mathworks.com/help/matlab/ref/digitspattern.html) | Match digit characters |
| [lettersPattern](https://www.mathworks.com/help/matlab/ref/letterspattern.html) | match letter pattern |
| [whitespacePattern](https://www.mathworks.com/help/matlab/ref/whitespacepattern.html) | match whitespace characters |
| [wildcardPattern](https://www.mathworks.com/help/matlab/ref/wildcardpattern.html) | Match as few characters of any type as possible |
### String matching pattern -pattern search rules
| - | - |
| ----------------------------------------------------------------------------------------------- | :--------------------------------------------------------- |
| [optionalPattern](https://www.mathworks.com/help/matlab/ref/optionalpattern.html) | Make pattern matching optional |
| [possessivePattern](https://www.mathworks.com/help/matlab/ref/possessivepattern.html) | Match pattern without backtracking |
| [caseSensitivePattern](https://www.mathworks.com/help/matlab/ref/casesensitivepattern.html) | Match patterns in a case-sensitive manner |
| [caseInsensitivePattern](https://www.mathworks.com/help/matlab/ref/caseinsensitivepattern.html) | Match patterns in a case-insensitive manner |
| [asFewOfPattern](https://www.mathworks.com/help/matlab/ref/asfewofpattern.html) | The number of pattern matches should be as few as possible |
| [asManyOfPattern](https://www.mathworks.com/help/matlab/ref/asmanyofpattern.html) | Pattern matching as many times as possible |
### String matching pattern -Boundary pattern {.row-span-2}
| - | - |
| ------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------ |
| [alphanumericBoundary](https://www.mathworks.com/help/matlab/ref/alphanumericboundary.html) | Matches the boundary between alphanumeric and non-alphanumeric characters |
| [digitBoundary](https://www.mathworks.com/help/matlab/ref/digitboundary.html) | Matches the boundary between digit characters and non-digit characters |
| [letterBoundary](https://www.mathworks.com/help/matlab/ref/letterboundary.html) | Matches the boundary between alphabetic and non-alphabetic characters |
| [whitespaceBoundary](https://www.mathworks.com/help/matlab/ref/whitespaceboundary.html) | Matches the boundary between whitespace and non-whitespace characters |
| [lineBoundary](https://www.mathworks.com/help/matlab/ref/lineboundary.html) | match the beginning or end of a line |
| [textBoundary](https://www.mathworks.com/help/matlab/ref/textboundary.html) | match the beginning or end of the text |
| [lookAheadBoundary](https://www.mathworks.com/help/matlab/ref/lookaheadboundary.html) | match the boundary before the specified pattern |
| [lookBehindBoundary](https://www.mathworks.com/help/matlab/ref/lookbehindboundary.html) | Boundary after matching the specified pattern |
{.style-list}
### String matching pattern -custom pattern display
| - | - |
| ----------------------------------------------------------------------------- | :---------------------------------- |
| [maskedPattern](https://www.mathworks.com/help/matlab/ref/maskedpattern.html) | pattern with specified display name |
| [namedPattern](https://www.mathworks.com/help/matlab/ref/namedpattern.html) | Specify a named pattern |
### String matching pattern -regular expression
| - | - |
| --------------------------------------------------------------------------------- | :---------------------------------------------------- |
| [regexp](https://www.mathworks.com/help/matlab/ref/regexp.html) | match regular expression (case sensitive) |
| [regexpi](https://www.mathworks.com/help/matlab/ref/regexpi.html) | Match regular expressions (case insensitive) |
| [regexprep](https://www.mathworks.com/help/matlab/ref/regexprep.html) | Replace text using regular expressions |
| [regexptranslate](https://www.mathworks.com/help/matlab/ref/regexptranslate.html) | Convert text to regular expressions |
| [regexpPattern](https://www.mathworks.com/help/matlab/ref/regexppattern.html) | Match the pattern of the specified regular expression |
### String matching pattern -join and split
| - | - |
| ------------------------------------------------------------------------------- | :-------------------------------------------------------------------- |
| [join](https://www.mathworks.com/help/matlab/ref/join.html) | Merge strings |
| [plus](https://www.mathworks.com/help/matlab/ref/plus.html) | Add numbers, append strings |
| [split](https://www.mathworks.com/help/matlab/ref/split.html) | Split string at delimiter |
| [splitlines](https://www.mathworks.com/help/matlab/ref/splitlines.html) | Split a string at newlines |
| [strjoin](https://www.mathworks.com/help/matlab/ref/strjoin.html) | join the strings in the array |
| [strsplit](https://www.mathworks.com/help/matlab/ref/strsplit.html) | Splits a string or character vector at the specified delimiter |
| [strtok](https://www.mathworks.com/help/matlab/ref/strtok.html) | Selected string part |
| [extract](https://www.mathworks.com/help/matlab/ref/extract.html) | Extract a substring from a string |
| [extractAfter](https://www.mathworks.com/help/matlab/ref/extractafter.html) | Extract the substring after the specified position |
| [extractBefore](https://www.mathworks.com/help/matlab/ref/extractbefore.html) | Extract the substring before the specified position |
| [extractBetween](https://www.mathworks.com/help/matlab/ref/extractbetween.html) | Extract the substring between the starting point and the ending point |
### String editing {.row-span-2}
| - | - |
| ------------------------------------------------------------------------------- | :-------------------------------------------------------------------- |
| [erase](https://www.mathworks.com/help/matlab/ref/erase.html) | Delete a substring in a string |
| [eraseBetween](https://www.mathworks.com/help/matlab/ref/erasebetween.html) | Delete the substring between the start and end |
| [extract](https://www.mathworks.com/help/matlab/ref/extract.html) | Extract a substring from a string |
| [extractAfter](https://www.mathworks.com/help/matlab/ref/extractafter.html) | Extract the substring after the specified position |
| [extractBefore](https://www.mathworks.com/help/matlab/ref/extractbefore.html) | Extract the substring before the specified position |
| [extractBetween](https://www.mathworks.com/help/matlab/ref/extractbetween.html) | Extract the substring between the starting point and the ending point |
| [insertAfter](https://www.mathworks.com/help/matlab/ref/insertafter.html) | Insert a string after the specified substring |
| [insertBefore](https://www.mathworks.com/help/matlab/ref/insertbefore.html) | Insert a string before the specified substring |
| [pad](https://www.mathworks.com/help/matlab/ref/pad.html) | Add leading or trailing characters to a string |
| [strip](https://www.mathworks.com/help/matlab/ref/strip.html) | Remove leading and trailing characters in a string |
| [lower](https://www.mathworks.com/help/matlab/ref/lower.html) | convert string to lowercase |
| [upper](https://www.mathworks.com/help/matlab/ref/upper.html) | convert string to uppercase |
| [reverse](https://www.mathworks.com/help/matlab/ref/reverse.html) | Reverse the order of characters in a string |
| [deblank](https://www.mathworks.com/help/matlab/ref/deblank.html) | Remove trailing blanks at the end of a string |
| [strtrim](https://www.mathworks.com/help/matlab/ref/strtrim.html) | Remove leading and trailing blanks from a string |
| [strjust](https://www.mathworks.com/help/matlab/ref/strjust.html) | align string |
### String comparison
| - | - |
| ------------------------------------------------------------------- | :------------------------------------------------------------------------------------------ |
| [matches](https://www.mathworks.com/help/matlab/ref/matches.html) | Determine if a pattern matches a string |
| [strcmp](https://www.mathworks.com/help/matlab/ref/strcmp.html) | Compare strings |
| [strcmpi](https://www.mathworks.com/help/matlab/ref/strcmpi.html) | Compare strings (case insensitive) |
| [strncmp](https://www.mathworks.com/help/matlab/ref/strncmp.html) | compares the first n characters of a string (case sensitive) |
| [strncmpi](https://www.mathworks.com/help/matlab/ref/strncmpi.html) | Compare the first n characters of a string (case insensitive ) |
### Basic Arithmetic {.row-span-3}
#### Addition
- [+](https://www.mathworks.com/help/matlab/ref/plus.html) Add numbers, append strings
- [sum](https://www.mathworks.com/help/matlab/ref/sum.html) sum of array elements
- [cumsum](https://www.mathworks.com/help/matlab/ref/cumsum.html) cumulative sum
- [movsum](https://www.mathworks.com/help/matlab/ref/movsum.html) moving sum
{.cols-2 .marker-none}
#### Subtraction
- [-](https://www.mathworks.com/help/matlab/ref/minus.html) subtraction
- [diff](https://www.mathworks.com/help/matlab/ref/diff.html) difference and approximate derivative
{.cols-2 .marker-none}
#### Multiplication
| - | - |
| ----------------------------------------------------------------------- | :---------------------------------- |
| [.\*](https://www.mathworks.com/help/matlab/ref/times.html) | Multiplication |
| [\*](https://www.mathworks.com/help/matlab/ref/mtimes.html) | Matrix multiplication |
| [prod](https://www.mathworks.com/help/matlab/ref/prod.html) | product of array elements |
| [cumprod](https://www.mathworks.com/help/matlab/ref/cumprod.html) | cumulative product |
| [pagemtimes](https://www.mathworks.com/help/matlab/ref/pagemtimes.html) | Matrix multiplication by page |
| [tensorprod](https://www.mathworks.com/help/matlab/ref/tensorprod.html) | Tensor products between two tensors |
#### Division
| - | - |
| ------------------------------------------------------------- | :------------------------------------------------------------ |
| [./](https://www.mathworks.com/help/matlab/ref/rdivide.html) | Array right division |
| [.\\](https://www.mathworks.com/help/matlab/ref/ldivide.html) | Array left division |
| [/](https://www.mathworks.com/help/matlab/ref/mrdivide.html) | Solve the system of linear equations xA = B about x |
| [\\](https://www.mathworks.com/help/matlab/ref/mldivide.html) | Solve the system of linear equations Ax = B with respect to x |
#### Power
- [.^](https://www.mathworks.com/help/matlab/ref/power.html) Element-wise exponentiation
- [^](https://www.mathworks.com/help/matlab/ref/mpower.html) matrix power
{.cols-2 .marker-none}
#### Transpose
| - | - |
| ------------------------------------------------------------------------------- | :---------------------------------- |
| [.'](https://www.mathworks.com/help/matlab/ref/transpose.html) | Transpose a vector or matrix |
| ['](https://www.mathworks.com/help/matlab/ref/ctranspose.html) | complex conjugate transpose |
| [pagetranspose](https://www.mathworks.com/help/matlab/ref/pagetranspose.html) | Transpose by page |
| [pagectranspose](https://www.mathworks.com/help/matlab/ref/pagectranspose.html) | Complex conjugate transpose by page |
#### Array notation
- [uminus](https://www.mathworks.com/help/matlab/ref/uminus.html) unary subtraction
- [uplus](https://www.mathworks.com/help/matlab/ref/uplus.html) unary addition
{.cols-2 .marker-none}
### Modular division and rounding
| - | - |
| ----------------------------------------------------------------- | :------------------------------------------ |
| [mod](https://www.mathworks.com/help/matlab/ref/mod.html) | Remainder after division (modulo operation) |
| [rem](https://www.mathworks.com/help/matlab/ref/rem.html) | Remainder after division |
| [idivide](https://www.mathworks.com/help/matlab/ref/idivide.html) | Divisibility with rounding options |
| [ceil](https://www.mathworks.com/help/matlab/ref/ceil.html) | round towards positive infinity |
| [fix](https://www.mathworks.com/help/matlab/ref/fix.html) | round towards zero |
| [floor](https://www.mathworks.com/help/matlab/ref/floor.html) | round towards negative infinity |
| [round](https://www.mathworks.com/help/matlab/ref/round.html) | round to the nearest decimal or integer |
### Custom Binary Functions
| - | - |
| --------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| [bsxfun](https://www.mathworks.com/help/matlab/ref/bsxfun.html) | Apply element-wise operations on two arrays (with implicit expansion enabled) |
### Relational operations
value comparison
| - | - |
| ------------------------------------------------------------------- | :----------------------------------------------- |
| [==](https://www.mathworks.com/help/matlab/ref/eq.html) | Determine equality |
| [>=](https://www.mathworks.com/help/matlab/ref/ge.html) | Determine greater than or equal to |
| [>](https://www.mathworks.com/help/matlab/ref/gt.html) | Determine greater than |
| [<=](https://www.mathworks.com/help/matlab/ref/le.html) | Determine less than or equal to |
| [<](https://www.mathworks.com/help/matlab/ref/lt.html) | Determine less than |
| [~=](https://www.mathworks.com/help/matlab/ref/ne.html) | Determine Inequality |
| [isequal](https://www.mathworks.com/help/matlab/ref/isequal.html) | Determine array equality |
| [isequaln](https://www.mathworks.com/help/matlab/ref/isequaln.html) | Test array equality, treat `NaN` values as equal |
### Logical (Boolean) operations
true or false condition
| - | - |
| ----------------------------------------------------------------------------------------------------- | :---------------------------------------------------------- |
| [Short-circuit &&, \|\|](https://www.mathworks.com/help/matlab/ref/logicaloperatorsshortcircuit.html) | Logical operators with short-circuit function |
| [&](https://www.mathworks.com/help/matlab/ref/and.html) | Computational logic `AND` |
| [~](https://www.mathworks.com/help/matlab/ref/not.html) | Computational logic `NOT` |
| [\|](https://www.mathworks.com/help/matlab/ref/or.html) | Calculation logic `OR` |
| [xor](https://www.mathworks.com/help/matlab/ref/xor.html) | Compute logical exclusive `OR` |
| [all](https://www.mathworks.com/help/matlab/ref/all.html) | Determine whether all array elements are non-zero or `true` |
| [any](https://www.mathworks.com/help/matlab/ref/any.html) | Determine if any array elements are non-zero |
| [false](https://www.mathworks.com/help/matlab/ref/false.html) | logical `0` (false) |
| [find](https://www.mathworks.com/help/matlab/ref/find.html) | Find the index and value of non-zero elements |
| [islogical](https://www.mathworks.com/help/matlab/ref/islogical.html) | Determine whether the input is a logical array |
| [logical](https://www.mathworks.com/help/matlab/ref/logical.html) | Convert numeric values to logical values |
| [true](https://www.mathworks.com/help/matlab/ref/true.html) | Logical value `1` (true) |
### Set operation
union, intersection, set relationship
| - | - |
| ---------------------------------------------------------------------------- | :------------------------------------------------------------- |
| [intersect](https://www.mathworks.com/help/matlab/ref/double.intersect.html) | Set the intersection of two arrays |
| [ismember](https://www.mathworks.com/help/matlab/ref/double.ismember.html) | Determine whether an array element is a set array member |
| [setdiff](https://www.mathworks.com/help/matlab/ref/double.setdiff.html) | Set the difference between two arrays |
| [setxor](https://www.mathworks.com/help/matlab/ref/double.setxor.html) | Set XOR of two arrays |
| [union](https://www.mathworks.com/help/matlab/ref/double.union.html) | Set the union of two arrays |
| [unique](https://www.mathworks.com/help/matlab/ref/double.unique.html) | Unique value in an array |
| [ismembertol](https://www.mathworks.com/help/matlab/ref/ismembertol.html) | set membership within tolerance |
| [uniquetol](https://www.mathworks.com/help/matlab/ref/uniquetol.html) | unique values within tolerance |
| [join](https://www.mathworks.com/help/matlab/ref/table.join.html) | Merge two tables or timetables row by row using a key variable |
| [innerjoin](https://www.mathworks.com/help/matlab/ref/innerjoin.html) | Inner join between two tables or timetables |
| [outerjoin](https://www.mathworks.com/help/matlab/ref/outerjoin.html) | Outer join between two tables or timetables |
### Bitwise operations
set, offset, or compare specific bitfields
| - | - |
| --------------------------------------------------------------------- | :------------------------------------- |
| [bitand](https://www.mathworks.com/help/matlab/ref/bitand.html) | Bitwise `AND` |
| [bitor](https://www.mathworks.com/help/matlab/ref/bitor.html) | Bitwise `OR` |
| [bitxor](https://www.mathworks.com/help/matlab/ref/bitxor.html) | Bitwise `XOR` |
| [bitcmp](https://www.mathworks.com/help/matlab/ref/bitcmp.html) | Bitwise complement |
| [bitget](https://www.mathworks.com/help/matlab/ref/bitget.html) | Get the bit at the specified position |
| [bitset](https://www.mathworks.com/help/matlab/ref/bitset.html) | Set the bit at the specified position |
| [bitshift](https://www.mathworks.com/help/matlab/ref/bitshift.html) | Shift bits by specified number of bits |
| [swapbytes](https://www.mathworks.com/help/matlab/ref/swapbytes.html) | swap byte order |
## Data import and export
### text file -read and write table or timetable {.row-span-2}
#### Basic import and export
| - | - |
| ------------------------------------------------------------------------------- | :--------------------------------- |
| [readtable](https://www.mathworks.com/help/matlab/ref/readtable.html) | Create a table based on a file |
| [writetable](https://www.mathworks.com/help/matlab/ref/writetable.html) | write table to file |
| [readtimetable](https://www.mathworks.com/help/matlab/ref/readtimetable.html) | Create a timetable based on a file |
| [writetimetable](https://www.mathworks.com/help/matlab/ref/writetimetable.html) | Write timetable to file |
#### Define import rules
| - | - |
| ---------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------- |
| [detectImportOptions](https://www.mathworks.com/help/matlab/ref/detectimportoptions.html) | Generate import options based on file content |
| [delimitedTextImportOptions](https://www.mathworks.com/help/matlab/ref/matlab.io.text.delimitedtextimportoptions.html) | Import options object for delimited text |
| [fixedWidthImportOptions](https://www.mathworks.com/help/matlab/ref/matlab.io.text.fixedwidthimportoptions.html) | Import options object for fixed-width text files |
| [xmlImportOptions](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.xmlimportoptions.html) | Import options object for XML file |
| [htmlImportOptions](https://www.mathworks.com/help/matlab/ref/matlab.io.html.htmlimportoptions.html) | Import options object for HTML files |
| [wordDocumentImportOptions](https://www.mathworks.com/help/matlab/ref/matlab.io.word.worddocumentimportoptions.html) | `Microsoft Word` file import options object |
| [getvaropts](https://www.mathworks.com/help/matlab/ref/matlab.io.text.delimitedtextimportoptions.getvaropts.html) | Get variable import options |
| [setvaropts](https://www.mathworks.com/help/matlab/ref/matlab.io.text.delimitedtextimportoptions.setvaropts.html) | Set variable import options |
| [setvartype](https://www.mathworks.com/help/matlab/ref/matlab.io.text.delimitedtextimportoptions.setvartype.html) | Set variable data type |
| [preview](https://www.mathworks.com/help/matlab/ref/matlab.io.text.delimitedtextimportoptions.preview.html) | Preview eight lines of data in the file with import options |
{.style-list}
### Text files -read and write matrices and arrays
| - | - |
| ------------------------------------------------------------------------- | :--------------------------------------------- |
| [readmatrix](https://www.mathworks.com/help/matlab/ref/readmatrix.html) | Read a matrix from a file |
| [writematrix](https://www.mathworks.com/help/matlab/ref/writematrix.html) | Write matrix to file |
| [readcell](https://www.mathworks.com/help/matlab/ref/readcell.html) | Read a cell array from a file |
| [writecell](https://www.mathworks.com/help/matlab/ref/writecell.html) | Write a cell array to a file |
| [readvars](https://www.mathworks.com/help/matlab/ref/readvars.html) | Read variables from a file |
| [textscan](https://www.mathworks.com/help/matlab/ref/textscan.html) | Read formatted data from a text file or string |
| [type](https://www.mathworks.com/help/matlab/ref/type.html) | Display file content |
| [fileread](https://www.mathworks.com/help/matlab/ref/fileread.html) | Read file content in text format |
| [readlines](https://www.mathworks.com/help/matlab/ref/readlines.html) | Read lines of a file as an array of strings |
| [writelines](https://www.mathworks.com/help/matlab/ref/writelines.html) | Write text to file |
### Spreadsheet -Read and Write Table or Timetable {.row-span-2}
Basic import and export
| - | - |
| ------------------------------------------------------------------------------- | :------------------------------------- |
| [readtable](https://www.mathworks.com/help/matlab/ref/readtable.html) | Create a table from a file |
| [writetable](https://www.mathworks.com/help/matlab/ref/writetable.html) | write table to file |
| [readtimetable](https://www.mathworks.com/help/matlab/ref/readtimetable.html) | Create a timetable from a file |
| [writetimetable](https://www.mathworks.com/help/matlab/ref/writetimetable.html) | Write timetable to file |
| [sheetnames](https://www.mathworks.com/help/matlab/ref/sheetnames.html) | Get sheetnames from a spreadsheet file |
{.style-list}
Define import rules
| - | - |
| ------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------- |
| [detectImportOptions](https://www.mathworks.com/help/matlab/ref/detectimportoptions.html) | Generate import options based on file content |
| [spreadsheetImportOptions](https://www.mathworks.com/help/matlab/ref/matlab.io.spreadsheet.spreadsheetimportoptions.html) | Spreadsheet import options object |
| [getvaropts](https://www.mathworks.com/help/matlab/ref/matlab.io.text.delimitedtextimportoptions.getvaropts.html) | Get variable import options |
| [setvaropts](https://www.mathworks.com/help/matlab/ref/matlab.io.text.delimitedtextimportoptions.setvaropts.html) | Set variable import options |
| [setvartype](https://www.mathworks.com/help/matlab/ref/matlab.io.text.delimitedtextimportoptions.setvartype.html) | Set variable data type |
| [preview](https://www.mathworks.com/help/matlab/ref/matlab.io.text.delimitedtextimportoptions.preview.html) | Preview eight rows of data in a file with import options |
{.style-list}
### Spreadsheet -Reading and writing matrices and arrays
| - | - |
| ------------------------------------------------------------------------- | :---------------------------- |
| [readmatrix](https://www.mathworks.com/help/matlab/ref/readmatrix.html) | Read a matrix from a file |
| [writematrix](https://www.mathworks.com/help/matlab/ref/writematrix.html) | Write matrix to file |
| [readcell](https://www.mathworks.com/help/matlab/ref/readcell.html) | Read a cell array from a file |
| [writecell](https://www.mathworks.com/help/matlab/ref/writecell.html) | Write a cell array to a file |
| [readvars](https://www.mathworks.com/help/matlab/ref/readvars.html) | Read variables from a file |
| [importdata](https://www.mathworks.com/help/matlab/ref/importdata.html) | Load data from a file |
### images
| - | - |
| ----------------------------------------------------------------- | :---------------------------------------- |
| [imfinfo](https://www.mathworks.com/help/matlab/ref/imfinfo.html) | Information about graphics files |
| [imread](https://www.mathworks.com/help/matlab/ref/imread.html) | Reads an image from a graphics file |
| [imwrite](https://www.mathworks.com/help/matlab/ref/imwrite.html) | Writes an image to a graphics file |
| [Tiff](https://www.mathworks.com/help/matlab/ref/tiff.html) | MATLAB entry for LibTIFF library routines |
### Read or write a NetCDF file {.row-span-2}
| - | - |
| ----------------------------------------------------------------------------- | :------------------------------------------------------------- |
| [nccreate](https://www.mathworks.com/help/matlab/ref/nccreate.html) | Create variables in a NetCDF file |
| [ncdisp](https://www.mathworks.com/help/matlab/ref/ncdisp.html) | Displays NetCDF data source content in the command line window |
| [ncinfo](https://www.mathworks.com/help/matlab/ref/ncinfo.html) | Returns information about a NetCDF data source |
| [ncread](https://www.mathworks.com/help/matlab/ref/ncread.html) | Read variable data from a NetCDF data source |
| [ncreadatt](https://www.mathworks.com/help/matlab/ref/ncreadatt.html) | Read attribute values in a NetCDF data source |
| [ncwrite](https://www.mathworks.com/help/matlab/ref/ncwrite.html) | Write data to a NetCDF file |
| [ncwriteatt](https://www.mathworks.com/help/matlab/ref/ncwriteatt.html) | Write attributes to a NetCDF file |
| [ncwriteschema](https://www.mathworks.com/help/matlab/ref/ncwriteschema.html) | Adds a NetCDF schema definition to a NetCDF file |
### NetCDF library package -library functions
| - | - |
| ------------------------------------------------------------------------------------------------- | :----------------------------------------------------------- |
| [netcdf.getChunkCache](https://www.mathworks.com/help/matlab/ref/netcdf.getchunkcache.html) | Retrieves the chunk cache settings for the NetCDF library |
| [netcdf.inqLibVers](https://www.mathworks.com/help/matlab/ref/netcdf.inqlibvers.html) | Returns NetCDF library version information |
| [netcdf.setChunkCache](https://www.mathworks.com/help/matlab/ref/netcdf.setchunkcache.html) | Sets the default chunk cache settings for the NetCDF library |
| [netcdf.setDefaultFormat](https://www.mathworks.com/help/matlab/ref/netcdf.setdefaultformat.html) | Change the default netCDF file format |
{.style-list}
### NetCDF library package -file operations {.row-span-2}
| - | - |
| ----------------------------------------------------------------------------------------- | :------------------------------------------------- |
| [netcdf.abort](https://www.mathworks.com/help/matlab/ref/netcdf.abort.html) | restores the most recent netCDF file definition |
| [netcdf.close](https://www.mathworks.com/help/matlab/ref/netcdf.close.html) | Closes a netCDF file |
| [netcdf.create](https://www.mathworks.com/help/matlab/ref/netcdf.create.html) | Create a new NetCDF dataset |
| [netcdf.endDef](https://www.mathworks.com/help/matlab/ref/netcdf.enddef.html) | End netCDF file definition mode |
| [netcdf.inq](https://www.mathworks.com/help/matlab/ref/netcdf.inq.html) | returns information about a netCDF file |
| [netcdf.inqFormat](https://www.mathworks.com/help/matlab/ref/netcdf.inqformat.html) | Determines the format of a NetCDF file |
| [netcdf.inqGrps](https://www.mathworks.com/help/matlab/ref/netcdf.inqgrps.html) | Retrieves an array of subgroup IDs |
| [netcdf.inqUnlimDims](https://www.mathworks.com/help/matlab/ref/netcdf.inqunlimdims.html) | Retrieves a list of infinite dimensions in a group |
| [netcdf.open](https://www.mathworks.com/help/matlab/ref/netcdf.open.html) | Open NetCDF data source |
| [netcdf.reDef](https://www.mathworks.com/help/matlab/ref/netcdf.redef.html) | puts an open netCDF file into definition mode |
| [netcdf.setFill](https://www.mathworks.com/help/matlab/ref/netcdf.setfill.html) | Set netCDF fill mode |
| [netcdf.sync](https://www.mathworks.com/help/matlab/ref/netcdf.sync.html) | Synchronize netCDF files to disk |
### NetCDF Library Package -Dimensions
| - | - |
| ----------------------------------------------------------------------------------- | :----------------------------------------- |
| [netcdf.defdim](https://www.mathworks.com/help/matlab/ref/netcdf.defdim.html) | Create netCDF dimensions |
| [netcdf.inqDim](https://www.mathworks.com/help/matlab/ref/netcdf.inqdim.html) | Returns netCDF dimension names and lengths |
| [netcdf.inqDimID](https://www.mathworks.com/help/matlab/ref/netcdf.inqdimid.html) | Returns the dimension ID |
| [netcdf.renameDim](https://www.mathworks.com/help/matlab/ref/netcdf.renamedim.html) | Change netCDF dimension names |
### NetCDF library package -group
| - | - |
| --------------------------------------------------------------------------------------------- | :--------------------------------------------------- |
| [netcdf.defGrp](https://www.mathworks.com/help/matlab/ref/netcdf.defgrp.html) | Create groups in a NetCDF file |
| [netcdf.inqDimIDs](https://www.mathworks.com/help/matlab/ref/netcdf.inqdimids.html) | Retrieves a list of dimension identifiers in a group |
| [netcdf.inqGrpName](https://www.mathworks.com/help/matlab/ref/netcdf.inqgrpname.html) | Retrieve group name |
| [netcdf.inqGrpNameFull](https://www.mathworks.com/help/matlab/ref/netcdf.inqgrpnamefull.html) | the full pathname of the group |
| [netcdf.inqGrpParent](https://www.mathworks.com/help/matlab/ref/netcdf.inqgrpparent.html) | Retrieves the ID of the parent group. |
| [netcdf.inqNcid](https://www.mathworks.com/help/matlab/ref/netcdf.inqncid.html) | Returns the ID of a named group |
| [netcdf.inqVarIDs](https://www.mathworks.com/help/matlab/ref/netcdf.inqvarids.html) | IDs of all variables in the group |
### NetCDF library package -variable {.row-span-3}
| - | - |
| ------------------------------------------------------------------------------------------------- | :-------------------------------------------------------- |
| [netcdf.defVarFill](https://www.mathworks.com/help/matlab/ref/netcdf.defvarfill.html) | Defines the fill parameter for a NetCDF variable |
| [netcdf.defVar](https://www.mathworks.com/help/matlab/ref/netcdf.defvar.html) | Create a NetCDF variable |
| [netcdf.defVarChunking](https://www.mathworks.com/help/matlab/ref/netcdf.defvarchunking.html) | Defines chunking behavior for NetCDF variables |
| [netcdf.defVarDeflate](https://www.mathworks.com/help/matlab/ref/netcdf.defvardeflate.html) | Defines compression parameters for NetCDF variables |
| [netcdf.defVarFletcher32](https://www.mathworks.com/help/matlab/ref/netcdf.defvarfletcher32.html) | Defines validation parameters for NetCDF variables |
| [netcdf.getVar](https://www.mathworks.com/help/matlab/ref/netcdf.getvar.html) | Read data in a NetCDF variable |
| [netcdf.inqVar](https://www.mathworks.com/help/matlab/ref/netcdf.inqvar.html) | Information about variables |
| [netcdf.inqVarChunking](https://www.mathworks.com/help/matlab/ref/netcdf.inqvarchunking.html) | Determines chunking settings for NetCDF variables |
| [netcdf.inqVarDeflate](https://www.mathworks.com/help/matlab/ref/netcdf.inqvardeflate.html) | Determines compression settings for NetCDF variables |
| [netcdf.inqVarFill](https://www.mathworks.com/help/matlab/ref/netcdf.inqvarfill.html) | Determines the fill parameter value for a NetCDF variable |
| [netcdf.inqVarFletcher32](https://www.mathworks.com/help/matlab/ref/netcdf.inqvarfletcher32.html) | About Fletcher32 checksum settings for NetCDF variables |
| [netcdf.inqVarID](https://www.mathworks.com/help/matlab/ref/netcdf.inqvarid.html) | Returns the ID associated with the variable name |
| [netcdf.putVar](https://www.mathworks.com/help/matlab/ref/netcdf.putvar.html) | Writes data to a netCDF variable |
| [netcdf.renameVar](https://www.mathworks.com/help/matlab/ref/netcdf.renamevar.html) | Change netCDF variable name |
{.style-list}
### NetCDF library package -properties
| - | - |
| ------------------------------------------------------------------------------------- | :------------------------------------------ |
| [netcdf.copyAtt](https://www.mathworks.com/help/matlab/ref/netcdf.copyatt.html) | Copy an attribute to a new location |
| [netcdf.delAtt](https://www.mathworks.com/help/matlab/ref/netcdf.delatt.html) | Remove netCDF attribute |
| [netcdf.getAtt](https://www.mathworks.com/help/matlab/ref/netcdf.getatt.html) | Returns the NetCDF attribute |
| [netcdf.inqAtt](https://www.mathworks.com/help/matlab/ref/netcdf.inqatt.html) | Returns information about netCDF attributes |
| [netcdf.inqAttID](https://www.mathworks.com/help/matlab/ref/netcdf.inqattid.html) | Returns the ID of a netCDF attribute |
| [netcdf.inqAttName](https://www.mathworks.com/help/matlab/ref/netcdf.inqattname.html) | Returns the netCDF attribute name |
| [netcdf.putAtt](https://www.mathworks.com/help/matlab/ref/netcdf.putatt.html) | Write netCDF attributes |
| [netcdf.renameAtt](https://www.mathworks.com/help/matlab/ref/netcdf.renameatt.html) | Change Attribute Name |
### NetCDF library package -user-defined types
| :- | :- |
| :-------------------------------------------------------------------------------------- | :------------------------------------------------------- |
| [netcdf.defVlen](https://www.mathworks.com/help/matlab/ref/netcdf.defvlen.html) | Define user-defined variable length array type (NC_VLEN) |
| [netcdf.inqUserType](https://www.mathworks.com/help/matlab/ref/netcdf.inqusertype.html) | Return information about user-defined type |
| [netcdf.inqVlen](https://www.mathworks.com/help/matlab/ref/netcdf.inqvlen.html) | Return information about user-defined `NC_VLEN` type |
{.style-list}
### NetCDF library package -Utilities
| - | - |
| ------------------------------------------------------------------------------------------------- | :------------------------------------------------------ |
| [netcdf.getConstant](https://www.mathworks.com/help/matlab/ref/netcdf.getconstant.html) | returns the value of the named constant |
| [netcdf.getConstantNames](https://www.mathworks.com/help/matlab/ref/netcdf.getconstantnames.html) | returns a list of constants known to the netCDF library |
{.style-list}
### Read or write HDF5 files
| - | - |
| ----------------------------------------------------------------------- | :-------------------------------- |
| [h5create](https://www.mathworks.com/help/matlab/ref/h5create.html) | Create HDF5 dataset |
| [h5disp](https://www.mathworks.com/help/matlab/ref/h5disp.html) | Display the content of HDF5 files |
| [h5info](https://www.mathworks.com/help/matlab/ref/h5info.html) | Information about HDF5 files |
| [h5read](https://www.mathworks.com/help/matlab/ref/h5read.html) | Read data from HDF5 dataset |
| [h5readatt](https://www.mathworks.com/help/matlab/ref/h5readatt.html) | Read attributes from HDF5 files |
| [h5write](https://www.mathworks.com/help/matlab/ref/h5write.html) | Write HDF5 dataset |
| [h5writeatt](https://www.mathworks.com/help/matlab/ref/h5writeatt.html) | Write HDF5 attributes |
### HDF5 library package {.row-span-4}
| - | - |
| ------------------------------------------------------------------------------------------- | :--------------------------------------------------------------- |
| [Library (H5)](https://www.mathworks.com/help/matlab/ref/libraryh5.html) | General-purpose functions for use with entire HDF5 library |
| [Attribute (H5A)](https://www.mathworks.com/help/matlab/ref/attributeh5a.html) | Metadata associated with datasets or groups |
| [Dataset (H5D)](https://www.mathworks.com/help/matlab/ref/dataseth5d.html) | Multidimensional arrays of data elements and supporting metadata |
| [Dimension Scale (H5DS)](https://www.mathworks.com/help/matlab/ref/dimensionscaleh5ds.html) | Dimension scale associated with dataset dimensions |
| [Error (H5E)](https://www.mathworks.com/help/matlab/ref/errorh5e.html) | Error handling |
| [File (H5F)](https://www.mathworks.com/help/matlab/ref/fileh5f.html) | HDF5 file access |
| [Group (H5G)](https://www.mathworks.com/help/matlab/ref/grouph5g.html) | Organization of objects in file |
| [Identifier (H5I)](https://www.mathworks.com/help/matlab/ref/identifierh5i.html) | HDF5 object identifiers |
| [Link (H5L)](https://www.mathworks.com/help/matlab/ref/linkh5l.html) | Links in HDF5 file |
| [MATLAB (H5ML)](https://www.mathworks.com/help/matlab/ref/matlabh5ml.html) | `MATLAB` utility functions not part of the HDF5 C library |
| [Object (H5O)](https://www.mathworks.com/help/matlab/ref/objecth5o.html) | Objects in file |
| [Property (H5P)](https://www.mathworks.com/help/matlab/ref/propertyh5p.html) | Object property lists |
| [Reference (H5R)](https://www.mathworks.com/help/matlab/ref/referenceh5r.html) | HDF5 references |
| [Dataspace (H5S)](https://www.mathworks.com/help/matlab/ref/dataspaceh5s.html) | Dimensionality of dataset |
| [Datatype (H5T)](https://www.mathworks.com/help/matlab/ref/datatypeh5t.html) | Datatype of elements in a dataset |
{.style-list}
### HDF4 Files -Advanced Functions
| - | - |
| ----------------------------------------------------------------- | :-------------------------------------- |
| [hdfinfo](https://www.mathworks.com/help/matlab/ref/hdfinfo.html) | Information about HDF4 or HDF-EOS files |
| [hdfread](https://www.mathworks.com/help/matlab/ref/hdfread.html) | Read data from HDF4 or HDF-EOS files |
| [imread](https://www.mathworks.com/help/matlab/ref/imread.html) | Read an image from a graphics file |
| [imwrite](https://www.mathworks.com/help/matlab/ref/imwrite.html) | Write image to graphics file |
### Low-level functions -package {.row-span-3}
| - | - |
| ----------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------- |
| [matlab.io.hdf4.sd](https://www.mathworks.com/help/matlab/ref/matlab.io.hdf4.sd.html) | Interact directly with the HDF4 multi-file scientific dataset (SD) interface |
| [matlab.io.hdfeos.gd](https://www.mathworks.com/help/matlab/ref/matlab.io.hdfeos.gd.html) | Low-level access to HDF-EOS grid data |
| [matlab.io.hdfeos.sw](https://www.mathworks.com/help/matlab/ref/matlab.io.hdfeos.sw.html) | Low-level access to HDF-EOS segmented files |
#### Low Level Functions -Functions
| - | - |
| ----------------------------------------------------------------- | :---------------------------------------------------- |
| [hdfan](https://www.mathworks.com/help/matlab/ref/hdfan.html) | The entry of HDF multi-file annotation (AN) interface |
| [hdfhx](https://www.mathworks.com/help/matlab/ref/hdfhx.html) | The entry of HDF external data (HX) interface |
| [hdfh](https://www.mathworks.com/help/matlab/ref/hdfh.html) | The entry of HDF H interface |
| [hdfhd](https://www.mathworks.com/help/matlab/ref/hdfhd.html) | The entry of HDF HD interface |
| [hdfhe](https://www.mathworks.com/help/matlab/ref/hdfhe.html) | The entry of HDF HE interface |
| [hdfml](https://www.mathworks.com/help/matlab/ref/hdfml.html) | Utilities for use with `MATLAB` HDF entry functions |
| [hdfpt](https://www.mathworks.com/help/matlab/ref/hdfpt.html) | Interface of HDF-EOS point object |
| [hdfv](https://www.mathworks.com/help/matlab/ref/hdfv.html) | The entry of HDF Vgroup (V) interface |
| [hdfvf](https://www.mathworks.com/help/matlab/ref/hdfvf.html) | The entry of VF function in HDF Vdata interface |
| [hdfvh](https://www.mathworks.com/help/matlab/ref/hdfvh.html) | The entry of VH function in HDF Vdata interface |
| [hdfvs](https://www.mathworks.com/help/matlab/ref/hdfvs.html) | The entry of VS function in HDF Vdata interface |
| [hdfdf24](https://www.mathworks.com/help/matlab/ref/hdfdf24.html) | HDF 24-bit raster image (DF24) interface entry |
| [hdfdfr8](https://www.mathworks.com/help/matlab/ref/hdfdfr8.html) | HDF 8-bit raster image (DFR8) interface entry |
### FITS file -function
| - | - |
| --------------------------------------------------------------------- | :--------------------------- |
| [fitsdisp](https://www.mathworks.com/help/matlab/ref/fitsdisp.html) | Display FITS metadata |
| [fitsinfo](https://www.mathworks.com/help/matlab/ref/fitsinfo.html) | Information about FITS files |
| [fitsread](https://www.mathworks.com/help/matlab/ref/fitsread.html) | Read data in FITS files |
| [fitswrite](https://www.mathworks.com/help/matlab/ref/fitswrite.html) | Write image to FITS file |
### FITS files -file access
| - | - |
| ------------------------------------------------------------------------------------------ | :------------------------ |
| [createFile](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.createfile.html) | Create FITS file |
| [openFile](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.openfile.html) | Open FITS file |
| [openDiskFile](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.opendiskfile.html) | Open FITS file |
| [closeFile](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.closefile.html) | Close FITS file |
| [deleteFile](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.deletefile.html) | Delete FITS file |
| [fileName](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.filename.html) | The name of the FITS file |
| [fileMode](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.filemode.html) | I/O mode for FITS files |
### FITS files -image processing
| - | - |
| -------------------------------------------------------------------------------------- | :------------------------------------------ |
| [createImg](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.createimg.html) | Create FITS image |
| [getImgSize](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.getimgsize.html) | image size |
| [getImgType](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.getimgtype.html) | The data type of the image |
| [insertImg](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.insertimg.html) | Insert a FITS image after the current image |
| [readImg](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.readimg.html) | read image data |
| [setBscale](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.setbscale.html) | Reset image scaling |
| [writeImg](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.writeimg.html) | write FITS image |
### FITS file -keyword {.row-span-2}
| - | - |
| ------------------------------------------------------------------------------------------------ | :---------------------------------------------- |
| [readCard](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.readcard.html) | Header record of keywords |
| [readKey](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.readkey.html) | Keyword |
| [readKeyCmplx](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.readkeycmplx.html) | A keyword in the form of a complex scalar value |
| [readKeyDbl](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.readkeydbl.html) | Keyword in the form of double precision value |
| [readKeyLongLong](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.readkeylonglong.html) | Keyword in the form of `int64` |
| [readKeyLongStr](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.readkeylongstr.html) | long string value |
| [readKeyUnit](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.readkeyunit.html) | The physical unit string in the key |
| [readRecord](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.readrecord.html) | Header record specified by number |
| [writeComment](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.writecomment.html) | Write or append COMMENT keyword to CHU |
| [writeDate](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.writedate.html) | Write DATE keyword to CHU |
| [writeKey](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.writekey.html) | Update or add new keywords to the current HDU |
| [writeKeyUnit](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.writekeyunit.html) | write physical unit string |
| [writeHistory](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.writehistory.html) | Write or append HISTORY keyword to CHU |
| [deleteKey](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.deletekey.html) | Delete key by name |
| [deleteRecord](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.deleterecord.html) | Delete keywords by record number |
| [getHdrSpace](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.gethdrspace.html) | The number of keywords in the header |
### FITS files -Header Data Unit (HDU) access
| - | - |
| -------------------------------------------------------------------------------------------- | :----------------------------------------------------------------- |
| [copyHDU](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.copyhdu.html) | Copy current HDU from one file to another |
| [getHDUnum](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.gethdunum.html) | The number of the current HDU in the FITS file |
| [getHDUtype](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.gethdutype.html) | current HDU type |
| [getNumHDUs](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.getnumhdus.html) | Total number of HDUs in FITS file |
| [movAbsHDU](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.movabshdu.html) | Move to Absolute HDU Numbering |
| [movNamHDU](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.movnamhdu.html) | Move to the first HDU containing a specific type and keyword value |
| [movRelHDU](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.movrelhdu.html) | Move relative amount of HDU from current HDU |
| [writeChecksum](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.writechecksum.html) | Calculate and write the checksum of the current HDU |
| [deleteHDU](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.deletehdu.html) | Delete the current HDU in the FITS file |
### FITS files -image compression
| - | - |
| ------------------------------------------------------------------------------------------------------ | :---------------------------------------------------- |
| [imgCompress](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.imgcompress.html) | Compress HDU from one file to another |
| [isCompressedImg](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.iscompressedimg.html) | Determine whether the current image is compressed |
| [setCompressionType](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.setcompressiontype.html) | Set image compression type |
| [setHCompScale](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.sethcompscale.html) | Set the scaling parameters of the HCOMPRESS algorithm |
| [setHCompSmooth](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.sethcompsmooth.html) | Sets smoothing for images compressed with HCOMPRESS |
| [setTileDim](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.settiledim.html) | Set tile dimensions |
### FITS file -ASCII table and binary table {.row-span-3}
| - | - |
| ------------------------------------------------------------------------------------------ | :-------------------------------------------------------- |
| [createTbl](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.createtbl.html) | Create a new ASCII or binary table extension |
| [insertCol](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.insertcol.html) | Insert a column into a table |
| [insertRows](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.insertrows.html) | Insert rows into the table |
| [insertATbl](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.insertatbl.html) | Insert an ASCII table after the current HDU |
| [insertBTbl](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.insertbtbl.html) | Insert a binary table behind the current HDU |
| [deleteCol](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.deletecol.html) | Delete a column from a table |
| [deleteRows](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.deleterows.html) | Delete rows from the table |
| [getAColParms](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.getacolparms.html) | ASCII table information |
| [getBColParms](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.getbcolparms.html) | binary table information |
| [getColName](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.getcolname.html) | table column name |
| [getColType](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.getcoltype.html) | Data type, repeat value, width of scaled column |
| [getEqColType](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.geteqcoltype.html) | column data type, repeated value, width |
| [getNumCols](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.getnumcols.html) | The number of columns in the table |
| [getNumRows](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.getnumrows.html) | the number of rows in the table |
| [readATblHdr](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.readatblhdr.html) | Read the header information from the current ASCII table |
| [readBTblHdr](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.readbtblhdr.html) | Read the header information from the current binary table |
| [readCol](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.readcol.html) | Reads rows of ASCII or binary table columns |
| [setTscale](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.settscale.html) | reset image scaling |
| [writeCol](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.writecol.html) | Write elements to an ASCII or binary table column |
### FITS files -Utilities
| - | - |
| -------------------------------------------------------------------------------------------------- | :----------------------------------------- |
| [getConstantValue](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.getconstantvalue.html) | specify the constant value |
| [getVersion](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.getversion.html) | The revision number of the CFITSIO library |
| [getOpenFiles](https://www.mathworks.com/help/matlab/ref/matlab.io.fits.getopenfiles.html) | list of opened FITS files |
### Stripe interleaved file
| - | - |
| ------------------------------------------------------------------------------- | :------------------------------------------------- |
| [multibandread](https://www.mathworks.com/help/matlab/ref/multibandread.html) | Read a striped interleaved file from a binary file |
| [multibandwrite](https://www.mathworks.com/help/matlab/ref/multibandwrite.html) | Write strip interleaved data to a file |
### Common Data Format (CDF)
| - | - |
| --------------------------------------------------------------------- | :--------------------------------------------------------------------- |
| [cdfinfo](https://www.mathworks.com/help/matlab/ref/cdfinfo.html) | Information on Common Data Format (CDF) files |
| [cdfread](https://www.mathworks.com/help/matlab/ref/cdfread.html) | Read data in Common Data Format (CDF) files |
| [cdfepoch](https://www.mathworks.com/help/matlab/ref/cdfepoch.html) | Converts a date literal or date sequence value to a date in CDF format |
| [todatenum](https://www.mathworks.com/help/matlab/ref/todatenum.html) | Convert CDF epoch objects to `MATLAB` date serial values |
#### Bag
| - | - |
| --------------------------------------------------------------- | :---------------------------------- |
| [cdflib](https://www.mathworks.com/help/matlab/ref/cdflib.html) | Direct interaction with CDF library |
### Read video data
| - | - |
| ------------------------------------------------------------------------------------------- | :------------------------------------------------------------- |
| [VideoReader](https://www.mathworks.com/help/matlab/ref/videoreader.html) | Create an object to read a video file |
| [read](https://www.mathworks.com/help/matlab/ref/videoreader.read.html) | Read one or more video frames |
| [readFrame](https://www.mathworks.com/help/matlab/ref/videoreader.readframe.html) | Read the next video frame |
| [hasFrame](https://www.mathworks.com/help/matlab/ref/videoreader.hasframe.html) | Determine whether there are video frames available for reading |
| [getFileFormats](https://www.mathworks.com/help/matlab/ref/videoreader.getfileformats.html) | File formats supported by `VideoReader` |
| [mmfileinfo](https://www.mathworks.com/help/matlab/ref/mmfileinfo.html) | Information about multimedia files |
### Write video data
| - | - |
| ------------------------------------------------------------------------------------- | :------------------------------------------------------------ |
| [VideoWriter](https://www.mathworks.com/help/matlab/ref/videowriter.html) | Create an object to write a video file |
| [open](https://www.mathworks.com/help/matlab/ref/videowriter.open.html) | Open a file to write video data |
| [writeVideo](https://www.mathworks.com/help/matlab/ref/videowriter.writevideo.html) | Write video data to a file |
| [close](https://www.mathworks.com/help/matlab/ref/videowriter.close.html) | close the file after writing video data |
| [getProfiles](https://www.mathworks.com/help/matlab/ref/videowriter.getprofiles.html) | Description files and file formats supported by `VideoWriter` |
### Read or write audio
| - | - |
| ----------------------------------------------------------------------- | :------------------------------------------- |
| [audioread](https://www.mathworks.com/help/matlab/ref/audioread.html) | Read audio files |
| [audiowrite](https://www.mathworks.com/help/matlab/ref/audiowrite.html) | Write audio files |
| [lin2mu](https://www.mathworks.com/help/matlab/ref/lin2mu.html) | Convert linear audio signal to mu-law |
| [mu2lin](https://www.mathworks.com/help/matlab/ref/mu2lin.html) | Convert mu-law audio signal to linear format |
| [audioinfo](https://www.mathworks.com/help/matlab/ref/audioinfo.html) | Information about audio files |
### Play audio
| - | - |
| --------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- |
| [audioplayer](https://www.mathworks.com/help/matlab/ref/audioplayer.html) | Object for playing audio |
| [isplaying](https://www.mathworks.com/help/matlab/ref/audioplayer.isplaying.html) | Determine whether playback is in progress |
| [pause](https://www.mathworks.com/help/matlab/ref/audioplayer.pause.html) | Pause playback or recording |
| [play](https://www.mathworks.com/help/matlab/ref/audioplayer.play.html) | Play audio from `audioplayer` object |
| [playblocking](https://www.mathworks.com/help/matlab/ref/audioplayer.playblocking.html) | Play audio in `audioplayer` object, keep control until playback is complete |
| [resume](https://www.mathworks.com/help/matlab/ref/audioplayer.resume.html) | Resume playback or recording from the paused state |
| [stop](https://www.mathworks.com/help/matlab/ref/audioplayer.stop.html) | Stop playing or recording |
### Record audio
| - | - |
| --------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------ |
| [audiorecorder](https://www.mathworks.com/help/matlab/ref/audiorecorder.html) | object for recording audio |
| [getaudiodata](https://www.mathworks.com/help/matlab/ref/audiorecorder.getaudiodata.html) | Store the recorded audio signal in a numeric array |
| [getplayer](https://www.mathworks.com/help/matlab/ref/audiorecorder.getplayer.html) | Create an associated `audioplayer` object |
| [isrecording](https://www.mathworks.com/help/matlab/ref/audiorecorder.isrecording.html) | Determine if recording is in progress |
| [record](https://www.mathworks.com/help/matlab/ref/audiorecorder.record.html) | Record audio into `audiorecorder` object |
| [recordblocking](https://www.mathworks.com/help/matlab/ref/audiorecorder.recordblocking.html) | Record audio into an `audiorecorder` object, keep control until recording is complete |
### Play sound
| - | - |
| ----------------------------------------------------------------------------- | :------------------------------------------ |
| [audiodevinfo](https://www.mathworks.com/help/matlab/ref/audiodevinfo.html) | Information about audio devices |
| [audiodevreset](https://www.mathworks.com/help/matlab/ref/audiodevreset.html) | Refresh the list of available audio devices |
| [sound](https://www.mathworks.com/help/matlab/ref/sound.html) | Convert signal data matrix to sound |
| [soundsc](https://www.mathworks.com/help/matlab/ref/soundsc.html) | Scale data and play it as sound |
| [beep](https://www.mathworks.com/help/matlab/ref/beep.html) | generate operating system beep |
### Reading and writing XML documents
| - | - |
| ----------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------- |
| [matlab.io.xml.dom.DOMWriter](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.domwriter-class.html) | Write serialized XML documents Injector |
| [matlab.io.xml.dom.EntityResolver](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.entityresolver-class.html) | Abstract base class of entity resolver |
| [matlab.io.xml.dom.FileWriter](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.filewriter-class.html) | Writer for creating text files |
| [matlab.io.xml.dom.Locator](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.locator-class.html) | The location of the element in the XML file |
| [matlab.io.xml.dom.Parser](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.parser-class.html) | XML markup parser |
| [matlab.io.xml.dom.ParserConfiguration](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.parserconfiguration-class.html) | XML parser options |
| [matlab.io.xml.dom.ParseError](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.parseerror-class.html) | Specified XML tag parsing error |
| [matlab.io.xml.dom.ParseErrorHandler](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.parseerrorhandler-class.html) | Abstract base class for parse error handlers |
| [matlab.io.xml.dom.ParseErrorLocator](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.parseerrorlocator-class.html) | Specifies location of parse error |
| [matlab.io.xml.dom.ParseErrorSeverity](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.parseerrorseverity-class.html) | Indicates the severity of XML tag parsing errors enum class |
| [matlab.io.xml.dom.ResourceIdentifier](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.resourceidentifier-class.html) | XML resource identifier |
| [matlab.io.xml.dom.ResourceIdentifierType](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.resourceidentifiertype-class.html) | XML resource identifier type |
| [matlab.io.xml.dom.WriterConfiguration](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.writerconfiguration-class.html) | XML DOM Writer Options |
{.style-list-arrow}
### W3C DOM
| - | - |
| --------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------- |
| [matlab.io.xml.dom.Attr](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.attr-class.html) | Attributes of XML elements |
| [matlab.io.xml.dom.CDATASection](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.cdatasection-class.html) | CDATA section |
| [matlab.io.xml.dom.Comment](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.comment-class.html) | Comments in XML documents |
| [matlab.io.xml.dom.Document](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.document-class.html) | XML document |
| [matlab.io.xml.dom.DocumentFragment](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.documentfragment-class.html) | document node group |
| [matlab.io.xml.dom.DocumentType](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.documenttype-class.html) | document type |
| [matlab.io.xml.dom.Element](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.element-class.html) | element of XML document |
| [matlab.io.xml.dom.Entity](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.entity-class.html) | Entity defined by document type |
| [matlab.io.xml.dom.NamedNodeMap](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.namednodemap-class.html) | A set of document nodes with names |
| [matlab.io.xml.dom.NodeList](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.nodelist-class.html) | document node list |
| [matlab.io.xml.dom.Notation](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.notation-class.html) | Notation in document type definition |
| [matlab.io.xml.dom.ProcessingInstruction](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.processinginstruction-class.html) | XML processing instruction |
| [matlab.io.xml.dom.Text](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.text-class.html) | Text in an XML document |
| [matlab.io.xml.dom.TypeInfo](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.dom.typeinfo-class.html) | schema type information |
{.style-list-arrow}
### XML Transformation
| - | - |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------- |
| [matlab.io.xml.transform.CompiledStylesheet](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.transform.compiledstylesheet-class.html) | Compiled stylesheet |
| [matlab.io.xml.transform.ResultDocument](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.transform.resultdocument-class.html) | Store the transformation result as a document |
| [matlab.io.xml.transform.ResultString](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.transform.resultstring-class.html) | Store the transformation result as a string |
| [matlab.io.xml.transform.ResultFile](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.transform.resultfile-class.html) | Store the transformation result as a file |
| [matlab.io.xml.transform.SourceDocument](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.transform.sourcedocument-class.html) | XML source document for transformation |
| [matlab.io.xml.transform.SourceFile](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.transform.sourcefile-class.html) | XML source file for transformation |
| [matlab.io.xml.transform.SourceString](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.transform.sourcestring-class.html) | XML source string for transformation string |
| [matlab.io.xml.transform.StylesheetSourceDocument](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.transform.stylesheetsourcedocument-class.html) | Stylesheet source for transformation document |
| [matlab.io.xml.transform.StylesheetSourceFile](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.transform.stylesheetsourcefile-class.html) | Stylesheet source for transformation document |
| [matlab.io.xml.transform.StylesheetSourceString](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.transform.stylesheetsourcestring-class.html) | XSL source string for transformation string |
| [matlab.io.xml.transform.Tracer](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.transform.tracer-class.html) | Trace execution of stylesheet |
{.style-list-arrow}
### XPath query
| - | - |
| ------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------- |
| [matlab.io.xml.xpath.CompiledExpression](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.xpath.compiledexpression-class.html) | Compiled XPath expression |
| [matlab.io.xml.xpath.EvalResultType](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.xpath.evalresulttype-class.html) | The result type of XPath expression calculation |
| [matlab.io.xml.xpath.Evaluator](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.xpath.evaluator-class.html) | XPath expression evaluator |
| [matlab.io.xml.xpath.PrefixResolver](https://www.mathworks.com/help/matlab/ref/matlab.io.xml.xpath.prefixresolver-class.html) | For namespace prefix resolver Abstract base class for |
{.style-list-arrow}
### JSON format
| - | - |
| ----------------------------------------------------------------------- | :------------------------------------------------------- |
| [jsondecode](https://www.mathworks.com/help/matlab/ref/jsondecode.html) | Decode text in JSON format |
| [jsonencode](https://www.mathworks.com/help/matlab/ref/jsonencode.html) | Create JSON-formatted text from structured `MATLAB` data |
### Workspace variables and MAT-file {.row-span-2}
| - | - |
| ------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- |
| [load](https://www.mathworks.com/help/matlab/ref/load.html) | Load file variables into the workspace |
| [save](https://www.mathworks.com/help/matlab/ref/save.html) | Save workspace variables to a file |
| [matfile](https://www.mathworks.com/help/matlab/ref/matlab.io.matfile.html) | Access and change variables in a MAT-file without loading the file into memory |
| [disp](https://www.mathworks.com/help/matlab/ref/disp.html) | Display the value of the variable |
| [formattedDisplayText](https://www.mathworks.com/help/matlab/ref/formatteddisplaytext.html) | Capture display output as a string |
| [who](https://www.mathworks.com/help/matlab/ref/who.html) | List variables in the workspace |
| [whos](https://www.mathworks.com/help/matlab/ref/whos.html) | List variables in the workspace with their size and type |
| [clear](https://www.mathworks.com/help/matlab/ref/clear.html) | Delete items from the workspace and release system memory |
| [clearvars](https://www.mathworks.com/help/matlab/ref/clearvars.html) | Clear variables in memory |
| [openvar](https://www.mathworks.com/help/matlab/ref/openvar.html) | Open a workspace variable in the variable editor or other graphical editing tools |
| [Workspace Browser](https://www.mathworks.com/help/matlab/ref/workspace.html) | Open the Workspace Browser to manage the workspace |
### Low-level file I/O {.row-span-2}
| - | - |
| ------------------------------------------------------------------- | :------------------------------------------------------------------- |
| [fclose](https://www.mathworks.com/help/matlab/ref/fclose.html) | close one or all open files |
| [feof](https://www.mathworks.com/help/matlab/ref/feof.html) | Detect the end of the file |
| [ferror](https://www.mathworks.com/help/matlab/ref/ferror.html) | File I/O error message |
| [fgetl](https://www.mathworks.com/help/matlab/ref/fgetl.html) | Read lines in a file and remove line breaks |
| [fgets](https://www.mathworks.com/help/matlab/ref/fgets.html) | Read lines in a file and keep newlines |
| [fileread](https://www.mathworks.com/help/matlab/ref/fileread.html) | Read file content in text format |
| [fopen](https://www.mathworks.com/help/matlab/ref/fopen.html) | Open a file or get information about opening a file |
| [fprintf](https://www.mathworks.com/help/matlab/ref/fprintf.html) | Write data to a text file |
| [fread](https://www.mathworks.com/help/matlab/ref/fread.html) | Read data in binary files |
| [frewind](https://www.mathworks.com/help/matlab/ref/frewind.html) | Move the file position indicator to the beginning of the opened file |
| [fscanf](https://www.mathworks.com/help/matlab/ref/fscanf.html) | Read the data in the text file |
| [fseek](https://www.mathworks.com/help/matlab/ref/fseek.html) | Move to the specified position in the file |
| [ftell](https://www.mathworks.com/help/matlab/ref/ftell.html) | current location |
| [fwrite](https://www.mathworks.com/help/matlab/ref/fwrite.html) | Write data to a binary file |
### Serial and USB Communication -Connection and Configuration
| - | - |
| ---------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- |
| [serialportlist](https://www.mathworks.com/help/matlab/ref/serialportlist.html) | List of serial ports connected to your system |
| [serialport](https://www.mathworks.com/help/matlab/ref/serialport.html) | Connect to a serial port |
| [configureTerminator](https://www.mathworks.com/help/matlab/ref/serialport.configureterminator.html) | Set the terminator for ASCII string communication with the serial port |
| [configureCallback](https://www.mathworks.com/help/matlab/ref/serialport.configurecallback.html) | Set callback function and trigger conditions for communication with serial port devices |
### Serial and USB communication -read and write
| - | - |
| -------------------------------------------------------------------------------- | :------------------------------------------- |
| [read](https://www.mathworks.com/help/matlab/ref/serialport.read.html) | Read data from the serial port |
| [readline](https://www.mathworks.com/help/matlab/ref/serialport.readline.html) | Read ASCII string data line from serial port |
| [write](https://www.mathworks.com/help/matlab/ref/serialport.write.html) | write data to serial port |
| [writeline](https://www.mathworks.com/help/matlab/ref/serialport.writeline.html) | Write ASCII data line to serial port |
### Serial and USB communication -control pins and memory
| - | - |
| -------------------------------------------------------------------------------------- | :---------------------------------- |
| [flush](https://www.mathworks.com/help/matlab/ref/serialport.flush.html) | Clear the serial port device buffer |
| [getpinstatus](https://www.mathworks.com/help/matlab/ref/serialport.getpinstatus.html) | Get the serial port status |
| [setRTS](https://www.mathworks.com/help/matlab/ref/serialport.setrts.html) | Set the serial port RTS pin |
| [setDTR](https://www.mathworks.com/help/matlab/ref/serialport.setdtr.html) | Set the serial DTR pin |
### TCP/IP communication -connection and configuration
| - | - |
| --------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------- |
| [tcpclient](https://www.mathworks.com/help/matlab/ref/tcpclient.html) | Create a TCP/IP client connection to a TCP/IP server |
| [echotcpip](https://www.mathworks.com/help/matlab/ref/echotcpip.html) | Start or stop the TCP/IP echo server |
| [configureTerminator](https://www.mathworks.com/help/matlab/ref/tcpclient.configureterminator.html) | Set terminator for ASCII string communication with remote host via TCP/IP |
| [configureCallback](https://www.mathworks.com/help/matlab/ref/tcpclient.configurecallback.html) | Set callback function and trigger condition for communication with remote host via TCP/IP |
{.style-list}
### TCP/IP communication -read and write
| - | - |
| ------------------------------------------------------------------------------- | :----------------------------------------------------------- |
| [read](https://www.mathworks.com/help/matlab/ref/tcpclient.read.html) | Read data on a remote host via TCP/IP |
| [readline](https://www.mathworks.com/help/matlab/ref/tcpclient.readline.html) | Read ASCII string data line from remote host via TCP/IP |
| [write](https://www.mathworks.com/help/matlab/ref/tcpclient.write.html) | Write data to a remote host via TCP/IP |
| [writeline](https://www.mathworks.com/help/matlab/ref/tcpclient.writeline.html) | Write ASCII data line to remote host via TCP/IP |
| [flush](https://www.mathworks.com/help/matlab/ref/tcpclient.flush.html) | Flush buffers for communication with remote hosts via TCP/IP |
{.style-list}
### Bluetooth communication -connection and configuration
| - | - |
| --------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------ |
| [bluetoothlist](https://www.mathworks.com/help/matlab/ref/bluetoothlist.html) | Scan for nearby `Bluetooth` classic devices |
| [bluetooth](https://www.mathworks.com/help/matlab/ref/bluetooth.html) | Connect to `Bluetooth` classic device |
| [configureTerminator](https://www.mathworks.com/help/matlab/ref/bluetooth.configureterminator.html) | Set terminator for ASCII string communication with `Bluetooth` device |
| [configureCallback](https://www.mathworks.com/help/matlab/ref/bluetooth.configurecallback.html) | Set callback function and trigger condition for communication with `Bluetooth` device |
{.style-list}
### Bluetooth communication -read and write {.row-span-2}
| - | - |
| ------------------------------------------------------------------------------- | :-------------------------------------------------- |
| [read](https://www.mathworks.com/help/matlab/ref/bluetooth.read.html) | Read data from a `Bluetooth` device |
| [readline](https://www.mathworks.com/help/matlab/ref/bluetooth.readline.html) | Read ASCII string data line from `Bluetooth` device |
| [write](https://www.mathworks.com/help/matlab/ref/bluetooth.write.html) | write data to `Bluetooth` device |
| [writeline](https://www.mathworks.com/help/matlab/ref/bluetooth.writeline.html) | Write ASCII data line to `Bluetooth` device |
| [flush](https://www.mathworks.com/help/matlab/ref/bluetooth.flush.html) | Clear `Bluetooth` device buffer |
{.style-list}
### Bluetooth Low Energy Communication {.row-span-2}
| - | - |
| ------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------- |
| [blelist](https://www.mathworks.com/help/matlab/ref/blelist.html) | Scan for nearby low energy `Bluetooth` peripherals |
| [ble](https://www.mathworks.com/help/matlab/ref/ble.html) | Connect to low energy `Bluetooth` peripherals |
| [characteristic](https://www.mathworks.com/help/matlab/ref/matlabshared.blelib.characteristic.html) | Access to characteristics of `Bluetooth` low energy peripherals |
| [descriptor](https://www.mathworks.com/help/matlab/ref/matlabshared.blelib.descriptor.html) | Access descriptors on `Bluetooth` low energy peripherals |
| [read](https://www.mathworks.com/help/matlab/ref/matlabshared.blelib.characteristic.read.html) | Read characteristic or descriptor data on a `Bluetooth` low energy peripheral device |
| [write](https://www.mathworks.com/help/matlab/ref/matlabshared.blelib.characteristic.write.html) | Write data to a characteristic or descriptor of a `Bluetooth` low energy peripheral device |
| [subscribe](https://www.mathworks.com/help/matlab/ref/matlabshared.blelib.characteristic.subscribe.html) | Subscribe to characteristic notifications or instructions |
| [unsubscribe](https://www.mathworks.com/help/matlab/ref/matlabshared.blelib.characteristic.unsubscribe.html) | Unsubscribe characteristic notifications and instructions |
{.style-list}
### Web Services
| - | - |
| ----------------------------------------------------------------------- | :------------------------------------------ |
| [webread](https://www.mathworks.com/help/matlab/ref/webread.html) | Read content from RESTful web services |
| [webwrite](https://www.mathworks.com/help/matlab/ref/webwrite.html) | Write data to RESTful web service |
| [websave](https://www.mathworks.com/help/matlab/ref/websave.html) | Save content in RESTful web service to file |
| [weboptions](https://www.mathworks.com/help/matlab/ref/weboptions.html) | Specify parameters for RESTful web services |
| [web](https://www.mathworks.com/help/matlab/ref/web.html) | Open a webpage or file in a browser |
| [sendmail](https://www.mathworks.com/help/matlab/ref/sendmail.html) | Send email to address list |
### FTP file operations {.row-span-2}
| - | - |
| ------------------------------------------------------------------- | :--------------------------------------------------------- |
| [ftp](https://www.mathworks.com/help/matlab/ref/ftp.html) | Connect to an FTP server to access its files |
| [sftp](https://www.mathworks.com/help/matlab/ref/sftp.html) | Connection to SFTP server to access its files |
| [ascii](https://www.mathworks.com/help/matlab/ref/ftp.ascii.html) | Set FTP transfer mode to ASCII |
| [binary](https://www.mathworks.com/help/matlab/ref/ftp.binary.html) | Set FTP transfer mode to binary |
| [cd](https://www.mathworks.com/help/matlab/ref/ftp.cd.html) | Change or view the current folder on an SFTP or FTP server |
| [close](https://www.mathworks.com/help/matlab/ref/ftp.close.html) | Close the connection to the SFTP or FTP server |
| [delete](https://www.mathworks.com/help/matlab/ref/ftp.delete.html) | Delete files on SFTP or FTP server |
| [dir](https://www.mathworks.com/help/matlab/ref/ftp.dir.html) | List folder contents on SFTP or FTP server |
| [mget](https://www.mathworks.com/help/matlab/ref/ftp.mget.html) | Download files from SFTP or FTP server |
| [mkdir](https://www.mathworks.com/help/matlab/ref/ftp.mkdir.html) | Create a new folder on an SFTP or FTP server |
| [mput](https://www.mathworks.com/help/matlab/ref/ftp.mput.html) | Upload files or folders to SFTP or FTP server |
| [rename](https://www.mathworks.com/help/matlab/ref/ftp.rename.html) | Rename a file on an SFTP or FTP server |
| [rmdir](https://www.mathworks.com/help/matlab/ref/ftp.rmdir.html) | Delete a folder on an SFTP or FTP server |
### Internet of Things (IoT) Data
| - | - |
| --------------------------------------------------------------------------------- | :--------------------------------------- |
| [thingSpeakRead](https://www.mathworks.com/help/matlab/ref/thingspeakread.html) | Read data stored in `ThingSpeak` channel |
| [thingSpeakWrite](https://www.mathworks.com/help/matlab/ref/thingspeakwrite.html) | write data to `ThingSpeak` channel |
================================================
FILE: source/_posts/matplotlib.md
================================================
---
title: 'Matplotlib'
date: 06-06-2025
background: bg-[#1a073e]
tags:
- 'data visualization'
- 'matplotlib'
- 'plotting'
categories:
- 'Python'
intro: |
[Matplotlib](https://matplotlib.org/) is a comprehensive library for creating static, animated, and interactive plots in Python.
This cheat sheet provides a quick reference from basic to advanced usage, covering essential features for data science, machine learning, and scientific computing.
plugins:
- copyCode
---
---
## Getting Started {.cols-2}
### Importing
```python
import matplotlib.pyplot as plt # Core plotting library
import numpy as np # For numerical operations
```
### Basic Plot
```python
x = np.linspace(0, 10, 100) # 100 points between 0 and 10
y = np.sin(x) # Sine function values
plt.plot(x, y) # Create a line plot
plt.show() # Display the plot
```
---
## Plot Types {.cols-2}
### Line Plot
```python
plt.plot(x, y) # Line plot of y vs x
plt.title("Sine Wave") # Set title
plt.xlabel("x-axis") # Label x-axis
plt.ylabel("y-axis") # Label y-axis
plt.grid(True) # Show gridlines
plt.show()
```
### Scatter Plot
```python
plt.scatter(x, y) # Scatter plot
plt.title("Scatter Plot")
plt.show()
```
### Bar Plot
```python
categories = ['A', 'B', 'C']
values = [10, 20, 15]
plt.bar(categories, values) # Vertical bar chart
plt.title("Bar Chart")
plt.show()
```
### Horizontal Bar Plot
```python
plt.barh(categories, values) # Horizontal bar chart
plt.title("Horizontal Bar Chart")
plt.show()
```
### Histogram
```python
data = np.random.randn(1000) # Random normal distribution
plt.hist(data, bins=30) # Histogram with 30 bins
plt.title("Histogram")
plt.show()
```
### Pie Chart
```python
sizes = [25, 35, 20, 20]
labels = ['A', 'B', 'C', 'D']
plt.pie(sizes, labels=labels, autopct='%1.1f%%') # Pie chart with % labels
plt.title("Pie Chart")
plt.show()
```
---
## Customization {.row-span-2}
| Feature | Code Example | Description |
| --------------- | ------------------------------------------------------------------------------------ | ------------------------------------------- |
| Title | `plt.title("Title")` | Set the title of the plot |
| X/Y Labels | `plt.xlabel("X")`, `plt.ylabel("Y")` | Label the axes |
| Grid | `plt.grid(True)` | Show grid |
| Legend | `plt.legend(["line1"])` | Add legend |
| Line Style | `plt.plot(x, y, linestyle='--')` | Dashed line |
| Color | `plt.plot(x, y, color='green')` | Set line color |
| Marker | `plt.plot(x, y, marker='o')` | Show markers on points |
| Axis Limits | `plt.xlim(0, 10)`, `plt.ylim(-1, 1)` | Set axis range |
| Tick Labels | `plt.xticks([...])`, `plt.yticks([...])` | Customize tick positions |
| Text Annotation | `plt.text(5, 0, "Midpoint")` | Add text at a specific coordinate |
| Arrow | `plt.annotate("Peak", xy=(7, 1), xytext=(6, 1.5), arrowprops=dict(arrowstyle="->"))` | Add annotation arrow |
| Style Sheets | `plt.style.use('ggplot')` | Use predefined styles like `seaborn`, `bmh` |
---
## Subplots & Layouts
### Multiple Subplots
```python
fig, axs = plt.subplots(2, 2) # Create 2x2 grid of subplots
axs[0, 0].plot(x, y) # Top-left subplot
axs[0, 1].scatter(x, y) # Top-right subplot
axs[1, 0].bar(categories, values) # Bottom-left subplot
axs[1, 1].hist(data) # Bottom-right subplot
plt.tight_layout() # Adjust spacing to prevent overlap
plt.show()
```
### Figure Size
```python
plt.figure(figsize=(10, 5)) # Set figure size (width, height in inches)
```
---
## Advanced Visualizations {.cols-2}
### Heatmap
```python
data = np.random.rand(10, 10) # Random 10x10 matrix
plt.imshow(data, cmap='hot', interpolation='nearest') # Display as image
plt.colorbar() # Show color scale
plt.title("Heatmap")
plt.show()
```
### Contour Plot
```python
X, Y = np.meshgrid(x, x)
Z = np.sin(X) * np.cos(Y)
plt.contour(X, Y, Z) # Contour lines
plt.title("Contour Plot")
plt.show()
```
### 3D Plot
```python
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d') # 3D subplot
ax.plot3D(x, y, np.cos(x)) # 3D line
plt.title("3D Plot")
plt.show()
```
---
## Working with Images
```python
import matplotlib.image as mpimg
img = mpimg.imread('image.jpg') # Load image
plt.imshow(img) # Display image
plt.axis('off') # Hide axes
plt.title("Image Display")
plt.show()
```
---
## For Machine Learning
### Plotting Loss vs Epoch
```python
epochs = range(1, 11)
loss = [0.9, 0.7, 0.5, 0.4, 0.3, 0.25, 0.2, 0.18, 0.15, 0.13]
plt.plot(epochs, loss)
plt.title("Training Loss")
plt.xlabel("Epoch")
plt.ylabel("Loss")
plt.show()
```
### Confusion Matrix (Heatmap)
```python
from sklearn.metrics import confusion_matrix
import seaborn as sns
y_true = [0, 1, 2, 2, 0]
y_pred = [0, 0, 2, 2, 1]
cm = confusion_matrix(y_true, y_pred) # Create confusion matrix
sns.heatmap(cm, annot=True, fmt='d', cmap='Blues') # Heatmap visualization
plt.title("Confusion Matrix")
plt.show()
```
### ROC Curve
```python
from sklearn.metrics import roc_curve, auc
fpr, tpr, _ = roc_curve([0, 0, 1, 1], [0.1, 0.4, 0.35, 0.8]) # Compute ROC
roc_auc = auc(fpr, tpr) # Area under curve
plt.plot(fpr, tpr, label=f'AUC = {roc_auc:.2f}')
plt.plot([0, 1], [0, 1], 'k--') # Diagonal line
plt.xlabel("False Positive Rate")
plt.ylabel("True Positive Rate")
plt.title("ROC Curve")
plt.legend()
plt.show()
```
---
## Saving Plots
```python
plt.savefig("figure.png", dpi=300, bbox_inches='tight') # Save plot to file
```
---
## Show & Clear
```python
plt.show() # Show plot window
plt.clf() # Clear current figure (useful when plotting in loops)
plt.close() # Close figure window (useful in scripts or GUI apps)
```
---
## More Useful Functions
| Function | Use Case |
| ------------------------------ | ------------------------------- |
| `plt.fill_between(x, y1, y2)` | Fill area between curves |
| `plt.axhline(y=value)` | Draw horizontal line at y |
| `plt.axvline(x=value)` | Draw vertical line at x |
| `plt.errorbar(x, y, yerr=...)` | Plot with error bars |
| `plt.twinx()` | Create secondary y-axis |
| `plt.subplots_adjust(...)` | Manually adjust subplot spacing |
| `plt.gca()` | Get current axes |
| `plt.gcf()` | Get current figure |
---
================================================
FILE: source/_posts/microsoft-teams.md
================================================
---
title: Microsoft Teams
date: 2022-11-23 16:23:31.706764
background: bg-[#4aa4ea]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 38 keyboard shortcuts found in Microsoft Teams
---
## Keyboard Shortcuts
### General
| Shortcut | Action |
| ---------- | ----------------------- |
| `Ctrl` `.` | Show keyboard shortcuts |
| `Ctrl` `E` | Go to search |
| `Ctrl` `/` | Show commands |
| `Ctrl` `G` | Goto |
| `Ctrl` `N` | Start new chat |
| `Ctrl` `,` | Open settings |
| `F1` | Open help |
| `Esc` | Close |
| `Ctrl` `=` | Zoom in |
| `Ctrl` `-` | Zoom out |
| `Ctrl` `0` | Return to default zoom |
{.shortcuts}
### Navigation
| Shortcut | Action |
| --------------------- | -------------------------- |
| `Ctrl` `1` | Open activity |
| `Ctrl` `2` | Open chat |
| `Ctrl` `3` | Open teams |
| `Ctrl` `4` | Open calendar |
| `Ctrl` `5` | Open calls |
| `Ctrl` `6` | Open files |
| `Alt` `Up` | Go to previous list item |
| `Alt` `Down` | Go to next list item |
| `Ctrl` `Shift` `Up` | Move selected team up |
| `Ctrl` `Shift` `Down` | Move selected team down |
| `Ctrl` `Shift` `F6` | Go to the previous section |
| `Ctrl` `F6` | Go to the next section |
{.shortcuts}
### Messaging
| Shortcut | Action |
| ------------------ | --------------------------------- |
| `Alt` `Shift` `C` | Go to compose box |
| `Ctrl` `Shift` `X` | Expand compose box |
| `Ctrl` `Enter` | Send, in the expanded compose box |
| `Ctrl` `O` | Attach a file |
| `Shift` `Enter` | Start a new line |
| `Alt` `Shift` `R` | Reply to thread |
{.shortcuts}
### Meetings and Calls
| Shortcut | Action |
| ---------------------- | --------------------- |
| `Ctrl` `Shift` `A` | Accept video call |
| `Ctrl` `Shift` `S` | Accept audio call |
| `Ctrl` `Shift` `D` | Decline call |
| `Ctrl` `Shift` `C` | Start audio call |
| `Ctrl` `Shift` `U` | Start video call |
| `Ctrl` `Shift` `M` | Toggle mute |
| `Ctrl` `Shift` `O` | Toggle video |
| `Ctrl` `Shift` `F` | Toggle fullscreen |
| `Ctrl` `Shift` `Space` | Go to sharing toolbar |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Microsoft Teams](https://support.microsoft.com/en-us/office/keyboard-shortcuts-for-microsoft-teams-2e8e2a70-e8d8-4a19-949b-4c36dd5292d2)
_(support.microsoft.com)_
================================================
FILE: source/_posts/mime.md
================================================
---
title: MIME types
date: 2020-04-03 17:28:43
tags:
- media type
categories:
- Other
intro: |
This cheat sheet lists some common MIME types for the Web. You can look in the [IANA/MIME Media Types registry](http://www.iana.org/assignments/media-types/index.html) which contains all registered MIME types.
---
## Getting Started {.cols-2}
### Introduction
- The MIME type registry associates particular filename extensions and filename pattern
- MIME (Multipurpose Internet Mail Extensions) type aka media type
- MIME types are defined and standardized in IETF's RFC 6838
- Indicates the nature and format of a document, file, or assortment of bytes.
- For file formats or format contents on the Internet
{.marker-round}
### Multi-format of MIME types
- [Markdown Table](https://tableconvert.com/html-to-markdown?data=https://cheatsheets.zip/mime#TableGenerator)
- [Template](https://tableconvert.com/html-to-template?data=https://cheatsheets.zip/mime#TableGenerator)
- [LaTeX Table](https://tableconvert.com/html-to-latex?data=https://cheatsheets.zip/mime#TableGenerator)
- [CSV](https://tableconvert.com/html-to-csv?data=https://cheatsheets.zip/mime#TableGenerator)
- [Excel](https://tableconvert.com/html-to-excel?data=https://cheatsheets.zip/mime#TableGenerator)
- [JSON Array](https://tableconvert.com/html-to-json?data=https://cheatsheets.zip/mime#TableGenerator)
- [HTML Table](https://tableconvert.com/html-to-html?data=https://cheatsheets.zip/mime#TableGenerator)
- [Insert SQL](https://tableconvert.com/html-to-sql?data=https://cheatsheets.zip/mime#TableGenerator)
- [YAML Sequence](https://tableconvert.com/html-to-yaml?data=https://cheatsheets.zip/mime#TableGenerator)
- [XML](https://tableconvert.com/html-to-xml?data=https://cheatsheets.zip/mime#TableGenerator)
- [ASCII](https://tableconvert.com/html-to-ascii?data=https://cheatsheets.zip/mime#TableGenerator)
- [MediaWiki Table](https://tableconvert.com/html-to-mediawiki?data=https://cheatsheets.zip/mime#TableGenerator)
- [AsciiDoc Table](https://tableconvert.com/html-to-asciidoc?data=https://cheatsheets.zip/mime#TableGenerator)
- [Jira Table](https://tableconvert.com/html-to-jira?data=https://cheatsheets.zip/mime#TableGenerator)
- [Textile Table](https://tableconvert.com/html-to-textile?data=https://cheatsheets.zip/mime#TableGenerator)
- [reStructuredText](https://tableconvert.com/html-to-restructuredtext?data=https://cheatsheets.zip/mime#TableGenerator)
- [PHP Array](https://tableconvert.com/html-to-php?data=https://cheatsheets.zip/mime#TableGenerator)
- [Ruby Array](https://tableconvert.com/html-to-ruby?data=https://cheatsheets.zip/mime#TableGenerator)
- [ASP Array](https://tableconvert.com/html-to-asp?data=https://cheatsheets.zip/mime#TableGenerator)
- [ActionScript](https://tableconvert.com/html-to-actionscript?data=https://cheatsheets.zip/mime#TableGenerator)
- [BBCode](https://tableconvert.com/html-to-bbcode?data=https://cheatsheets.zip/mime#TableGenerator)
- [PDF](https://tableconvert.com/html-to-pdf?data=https://cheatsheets.zip/mime#TableGenerator)
- [JPEG](https://tableconvert.com/html-to-jpeg?data=https://cheatsheets.zip/mime#TableGenerator)
{.cols-4 .marker-none}
## Lists of MIME types {.cols-1}
### Common MIME (Media) types
| Extension | Kind of document | MIME Type \(Content Type\) |
| --------------- | ------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------- |
| \.aac | AAC audio | audio/aac |
| \.abw | AbiWord document | application/x\-abiword |
| \.arc | Archive document \(multiple files embedded\) | application/x\-freearc |
| \.avi | AVI: Audio Video Interleave | video/x\-msvideo |
| \.azw | Amazon Kindle eBook format | application/vnd\.amazon\.ebook |
| \.bin | Any kind of binary data | application/octet\-stream |
| \.bmp | Windows OS/2 Bitmap Graphics | image/bmp |
| \.bz | BZip archive | application/x\-bzip |
| \.bz2 | BZip2 archive | application/x\-bzip2 |
| \.csh | C\-Shell script | application/x\-csh |
| \.css | Cascading Style Sheets \(CSS\) | text/css |
| \.csv | Comma\-separated values \(CSV\) | text/csv |
| \.doc | Microsoft Word | application/msword |
| \.docx | Microsoft Word \(OpenXML\) | application/vnd\.openxmlformats\-officedocument\.wordprocessingml\.document |
| \.eot | MS Embedded OpenType fonts | application/vnd\.ms\-fontobject |
| \.epub | Electronic publication \(EPUB\) | application/epub\+zip |
| \.gz | GZip Compressed Archive | application/gzip |
| \.gif | Graphics Interchange Format \(GIF\) | image/gif |
| \.htm \.html | HyperText Markup Language \(HTML\) | text/html |
| \.ico | Icon format | image/vnd\.microsoft\.icon |
| \.ics | iCalendar format | text/calendar |
| \.jar | Java Archive \(JAR\) | application/java\-archive |
| \.jpeg \.jpg | JPEG images | image/jpeg |
| \.js | JavaScript | text/javascript |
| \.json | JSON format | application/json |
| \.jsonld | JSON\-LD format | application/ld\+json |
| \.mid \.midi | Musical Instrument Digital Interface \(MIDI\) | audio/midi audio/x\-midi |
| \.mjs | JavaScript module | text/javascript |
| \.mp3 | MP3 audio | audio/mpeg |
| \.mpeg | MPEG Video | video/mpeg |
| \.mpkg | Apple Installer Package | application/vnd\.apple\.installer\+xml |
| \.odp | OpenDocument presentation document | application/vnd\.oasis\.opendocument\.presentation |
| \.ods | OpenDocument spreadsheet document | application/vnd\.oasis\.opendocument\.spreadsheet |
| \.odt | OpenDocument text document | application/vnd\.oasis\.opendocument\.text |
| \.oga | OGG audio | audio/ogg |
| \.ogv | OGG video | video/ogg |
| \.ogx | OGG | application/ogg |
| \.opus | Opus audio | audio/opus |
| \.otf | OpenType font | font/otf |
| \.png | Portable Network Graphics | image/png |
| \.pdf | Adobe Portable Document Format \(PDF\) | application/pdf |
| \.php | Hypertext Preprocessor \(Personal Home Page\) | application/php |
| \.ppt | Microsoft PowerPoint | application/vnd\.ms\-powerpoint |
| \.pptx | Microsoft PowerPoint \(OpenXML\) | application/vnd\.openxmlformats\-officedocument\.presentationml\.presentation |
| \.rar | RAR archive | application/vnd\.rar |
| \.rtf | Rich Text Format \(RTF\) | application/rtf |
| \.sh | Bourne shell script | application/x\-sh |
| \.svg | Scalable Vector Graphics \(SVG\) | image/svg\+xml |
| \.swf | Small web format \(SWF\) or Adobe Flash document | application/x\-shockwave\-flash |
| \.tar | Tape Archive \(TAR\) | application/x\-tar |
| \.tif \.tiff | Tagged Image File Format \(TIFF\) | image/tiff |
| \.ts | MPEG transport stream | video/mp2t |
| \.ttf | TrueType Font | font/ttf |
| \.txt | Text, \(generally ASCII or ISO 8859\-n\) | text/plain |
| \.vsd | Microsoft Visio | application/vnd\.visio |
| \.wav | Waveform Audio Format | audio/wav |
| \.weba | WEBM audio | audio/webm |
| \.webm | WEBM video | video/webm |
| \.webp | WEBP image | image/webp |
| \.woff | Web Open Font Format \(WOFF\) | font/woff |
| \.woff2 | Web Open Font Format \(WOFF\) | font/woff2 |
| \.xhtml | XHTML | application/xhtml\+xml |
| \.xls | Microsoft Excel | application/vnd\.ms\-excel |
| \.xlsx | Microsoft Excel \(OpenXML\) | application/vnd\.openxmlformats\-officedocument\.spreadsheetml\.sheet |
| \.xml | XML | application/xml if not readable from casual users \(RFC 3023, section 3\) text/xml if readable from casual users \(RFC 3023, section 3\) |
| \.xul | XUL | application/vnd\.mozilla\.xul\+xml |
| \.zip | ZIP archive | application/zip |
| \.3gp | 3GPP audio/video container | video/3gpp audio/3gpp if it doesn't contain video |
| \.3g2 | 3GPP2 audio/video container | video/3gpp2 audio/3gpp2 if it doesn't contain video |
| \.7z | 7\-zip archive | application/x\-7z\-compressed |
| \.markdown \.md | Markdown File | text/markdown |
{.show-header}
================================================
FILE: source/_posts/minecraft-bedrock.md
================================================
---
title: Minecraft Bedrock Edition
date: 2023-12-28 12:00:00
icon: minecraft
background: bg-[#3C3C3C]
tags:
- minecraft
- bedrock
- pe
- commands
- cheats
- game
categories:
- Game
intro: A comprehensive reference for Minecraft Bedrock Edition (1.20.x) commands.
---
## Target Selectors
| Selector | Description |
| :--- | :--- |
| `@p` | Nearest player |
| `@r` | Random player |
| `@a` | All players |
| `@e` | All entities (mobs, items, etc.) |
| `@s` | The entity executing the command (Self) |
| `@c` | The player's agent (Education Edition/Code Builder) |
### Selector Arguments
| Argument | Example | Description |
| :--- | :--- | :--- |
| `type` | `@e[type=creeper]` | Selects entities of a specific type |
| `r` / `rm` | `@a[r=10]` | Selects within a max radius (`r`) or min radius (`rm`) |
| `c` | `@e[c=1]` | Limits the count of targets (nearest first) |
| `m` | `@a[m=creative]` | Selects players by gamemode |
| `l` / `lm` | `@a[lm=30]` | Selects by level max (`l`) or min (`lm`) |
| `name` | `@e[name="Bob"]` | Selects entities with a specific name tag |
## Core Commands
### Teleport (/tp)
Teleport entities to locations or other entities.
```mcfunction
# Teleport yourself to coordinates
/tp @s 100 64 -200
# Teleport yourself to another player
/tp @s "Player Name"
# Teleport relative to current position
/tp @s ~ ~10 ~
# Teleport with facing direction
/tp @s ~ ~ ~ facing @p
```
### Game Mode (/gamemode)
Changes the player's game mode.
```mcfunction
# Survival Mode (0)
/gamemode s
# or
/gamemode survival
# Creative Mode (1)
/gamemode c
# or
/gamemode creative
# Adventure Mode (2)
/gamemode a
# or
/gamemode adventure
# Spectator Mode (Experimental/New)
/gamemode spectator
```
### Give Items (/give)
Gives items to players.
```mcfunction
# Give a diamond sword
/give @s diamond_sword
# Give 64 stone
/give @s stone 64
# Give item with data value (Legacy/Some items)
# Syntax: /give \| | Run a script on this flow |
| `Ctrl` `l` | Send cuts to clipboard |
{.shortcuts}
## Mitmproxy Filter
### Filter
| - | - |
| --- | ------------------------------------- |
| `f` | Set view filter _(on flow view page)_ |
{.shortcuts}
---
- [RegEX cheatsheet](/regex) _(cheatsheets.zip)_
The regex are Python-style, it can be specified as quoted strings
### Operators
| - | - |
| ------- | --------- | --- |
| `!` | unary not |
| `&` | and |
| ` | ` | or |
| `(...)` | grouping |
### Expressions {.row-span-2}
| - | - |
| -------------- | ---------------------------------------------------------- |
| `~a` | Match asset in response: CSS, Javascript, Flash, images. |
| `~b` `regex` | Body |
| `~bq` `regex` | Request body |
| `~bs` `regex` | Response body |
| `~c` `int` | HTTP response code |
| `~d` `regex` | Domain |
| `~dst` `regex` | Match destination address |
| `~e` | Match error |
| `~h` `regex` | Header |
| `~hq` `regex` | Request header |
| `~hs` `regex` | Response header |
| `~http` | Match HTTP flows |
| `~m` `regex` | Method |
| `~marked` | Match marked flows |
| `~q` | Match request with no response |
| `~s` | Match response |
| `~src` `regex` | Match source address |
| `~t` `regex` | Content-type header |
| `~tcp` | Match TCP flows |
| `~tq` `regex` | Request Content-Type header |
| `~ts` `regex` | Response Content-Type header |
| `~u` `regex` | URL |
| `~websocket` | Match WebSocket flows (and HTTP-WebSocket handshake flows) |
### Flow selectors
Expressions
| - | - |
| ----------- | -------------------------- |
| `@all ` | All flows |
| `@focus ` | The currently focused flow |
| `@shown ` | All flows currently shown |
| `@hidden ` | All flows currently hidden |
| `@marked ` | All marked flows |
| `@unmarked` | All unmarked flows |
mitmproxy has a set of convenient flow selectors that operate on the current view
### Examples
URL containing "google.com"
```
google\.com
```
Requests whose body contains the string "test"
```
~q ~b test
```
Anything but requests with a text/html content type:
```
!(~q & ~t "text/html")
```
Replace entire GET string in a request (quotes required to make it work):
```
":~q ~m GET:.*:/replacement.html"
```
## Mitmproxy Scripts {.cols-2}
### Custom response
```python
from mitmproxy import http
def request(flow: http.HTTPFlow) -> None:
if flow.request.pretty_url == "http://example.com/path":
flow.response = http.HTTPResponse.make(
200, # (optional) status code
b"Hello World", # (optional) content
{"Content-Type": "text/html"} # (optional) headers
)
```
Send a reply from the proxy without sending any data to the remote server
### Add header
```python
class AddHeader:
def __init__(self):
self.num = 0
def response(self, flow):
self.num = self.num + 1
flow.response.headers["count"] = str(self.num)
addons = [
AddHeader()
]
```
Add an HTTP header to each response
## Also see
- [mitmproxy addons](https://github.com/mitmproxy/mitmproxy/tree/master/examples/addons) _(github.com)_
- [mitmproxy docs](https://docs.mitmproxy.org/) _(mitmproxy.org)_
================================================
FILE: source/_posts/monday.md
================================================
---
title: Monday.com
date: 2022-11-23 16:23:31.694181
background: bg-[#f7ce46]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 24 keyboard shortcuts found on Monday.com
---
## Keyboard Shortcuts
### System
| Shortcut | Action |
| ---------- | ----------------------------------------- |
| `Ctrl` `B` | Bolt Switch (quick switch between boards) |
| `Esc` | Close Item Page |
| `Esc` | Close Dialogs |
| `Esc` | Close Search |
{.shortcuts}
### Board I
| Shortcut | Action |
| ------------- | ------------------------ |
| `Down` | Navigate Down |
| `Up` | Navigate Up |
| `Left` | Navigate Left |
| `Right` | Navigate Right |
| `Tab` | Navigate to Next Cell |
| `Shift` `Tab` | Navigate to Previous Tab |
| `Enter` | Edit Cell Content |
| `Backspace` | Clear Cell Content |
| `Space` | Open Column View |
{.shortcuts}
### Board II
| Shortcut | Action |
| ------------------ | -------------------------- |
| `Ctrl` `F` | Search Board |
| `Ctrl` `C` | Copy Cell Content |
| `Ctrl` `V` | Paste Cell Content |
| `Ctrl` `X` | Cut Cell Content |
| `Ctrl` `Enter` | Select Item |
| `Shift` `Enter` | Select Range of Items |
| `Ctrl` `Shift` `G` | Create New Group |
| `Ctrl` `Shift` `C` | Create New Column |
| `Ctrl` `L` | Open Activity Log |
| `Ctrl` `(click)` | Sort Another Column |
| `Ctrl` `G` | Collapse/Expand All Groups |
{.shortcuts}
## Also see
- [Keyboard shortcuts for Monday.com](https://support.monday.com/hc/en-us/articles/115005339905-The-Spreadsheet-capabilities-shortcuts-)
_(support.monday.com)_
================================================
FILE: source/_posts/mongodb.md
================================================
---
title: MongoDB
date: 2023-04-05
background: bg-gradient-to-r from-green-900 via-green-600 to-green-400 hover:from-green-900 hover:via-green-700 hover:to-green-500
tags:
- NoSQL
- DB
categories:
- Database
intro:
The MongoDB cheat sheet provides you with the most commonly used MongoDB commands and queries for your reference. the
cheatsheet is from mongodb developers website
plugins:
- tooltip
- copyCode
---
## Getting Started {.cols-2}
### Connect MongoDB Shell
```mongosh
mongo # connects to mongodb://127.0.0.1:27017 by default
```
```mongosh
mongo --host \` | VCS quick popup |
| `Ctrl` `K` | Commit project to VCS |
| `Ctrl` `T` | Update project from VCS |
| `Alt` `Shift` `C` | View recent changes |
{.shortcuts}
### General
| Shortcut | Action |
| -------------------- | ----------------------------------------- |
| `Shift x2` | Search everywhere |
| `Ctrl` `Shift` `A` | Find Action |
| `Alt` `1-9` | Open corresponding tool window |
| `Ctrl` `Alt` `F11` | Toggle full screen mode |
| `Ctrl` `Shift` `F12` | Toggle maximizing editor |
| `Alt` `Shift` `F` | Add to Favorites |
| `Alt` `Shift` `I` | Inspect current file with current profile |
| `Ctrl` `Alt` `S` | Open Settings dialog |
| `Ctrl` `Tab` | Switch between tabs and tool window |
{.shortcuts}
### Live Templates/Snippets
| Shortcut | Action |
| ---------- | ---------------------------------------------- |
| `Ctrl` `J` | Insert Live Template |
| `eco` | 'echo' statement |
| `fore` | foreach(iterable_expr as $value) {...} |
| `forek` | foreach(iterable_expr as $key => $value) {...} |
| `inc/inco` | 'include'/'include_once' statement |
| `prif` | private function |
| `prof` | protected function |
| `pubf` | public function |
| `rqr/rqro` | 'require'/'require_once' statement |
{.shortcuts}
### Misc
| Shortcut | Action |
| ------------------ | ----------- |
| `Ctrl` `Shift` `A` | Find Action |
{.shortcuts}
## Also see
- [Keyboard shortcuts for PhpStorm](https://resources.jetbrains.com/storage/products/phpstorm/docs/PhpStorm_ReferenceCard.pdf)
_(resources.jetbrains.com)_
================================================
FILE: source/_posts/pm2.md
================================================
---
title: PM2
date: 2022-11-25 18:10:00
background: bg-[#230769]
tags:
- process
categories:
- Linux Command
intro: |
[PM2] is a daemon process manager that will help you manage and keep your application online. Getting started with PM2 is straightforward, it is offered as a simple and intuitive CLI.
plugins:
- copyCode
---
## Getting Started
### Install
The latest PM2 version is installable with NPM or Yarn
```shell script
$ npm install pm2@latest -g
```
OR
```shell script
$ yarn global add pm2
```
### Start an app
The simplest way to start, daemonize and monitor your application is by using this command line
```shell script
$ pm2 start app.js
```
Or start any other application easily
```shell script
$ pm2 start bashscript.sh
$ pm2 start python-app.py --watch
$ pm2 start binary-file -- --port 1520
```
### Some options you can pass to the CLI {.row-span-3}
Specify an app name
```shell script
--name |