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 ================================================ # [optional scope]: # # [optional body] # # [optional footer(s)] # # Commit Types: # feat: New feature # fix: Bug fix # docs: Documentation update # style: Code formatting, no logic changes # refactor: Code refactoring, neither new feature nor bug fix # 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 Examples: # search, theme, css, js, content, build, deps, config, docs # layout, widget, gulp, hexo, markdown, seo, a11y, perf # # Examples: # feat(search): add fuzzy search with highlighting # fix(css): resolve mobile layout overflow issue # docs(readme): update installation instructions # chore(deps): upgrade tailwindcss to v3.4.0 # perf(js): optimize search performance with debouncing # style(css): format tailwind classes according to prettier # # Guidelines: # - Use imperative mood: "add" not "added" or "adds" # - Start with lowercase # - No period at the end # - Keep description concise, under 50 characters ================================================ FILE: .husky/commit-msg ================================================ npx commitlint --edit $1 ================================================ FILE: .husky/pre-commit ================================================ npx lint-staged ================================================ FILE: .lintstagedrc.js ================================================ module.exports = { // JavaScript files '*.{js,mjs}': ['eslint --fix', 'prettier --write'], // CSS files '*.css': ['stylelint --fix', 'prettier --write'], // All other files that Prettier supports '*.{md,json,yml,yaml}': ['prettier --write'] }; ================================================ FILE: .prettierrc.js ================================================ module.exports = { // Basic configuration semi: true, trailingComma: 'none', singleQuote: true, printWidth: 100, tabWidth: 2, useTabs: false, endOfLine: 'lf', // Plugin configuration plugins: ['prettier-plugin-tailwindcss'], // File-specific configuration overrides: [ { files: '*.md', options: { proseWrap: 'preserve', printWidth: 80 } }, { files: '*.yml', options: { singleQuote: false } }, { files: '*.json', options: { trailingComma: 'none' } }, { files: ['themes/coo/source/css/*.css'], options: { printWidth: 120 } } ] }; ================================================ FILE: .stylelintrc.js ================================================ module.exports = { extends: ['stylelint-config-standard'], rules: { // Tailwind CSS compatibility 'at-rule-no-unknown': [ true, { ignoreAtRules: ['tailwind', 'apply', 'variants', 'responsive', 'screen', 'layer'] } ], // Disable @apply deprecation warning, as this is a Tailwind CSS feature 'at-rule-no-deprecated': null, // Allow duplicate selectors, as this is common in generated CSS 'no-descending-specificity': null, 'no-duplicate-selectors': null, // Allow camelCase class names 'selector-class-pattern': null, // Allow camelCase ID selectors 'selector-id-pattern': null, // Allow unknown properties (Tailwind generated CSS variables) 'property-no-unknown': null, // Allow unknown type selectors (custom elements) 'selector-type-no-unknown': null, // Allow unknown declaration values 'declaration-property-value-no-unknown': null, // Allow duplicate custom properties 'declaration-block-no-duplicate-custom-properties': null, // Allow multiple declarations on single line 'declaration-block-single-line-max-declarations': null, // Allow decimal precision 'number-max-precision': null, // Allow unknown media feature values 'media-feature-name-value-no-unknown': null, // Allow non-kebab-case keyframe names 'keyframes-name-pattern': null, // Allow empty source files 'no-empty-source': null }, ignoreFiles: [ 'node_modules/**/*', 'public/**/*', 'themes/coo/source/css/highlightjs/**/*', '**/*.min.css' ] }; ================================================ FILE: Dockerfile ================================================ # Stage 1: build the application FROM node:19 AS build-app WORKDIR /app COPY . . RUN npm install -g pnpm RUN pnpm install RUN pnpm run build # Stage 2: Build nginx FROM nginx:alpine AS build-nginx WORKDIR /usr/share/nginx/html/ COPY --from=build-app /app/public /usr/share/nginx/html/ RUN rm -rf /etc/nginx/conf.d/* COPY nginx.conf /etc/nginx/ EXPOSE 80 # Stage 3: final image FROM alpine:latest RUN apk add --no-cache nginx && mkdir -p /run/nginx COPY --from=build-nginx /usr/share/nginx/html/ /usr/share/nginx/html/ COPY --from=build-nginx /etc/nginx/nginx.conf /etc/nginx/nginx.conf EXPOSE 80 HEALTHCHECK --interval=1s --timeout=3s CMD wget -q -O - http://localhost:80 || exit 1 CMD ["nginx", "-g", "daemon off;"] ================================================ FILE: LICENSE ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: README.md ================================================ # 📖 Reference - Cheat Sheets for Developers [![love](https://badgen.net/badge/make%20with/love/pink)](#) [![License](https://badgen.net/badge/license/GPL-3.0/blue)](https://github.com/Fechin/reference/blob/main/LICENSE) [![Follow us on Twitter](https://img.shields.io/twitter/follow/FechinLi?style=social)](https://twitter.com/FechinLi) Reference is a collection of cheat sheets contributed by open source angels. It shares a quick reference cheat sheet for developers in a nice layout. \[ [中文版](https://github.com/jaywcjlove/reference) | ... \] We encourage you to share your own cheat sheets with the community and make Reference even better. If you notice a cheat sheet that could be improved, feel free to submit a [pull request](#-contributing). ## 👀 Live Demonstration Note: The original domain for this project was quickref.me, which was acquired by a US-based company. Since then, cheatsheets.zip is the primary and maintained domain (All within the bounds of the agreements). You can view the most up-to-date cheat sheets live at [https://cheatsheets.zip](https://cheatsheets.zip/). [![Quick reference](https://cheatsheets.zip/assets/image/preview.png?9nd3)](https://cheatsheets.zip) ## 📚 Cheat Sheets List Reference provides cheat sheets for the following:
Programming - [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
## 🗂️ Directory structure ``` . ├── source │ ├── _posts # Cheat sheet source files │ │ ├── awk.md │ │ ├── vim.md # => https://cheatsheets.zip/vim │ │ ├── php.md │ │ ├── css.md # => https://cheatsheets.zip/css │ │ ├── ... │ └── widget # Widget files │ └── chmod.html ├── public # Distribution files ├── _config.yml ├── gulpfile.js ├── package.json ├── postcss.config.js ├── tailwind.config.js └── themes └── coo # Theme files ``` ## 🤝 Contributing We would like to extend our gratitude to you for considering a contribution to Reference. Your support is what makes this project a truly resource. Please note that the primary domain for accessing the most up-to-date content is [cheatsheets.zip](https://cheatsheets.zip). Feel free to [submit issues](https://github.com/Fechin/reference/issues/new?assignee=Fechin) and enhancement requests. For consistency, we encourage you to refer to the [https://cheatsheets.zip/quickref](https://cheatsheets.zip/quickref) when creating or editing cheat sheets. To get started with development, follow these steps: 1. Clone Github repo `git clone https://github.com/Fechin/reference.git` 2. Install `npm` package manager (Read [installation guide](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)) 3. Run `npm install` in the root folder to install dependencies. 4. Run `npm run dev` to start a dev server. This serves the project and live reloads when any files are changed, then visit http://127.0.0.1:4000 preview. 5. Submit a pull request and wait for it to be reviewed and merged. To create or edit a cheat sheet, you'll need to create or edit a markdown file in `source/_posts/{filename}.md`. The file should include a front matter section with the following format: ```markdown --- title: CheatSheets date: 2020-11-25 18:28:43 icon: icon-style background: bg-indigo-600 tags: categories: - Other intro: This is a reference of styles that you can use on quickref cheat sheets! --- ``` Only the `title` and `intro` fields are required, and the other options can be left blank. ## 🐦 Follow us on Twitter [![Follow us on Twitter](https://img.shields.io/twitter/follow/FechinLi?color=%234a99e9&style=for-the-badge)](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 - [![Favicon](https://icon.horse/icon/buoyhealth.com) Buoy health](https://buoyhealth.com) - [![Favicon](https://icon.horse/icon/mdacne.com) Mdacne](https://mdacne.com) - [![Favicon](https://icon.horse/icon/youper.ai) Youper](https://youper.ai) - [![Favicon](https://icon.horse/icon/endel.io/sleep) Endel × james blake: wind down](https://endel.io/sleep) - [![Favicon](https://icon.horse/icon/nowdialogue.com) Dialogue](https://nowdialogue.com) - [![Favicon](https://icon.horse/icon/maslo.ai) Maslo ai](https://maslo.ai) {.icon-list .marker-none} ### Text - [![Favicon](https://icon.horse/icon/quillbot.com) Quillbot paraphraser](https://quillbot.com) - [![Favicon](https://icon.horse/icon/notion.so/product/ai) Notion ai](https://notion.so/product/ai) - [![Favicon](https://icon.horse/icon/naturalreaders.com) Naturalreader](https://naturalreaders.com) - [![Favicon](https://icon.horse/icon/wordtune.com/read) Wordtune read](https://wordtune.com/read) - [![Favicon](https://icon.horse/icon/uberduck.ai) Underduck](https://uberduck.ai) - [![Favicon](https://icon.horse/icon/aiseo.ai/templates/slogan-generator.html) Slogan generator](https://aiseo.ai/templates/slogan-generator.html) {.icon-list .marker-none} ### Writing - [![Favicon](https://icon.horse/icon/prowritingaid.com) Prowritingaid](https://prowritingaid.com) - [![Favicon](https://icon.horse/icon/sapling.ai) Sapling](https://sapling.ai) - [![Favicon](https://icon.horse/icon/coschedule.com/headline-studio) Headline studio](https://coschedule.com/headline-studio) - [![Favicon](https://icon.horse/icon/trinka.ai) Trinka](https://trinka.ai) - [![Favicon](https://icon.horse/icon/benchmarkemail.com/features/smart-content) Benchmark email](https://benchmarkemail.com/features/smart-content) - [![Favicon](https://icon.horse/icon/sassbook.com/ai-writer) Sassbook ai writer](https://sassbook.com/ai-writer) {.icon-list .marker-none} ### Image editing - [![Favicon](https://icon.horse/icon/remove.bg) Remove.bg](https://remove.bg) - [![Favicon](https://icon.horse/icon/tools.picsart.com/image) Quicktools by picsart](https://tools.picsart.com/image) - [![Favicon](https://icon.horse/icon/befunky.com) Befunky](https://befunky.com) - [![Favicon](https://icon.horse/icon/topazlabs.com/topaz-photo-ai) Topaz photo ai](https://topazlabs.com/topaz-photo-ai) - [![Favicon](https://icon.horse/icon/photoroom.com) Photoroom](https://photoroom.com) - [![Favicon](https://icon.horse/icon/erase.bg) Erase.bg](https://erase.bg) {.icon-list .marker-none} ### Productivity - [![Favicon](https://icon.horse/icon/openai.com/blog/dall-e) Dall-e](https://openai.com/blog/dall-e) - [![Favicon](https://icon.horse/icon/flowrite.com) Flowrite](https://flowrite.com) - [![Favicon](https://icon.horse/icon/golden.com) Golden](https://golden.com) - [![Favicon](https://icon.horse/icon/picturethisai.com) Picturethis](https://picturethisai.com) - [![Favicon](https://icon.horse/icon/wandb.ai/site) Weights & biases](https://wandb.ai/site) - [![Favicon](https://icon.horse/icon/vwo.com/ab-testing-openai-gpt-3) Vwo humans vs ai](https://vwo.com/ab-testing-openai-gpt-3) {.icon-list .marker-none} ### Music - [![Favicon](https://icon.horse/icon/openai.com/blog/musenet) Musenet (openai)](https://openai.com/blog/musenet) - [![Favicon](https://icon.horse/icon/sites.research.google/trc) Tensorflow research cloud](https://sites.research.google/trc) - [![Favicon](https://icon.horse/icon/moises.ai) Moises app](https://moises.ai) - [![Favicon](https://icon.horse/icon/soundraw.io) Soundraw](https://soundraw.io) - [![Favicon](https://icon.horse/icon/theselyricsdonotexist.com) Ai lyrics generator](https://theselyricsdonotexist.com) - [![Favicon](https://icon.horse/icon/phonicmind.com) Phonicmind](https://phonicmind.com) {.icon-list .marker-none} ### Design assistant - [![Favicon](https://icon.horse/icon/kapwing.com/cartoonify) Cartoonify](https://kapwing.com/cartoonify) - [![Favicon](https://icon.horse/icon/icons8.com/upscaler) Smart upscaler](https://icons8.com/upscaler) - [![Favicon](https://icon.horse/icon/icons8.com/bgremover) Background remover](https://icons8.com/bgremover) - [![Favicon](https://icon.horse/icon/icons8.com/lunacy) Lunacy](https://icons8.com/lunacy) - [![Favicon](https://icon.horse/icon/pixlr.com) Pixlr](https://pixlr.com) - [![Favicon](https://icon.horse/icon/namecheap.com/logo-maker) Launchaco free logo builder](https://namecheap.com/logo-maker) {.icon-list .marker-none} ### Image - [![Favicon](https://icon.horse/icon/icons8.com/swapper) Swapper](https://icons8.com/swapper) - [![Favicon](https://icon.horse/icon/movavi.com/photo-editor) Movavi picverse](https://movavi.com/photo-editor) - [![Favicon](https://icon.horse/icon/clipstudio.net/en) Clipstudio](https://clipstudio.net/en) - [![Favicon](https://icon.horse/icon/looka.com) Looka](https://looka.com) - [![Favicon](https://icon.horse/icon/midjourney.com) Midjourney](https://midjourney.com) - [![Favicon](https://icon.horse/icon/deepai.org/machine-learning-model/text2img) Text to image api](https://deepai.org/machine-learning-model/text2img) {.icon-list .marker-none} ### Business - [![Favicon](https://icon.horse/icon/tools.picsart.com/text/ai-writer) Ai writer by picsart](https://tools.picsart.com/text/ai-writer) - [![Favicon](https://icon.horse/icon/aiseo.ai/tools/paraphrasing-tool.html) Intelligent paraphraser](https://aiseo.ai/tools/paraphrasing-tool.html) - [![Favicon](https://icon.horse/icon/bardeen.ai) Bardeen ai](https://bardeen.ai) - [![Favicon](https://icon.horse/icon/wonsulting.com/resumai) Resumai](https://wonsulting.com/resumai) - [![Favicon](https://icon.horse/icon/durable.co/ai-website-builder) Durable ai site builder](https://durable.co/ai-website-builder) - [![Favicon](https://icon.horse/icon/tally.so/r/npeJgq) Startup pitch generator](https://tally.so/r/npeJgq) {.icon-list .marker-none} ### Virtual reality - [![Favicon](https://icon.horse/icon/myheritage.com/deep-nostalgia) Deep nostalgia™](https://myheritage.com/deep-nostalgia) - [![Favicon](https://icon.horse/icon/resemble.ai/gpt-3) Gpt-3 custom ai voices](https://resemble.ai/gpt-3) - [![Favicon](https://icon.horse/icon/sketchar.io) Ai portraits by sketchar](https://sketchar.io) - [![Favicon](https://icon.horse/icon/anything.world) Anything world](https://anything.world) - [![Favicon](https://icon.horse/icon/aipoly.com) Aipoly](https://aipoly.com) - [![Favicon](https://icon.horse/icon/aws.amazon.com/comprehend) Amazon comprehend](https://aws.amazon.com/comprehend) {.icon-list .marker-none} ### Developer tools - [![Favicon](https://icon.horse/icon/coda.io/@coda/openai-for-coda) Openai for coda](https://coda.io/@coda/openai-for-coda) - [![Favicon](https://icon.horse/icon/case-study-page-nanonets.webflow.io/ocr-api) Nanonets ocr](https://case-study-page-nanonets.webflow.io/ocr-api) - [![Favicon](https://icon.horse/icon/ai.google) Google.ai](https://ai.google) - [![Favicon](https://icon.horse/icon/assemblyai.com) Assemblyai](https://assemblyai.com) - [![Favicon](https://icon.horse/icon/httpie.io) Httpie ai](https://httpie.io) - [![Favicon](https://icon.horse/icon/runpod.io) Runpod](https://runpod.io) {.icon-list .marker-none} ### Avatar - [![Favicon](https://icon.horse/icon/myheritage.com/ai-time-machine) Ai time machine](https://myheritage.com/ai-time-machine) - [![Favicon](https://icon.horse/icon/readyplayer.me) Ready player me](https://readyplayer.me) - [![Favicon](https://icon.horse/icon/openart.ai/photobooth) Openart photo booth](https://openart.ai/photobooth) - [![Favicon](https://icon.horse/icon/hey.reface.ai) Reface ai](https://hey.reface.ai) - [![Favicon](https://icon.horse/icon/socialbook.io/ai-avatar) Pandora avatars](https://socialbook.io/ai-avatar) - [![Favicon](https://icon.horse/icon/livereacting.com/ai-host-for-live-stream) Livereacting ai](https://livereacting.com/ai-host-for-live-stream) {.icon-list .marker-none} ### Fun tools - [![Favicon](https://icon.horse/icon/transformer.huggingface.co) Write with artificial intelligence](https://transformer.huggingface.co) - [![Favicon](https://icon.horse/icon/chai.ml) Chai](https://chai.ml) - [![Favicon](https://icon.horse/icon/pudding.cool/2020/12/judge-my-spotify) How bad is your spotify?](https://pudding.cool/2020/12/judge-my-spotify) - [![Favicon](https://icon.horse/icon/playphrase.me/) Playphrase.me](https://playphrase.me/) - [![Favicon](https://icon.horse/icon/dreamily.ai/editor) Dreamily](https://dreamily.ai/editor) - [![Favicon](https://icon.horse/icon/supermeme.ai) Supermeme.ai](https://supermeme.ai) {.icon-list .marker-none} ### Seo - [![Favicon](https://icon.horse/icon/writer.com) Writer](https://writer.com) - [![Favicon](https://icon.horse/icon/jenni.ai) Jenni](https://jenni.ai) - [![Favicon](https://icon.horse/icon/articleforge.com) Articleforge](https://articleforge.com) - [![Favicon](https://icon.horse/icon/wordhero.co) Wordhero](https://wordhero.co) - [![Favicon](https://icon.horse/icon/ai-writer.com) Ai-writer](https://ai-writer.com) - [![Favicon](https://icon.horse/icon/growthbarseo.com) Growthbar](https://growthbarseo.com) {.icon-list .marker-none} ### Video editing - [![Favicon](https://icon.horse/icon/wave.video) Wave.video](https://wave.video) - [![Favicon](https://icon.horse/icon/topazlabs.com/topaz-video-ai) Topaz video ai](https://topazlabs.com/topaz-video-ai) - [![Favicon](https://icon.horse/icon/unscreen.com) Unscreen.com](https://unscreen.com) - [![Favicon](https://icon.horse/icon/pictory.ai) Pictory](https://pictory.ai) - [![Favicon](https://icon.horse/icon/typestudio.co/tool/video-to-text) Type studio](https://typestudio.co/tool/video-to-text) - [![Favicon](https://icon.horse/icon/papercup.com) Papercup](https://papercup.com) {.icon-list .marker-none} ### Code assistant - [![Favicon](https://icon.horse/icon/replit.com/site/ghostwriter) Ghostwriter](https://replit.com/site/ghostwriter) - [![Favicon](https://icon.horse/icon/fig.io/user-manual/ai) Fig ai](https://fig.io/user-manual/ai) - [![Favicon](https://icon.horse/icon/continual.ai) Continual](https://continual.ai) - [![Favicon](https://icon.horse/icon/cheatlayer.com) Cheat layer](https://cheatlayer.com) - [![Favicon](https://icon.horse/icon/kodezi.com) Kodezi ai](https://kodezi.com) - [![Favicon](https://icon.horse/icon/whatthediff.ai) Whatthediff](https://whatthediff.ai) {.icon-list .marker-none} ### Mac - [![Favicon](https://icon.horse/icon/myfonts.com) Whatthefont](https://myfonts.com) - [![Favicon](https://icon.horse/icon/references.design) References.design](https://references.design) - [![Favicon](https://icon.horse/icon/github.com/Swift-AI/Swift-AI) Swift ai](https://github.com/Swift-AI/Swift-AI) {.icon-list .marker-none} ### Audio editing - [![Favicon](https://icon.horse/icon/voicemod.net) Voicemod](https://voicemod.net) - [![Favicon](https://icon.horse/icon/podcastle.ai) Podcastle](https://podcastle.ai) - [![Favicon](https://icon.horse/icon/beatoven.ai) Beatoven.ai](https://beatoven.ai) - [![Favicon](https://icon.horse/icon/altered.ai) Altered](https://altered.ai) - [![Favicon](https://icon.horse/icon/cleanvoice.ai) Cleanvoice ai](https://cleanvoice.ai) - [![Favicon](https://icon.horse/icon/krisp.ai) Krisp](https://krisp.ai) {.icon-list .marker-none} ### Copywriting - [![Favicon](https://icon.horse/icon/inkforall.com) Ink](https://inkforall.com) - [![Favicon](https://icon.horse/icon/boomeranggmail.com/respondable) Respondable](https://boomeranggmail.com/respondable) - [![Favicon](https://icon.horse/icon/frase.io) Frase](https://frase.io) - [![Favicon](https://icon.horse/icon/anyword.com) Anyword](https://anyword.com) - [![Favicon](https://icon.horse/icon/copysmith.ai) Copysmith](https://copysmith.ai) - [![Favicon](https://icon.horse/icon/hypotenuse.ai) Hypotenuse ai](https://hypotenuse.ai) {.icon-list .marker-none} ### General writing - [![Favicon](https://icon.horse/icon/languagetool.org) Languagetool](https://languagetool.org) - [![Favicon](https://icon.horse/icon/wordtune.com) Wordtune](https://wordtune.com) - [![Favicon](https://icon.horse/icon/kickresume.com) Kickresume](https://kickresume.com) - [![Favicon](https://icon.horse/icon/nichesss.com) Nichess](https://nichesss.com) - [![Favicon](https://icon.horse/icon/wordai.com) Wordai](https://wordai.com) - [![Favicon](https://icon.horse/icon/corrector.app) Corrector app](https://corrector.app) {.icon-list .marker-none} ### Summarizer - [![Favicon](https://icon.horse/icon/otter.ai) Otter ai](https://otter.ai) - [![Favicon](https://icon.horse/icon/tldrthis.com) Tldr this](https://tldrthis.com) - [![Favicon](https://icon.horse/icon/summari.com) Summari](https://summari.com) - [![Favicon](https://icon.horse/icon/tactiq.io) Tactiq](https://tactiq.io) - [![Favicon](https://icon.horse/icon/genei.io) Genei](https://genei.io) - [![Favicon](https://icon.horse/icon/upword.ai) Upword](https://upword.ai) {.icon-list .marker-none} ### Video generator - [![Favicon](https://icon.horse/icon/invideo.io) Invideo](https://invideo.io) - [![Favicon](https://icon.horse/icon/replicate.com/google-research/frame-interpolation) Film](https://replicate.com/google-research/frame-interpolation) - [![Favicon](https://icon.horse/icon/synthesia.io) Synthesia](https://synthesia.io) - [![Favicon](https://icon.horse/icon/movio.la) Movio](https://movio.la) - [![Favicon](https://icon.horse/icon/hourone.ai) Hourone](https://hourone.ai) - [![Favicon](https://icon.horse/icon/colossyan.com) Colossyan](https://colossyan.com) {.icon-list .marker-none} ### Legal assistant - [![Favicon](https://icon.horse/icon/donotpay.com) Donotpay](https://donotpay.com) - [![Favicon](https://icon.horse/icon/darrow.ai) Darrow ai](https://darrow.ai) - [![Favicon](https://icon.horse/icon/spellbook.legal) Spellbook](https://spellbook.legal) - [![Favicon](https://icon.horse/icon/patentpal.com) Patentpal](https://patentpal.com) - [![Favicon](https://icon.horse/icon/legalrobot.com) Legal robot](https://legalrobot.com) - [![Favicon](https://icon.horse/icon/detangle.ai) Detangle.ai](https://detangle.ai) {.icon-list .marker-none} ### Generative art - [![Favicon](https://icon.horse/icon/hotpot.ai/art-generator) Hotpot art generator](https://hotpot.ai/art-generator) - [![Favicon](https://icon.horse/icon/bannerbear.com) Bannerbear](https://bannerbear.com) - [![Favicon](https://icon.horse/icon/6pen.art) 6pen art](https://6pen.art) - [![Favicon](https://icon.horse/icon/admaker.memorable.io) Memorable ad maker](https://admaker.memorable.io) - [![Favicon](https://icon.horse/icon/withflair.ai) Flair](https://withflair.ai) - [![Favicon](https://icon.horse/icon/designedwithai.com) Designed with ai](https://designedwithai.com) {.icon-list .marker-none} ### Text to speech - [![Favicon](https://icon.horse/icon/speechify.com) Speechify](https://speechify.com) - [![Favicon](https://icon.horse/icon/fakeyou.com) Fakeyou](https://fakeyou.com) - [![Favicon](https://icon.horse/icon/play.ht) Play.ht](https://play.ht) - [![Favicon](https://icon.horse/icon/wellsaidlabs.com) Wellsaidlabs](https://wellsaidlabs.com) - [![Favicon](https://icon.horse/icon/resemble.ai) Resemble](https://resemble.ai) - [![Favicon](https://icon.horse/icon/aiva.ai) Aiva](https://aiva.ai) {.icon-list .marker-none} ### Life assistant - [![Favicon](https://icon.horse/icon/resumeworded.com/index.php) Resume worded](https://resumeworded.com/index.php) - [![Favicon](https://icon.horse/icon/replika.com) Replika](https://replika.com) - [![Favicon](https://icon.horse/icon/justlearn.com) Justlearn](https://justlearn.com) - [![Favicon](https://icon.horse/icon/thekeys.ai) Thekeys](https://thekeys.ai) - [![Favicon](https://icon.horse/icon/looria.com) Looria](https://looria.com) - [![Favicon](https://icon.horse/icon/woebothealth.com) Woebot health](https://woebothealth.com) {.icon-list .marker-none} ### Image generator - [![Favicon](https://icon.horse/icon/hotpot.ai) Hotpot.ai](https://hotpot.ai) - [![Favicon](https://icon.horse/icon/generated.photos) Generated photos](https://generated.photos) - [![Favicon](https://icon.horse/icon/imgcreator.zmo.ai) Imgcreator](https://imgcreator.zmo.ai) - [![Favicon](https://icon.horse/icon/getimg.ai) Getimg.ai](https://getimg.ai) - [![Favicon](https://icon.horse/icon/stockai.com) Stock ai](https://stockai.com) - [![Favicon](https://icon.horse/icon/gocharlie.ai) Go charlie](https://gocharlie.ai) {.icon-list .marker-none} ### Book - [![Favicon](https://icon.horse/icon/readthistwice.com/sona) Sona](https://readthistwice.com/sona) {.icon-list .marker-none} ### Gaming - [![Favicon](https://icon.horse/icon/play.aidungeon.io) Aidungeon](https://play.aidungeon.io) - [![Favicon](https://icon.horse/icon/beam.eyeware.tech) Eyeware beam](https://beam.eyeware.tech) - [![Favicon](https://icon.horse/icon/litrpgadventures.com) Litrpg adventures](https://litrpgadventures.com) - [![Favicon](https://icon.horse/icon/charisma.ai) Charisma](https://charisma.ai) - [![Favicon](https://icon.horse/icon/hiddendoor.co) Hidden door](https://hiddendoor.co) - [![Favicon](https://icon.horse/icon/ggpredict.io) Ggpredict](https://ggpredict.io) {.icon-list .marker-none} ### Image scanning - [![Favicon](https://icon.horse/icon/experiments.withgoogle.com/thing-translator) Thing translator](https://experiments.withgoogle.com/thing-translator) - [![Favicon](https://icon.horse/icon/poly.cam) Polycam](https://poly.cam) {.icon-list .marker-none} ### Sales - [![Favicon](https://icon.horse/icon/klaviyo.com/product/whats-new/sms-assistant) Klaviyo sms assistant](https://klaviyo.com/product/whats-new/sms-assistant) - [![Favicon](https://icon.horse/icon/instantly.ai) Instantly](https://instantly.ai) - [![Favicon](https://icon.horse/icon/affinity.co) Affinity](https://affinity.co) - [![Favicon](https://icon.horse/icon/trywingman.com) Wingman](https://trywingman.com) - [![Favicon](https://icon.horse/icon/lavender.ai) Lavender](https://lavender.ai) - [![Favicon](https://icon.horse/icon/cresta.com) Cresta](https://cresta.com) {.icon-list .marker-none} ### Audio - [![Favicon](https://icon.horse/icon/descript.com) Descript](https://descript.com) - [![Favicon](https://icon.horse/icon/lalal.ai) Lalal.ai voice cleaner](https://lalal.ai) - [![Favicon](https://icon.horse/icon/poly.ai) Poly ai](https://poly.ai) - [![Favicon](https://icon.horse/icon/wzrd.ai) Wzrd.ai](https://wzrd.ai) - [![Favicon](https://icon.horse/icon/rythmex.com) Rythmex](https://rythmex.com) - [![Favicon](https://icon.horse/icon/blogaudio.co) Blogaudio](https://blogaudio.co) {.icon-list .marker-none} ### Analytics - [![Favicon](https://icon.horse/icon/paperswithcode.com) Papers with code](https://paperswithcode.com) - [![Favicon](https://icon.horse/icon/explainpaper.com) Explainpaper](https://explainpaper.com) - [![Favicon](https://icon.horse/icon/anania.ai) Anania](https://anania.ai) - [![Favicon](https://icon.horse/icon/voiceops.com) Voiceops](https://voiceops.com) - [![Favicon](https://icon.horse/icon/stormly.com) Stormly 2.0](https://stormly.com) - [![Favicon](https://icon.horse/icon/sahha.ai) Sahha](https://sahha.ai) {.icon-list .marker-none} ### Fintech - [![Favicon](https://icon.horse/icon/novamoney.app.link/PH) Nova money](https://novamoney.app.link/PH) {.icon-list .marker-none} ### Marketing - [![Favicon](https://icon.horse/icon/monkeylearn.com) Monkeylearn](https://monkeylearn.com) - [![Favicon](https://icon.horse/icon/wonsulting.com/networkai) Networkai](https://wonsulting.com/networkai) - [![Favicon](https://icon.horse/icon/reply.io) Reply.io](https://reply.io) - [![Favicon](https://icon.horse/icon/outranking.io) Outranking](https://outranking.io) - [![Favicon](https://icon.horse/icon/linkgraph.io/seo-content-assistant) Seo content assistant by searchatlas](https://linkgraph.io/seo-content-assistant) - [![Favicon](https://icon.horse/icon/adcreative.ai) Adcreative.ai](https://adcreative.ai) {.icon-list .marker-none} ### Story teller - [![Favicon](https://icon.horse/icon/novelai.net) Novelai](https://novelai.net) - [![Favicon](https://icon.horse/icon/artflow.ai) Artflow ai](https://artflow.ai) - [![Favicon](https://icon.horse/icon/subtxt.app) Subtxt](https://subtxt.app) - [![Favicon](https://icon.horse/icon/sceneone.app) Scene one](https://sceneone.app) - [![Favicon](https://icon.horse/icon/storypath.app) Story path](https://storypath.app) - [![Favicon](https://icon.horse/icon/whatonearth.xyz) What on earth?](https://whatonearth.xyz) {.icon-list .marker-none} ### Low-code/no-code - [![Favicon](https://icon.horse/icon/vwo.com/testing) Vwo](https://vwo.com/testing) - [![Favicon](https://icon.horse/icon/mutinyhq.com) Mutiny](https://mutinyhq.com) - [![Favicon](https://icon.horse/icon/nanonets.com) Nanonets](https://nanonets.com) - [![Favicon](https://icon.horse/icon/axiom.ai) Axiom](https://axiom.ai) - [![Favicon](https://icon.horse/icon/askviable.com) Viable](https://askviable.com) - [![Favicon](https://icon.horse/icon/durable.co) Durable](https://durable.co) {.icon-list .marker-none} ### Art - [![Favicon](https://icon.horse/icon/wombo.art) Wombo](https://wombo.art) - [![Favicon](https://icon.horse/icon/neural.love) Neural.love art generator](https://neural.love) - [![Favicon](https://icon.horse/icon/promptomania.com) Promptomania](https://promptomania.com) - [![Favicon](https://icon.horse/icon/lexica.art) Lexica](https://lexica.art) - [![Favicon](https://icon.horse/icon/alethea.ai/avatars) Ai avatars](https://alethea.ai/avatars) - [![Favicon](https://icon.horse/icon/diffusionbee.com) Diffusionbee](https://diffusionbee.com) {.icon-list .marker-none} ### Customer communication - [![Favicon](https://icon.horse/icon/algolia.com/products/recommendations) Algolia recommend](https://algolia.com/products/recommendations) {.icon-list .marker-none} ### Chrome extensions - [![Favicon](https://icon.horse/icon/sendpulse.com) Sendpulse for slack](https://sendpulse.com) - [![Favicon](https://icon.horse/icon/bizzabo.com) X.ai](https://bizzabo.com) - [![Favicon](https://icon.horse/icon/pipecandy.com) Pipecandy](https://pipecandy.com) - [![Favicon](https://icon.horse/icon/surferseo.com/free-article-outline-generator) Free article outline generator](https://surferseo.com/free-article-outline-generator) - [![Favicon](https://icon.horse/icon/fylehq.com) Fyle](https://fylehq.com) - [![Favicon](https://icon.horse/icon/socialbook.io/cartoonize) Socialbook cartoonizer](https://socialbook.io/cartoonize) {.icon-list .marker-none} ### Search engine - [![Favicon](https://icon.horse/icon/algolia.com) Algolia](https://algolia.com) - [![Favicon](https://icon.horse/icon/everypixel.com) Everypixel](https://everypixel.com) - [![Favicon](https://icon.horse/icon/andisearch.com) Andi](https://andisearch.com) - [![Favicon](https://icon.horse/icon/onemoreai.com) One more ai](https://onemoreai.com) - [![Favicon](https://icon.horse/icon/imaiger.com) Imaiger](https://imaiger.com) - [![Favicon](https://icon.horse/icon/dreamsands.ai) Dreamsands](https://dreamsands.ai) {.icon-list .marker-none} ### Research - [![Favicon](https://icon.horse/icon/elicit.org) Elicit](https://elicit.org) - [![Favicon](https://icon.horse/icon/typeset.io) Scispace](https://typeset.io) - [![Favicon](https://icon.horse/icon/adept.ai) Adept](https://adept.ai) - [![Favicon](https://icon.horse/icon/scholarcy.com) Scholarcy](https://scholarcy.com) - [![Favicon](https://icon.horse/icon/consensus.app) Consensus](https://consensus.app) - [![Favicon](https://icon.horse/icon/akkio.com) Akkio](https://akkio.com) {.icon-list .marker-none} ### Browser extensions - [![Favicon](https://icon.horse/icon/usemotion.com) Motion task manager](https://usemotion.com) {.icon-list .marker-none} ### Pc - [![Favicon](https://icon.horse/icon/paperspace.com/gradient) Gradient°](https://paperspace.com/gradient) {.icon-list .marker-none} ### Prompt - [![Favicon](https://icon.horse/icon/replicate.com/methexis-inc/img2prompt) Img2prompt](https://replicate.com/methexis-inc/img2prompt) - [![Favicon](https://icon.horse/icon/openart.ai) Openart](https://openart.ai) - [![Favicon](https://icon.horse/icon/decktopus.com/blog/chatgpt-prompts-for-your-next-launch) Decktopus](https://decktopus.com/blog/chatgpt-prompts-for-your-next-launch) - [![Favicon](https://icon.horse/icon/promptbase.com) Promptbase](https://promptbase.com) - [![Favicon](https://icon.horse/icon/krea.ai) Krea](https://krea.ai) - [![Favicon](https://icon.horse/icon/pyttipanna.xyz) Pyttipanna](https://pyttipanna.xyz) {.icon-list .marker-none} ### Email - [![Favicon](https://icon.horse/icon/unbounce.com) The landing page analyzer by unbounce](https://unbounce.com) - [![Favicon](https://icon.horse/icon/unbounce.com/smart-copy-everywhere) Smart copy everywhere](https://unbounce.com/smart-copy-everywhere) - [![Favicon](https://icon.horse/icon/breadcrumbs.io/reveal) Breadcrumbs reveal](https://breadcrumbs.io/reveal) - [![Favicon](https://icon.horse/icon/emergingtechbrew.com) Emerging tech brew](https://emergingtechbrew.com) - [![Favicon](https://icon.horse/icon/snazzy.ai) Snazzy ai](https://snazzy.ai) - [![Favicon](https://icon.horse/icon/conduithq.com) Conduit](https://conduithq.com) {.icon-list .marker-none} ### Image improvement - [![Favicon](https://icon.horse/icon/vanceai.com/image-enlarger) Vanceai image upscaler](https://vanceai.com/image-enlarger) - [![Favicon](https://icon.horse/icon/cloudinary.com) Cloudinary](https://cloudinary.com) - [![Favicon](https://icon.horse/icon/ai.nero.com/image-upscaler) Nero image upscaler](https://ai.nero.com/image-upscaler) - [![Favicon](https://icon.horse/icon/prisma-ai.com/lensa) Lensa](https://prisma-ai.com/lensa) - [![Favicon](https://icon.horse/icon/convert.leiapix.com) Leiapix](https://convert.leiapix.com) - [![Favicon](https://icon.horse/icon/github.com/Sanster/lama-cleaner) Lama cleaner](https://github.com/Sanster/lama-cleaner) {.icon-list .marker-none} ### Human resources - [![Favicon](https://icon.horse/icon/chatbot.com/features) Chatbot](https://chatbot.com/features) - [![Favicon](https://icon.horse/icon/moveworks.com) Moveworks](https://moveworks.com) - [![Favicon](https://icon.horse/icon/findem.ai) Findem](https://findem.ai) - [![Favicon](https://icon.horse/icon/skillroads.com) Skillroads](https://skillroads.com) - [![Favicon](https://icon.horse/icon/qatalog.com) Qatalog](https://qatalog.com) - [![Favicon](https://icon.horse/icon/hellotars.com/ph) Tars](https://hellotars.com/ph) {.icon-list .marker-none} ### Website - [![Favicon](https://icon.horse/icon/getresponse.com/features/website-builder) Getresponse](https://getresponse.com/features/website-builder) - [![Favicon](https://icon.horse/icon/bookmark.com/ai-website-builder) Aida](https://bookmark.com/ai-website-builder) - [![Favicon](https://icon.horse/icon/studio.design) Studio design](https://studio.design) {.icon-list .marker-none} ### Branding - [![Favicon](https://icon.horse/icon/namesnack.com) Namesnack](https://namesnack.com) - [![Favicon](https://icon.horse/icon/namify.tech) Namify](https://namify.tech) - [![Favicon](https://icon.horse/icon/namefruits.com) Namefruits](https://namefruits.com) {.icon-list .marker-none} ### Speech - [![Favicon](https://icon.horse/icon/speechanalyzer.elsaspeak.com) Elsa speech analyzer](https://speechanalyzer.elsaspeak.com) - [![Favicon](https://icon.horse/icon/resemble.ai/speech-to-speech) Speech-to-speech](https://resemble.ai/speech-to-speech) {.icon-list .marker-none} ### Communication - [![Favicon](https://icon.horse/icon/poised.com) Poised 2.0](https://poised.com) {.icon-list .marker-none} ### Other - [![Favicon](https://icon.horse/icon/pjreddie.com/darknet/yolo) Yolo](https://pjreddie.com/darknet/yolo) - [![Favicon](https://icon.horse/icon/hownormalami.eu) How normal am i?](https://hownormalami.eu) - [![Favicon](https://icon.horse/icon/toonify.photos) Toonify](https://toonify.photos) - [![Favicon](https://icon.horse/icon/gptcrush.com/resources) Gpt-3 crush](https://gptcrush.com/resources) - [![Favicon](https://icon.horse/icon/handl.ai) Handl](https://handl.ai) - [![Favicon](https://icon.horse/icon/aicheatsheet.comuzi.xyz) Ai cheatsheet](https://aicheatsheet.comuzi.xyz) {.icon-list .marker-none} ### Health - [![Favicon](https://icon.horse/icon/ubiehealth.com) Ubie ai symptom checker](https://ubiehealth.com) {.icon-list .marker-none} ### Aggregator - [![Favicon](https://icon.horse/icon/gpt3demo.com) Gpt-3 demo](https://gpt3demo.com) - [![Favicon](https://icon.horse/icon/futurepedia.io) Futurepedia](https://futurepedia.io) - [![Favicon](https://icon.horse/icon/library.phygital.plus) Ai library](https://library.phygital.plus) - [![Favicon](https://icon.horse/icon/smokingrobot.ai) Smoking robot ai](https://smokingrobot.ai) - [![Favicon](https://icon.horse/icon/allthingsai.com) All things ai](https://allthingsai.com) - [![Favicon](https://icon.horse/icon/aitogrow.com) Aitogrow](https://aitogrow.com) {.icon-list .marker-none} ### Customer support - [![Favicon](https://icon.horse/icon/hiverhq.com/harvey-ai-customer-support) Harvey](https://hiverhq.com/harvey-ai-customer-support) - [![Favicon](https://icon.horse/icon/forethought.ai) Forethought](https://forethought.ai) - [![Favicon](https://icon.horse/icon/kore.ai) Kore.ai](https://kore.ai) - [![Favicon](https://icon.horse/icon/regie.ai) Regie](https://regie.ai) - [![Favicon](https://icon.horse/icon/typewise.app) Typewise](https://typewise.app) - [![Favicon](https://icon.horse/icon/quickchat.ai) Quickchat](https://quickchat.ai) {.icon-list .marker-none} ### Movies - [![Favicon](https://icon.horse/icon/taste.io) Taste](https://taste.io) {.icon-list .marker-none} ### Video - [![Favicon](https://icon.horse/icon/deepfakesweb.com) Deepfakesweb](https://deepfakesweb.com) - [![Favicon](https://icon.horse/icon/fineshare.com/finecam) Fineshare](https://fineshare.com/finecam) - [![Favicon](https://icon.horse/icon/wisecut.video) Wisecut](https://wisecut.video) - [![Favicon](https://icon.horse/icon/elai.io) Elai](https://elai.io) - [![Favicon](https://icon.horse/icon/move.ai) Move](https://move.ai) - [![Favicon](https://icon.horse/icon/twelvelabs.io) Twelve labs](https://twelvelabs.io) {.icon-list .marker-none} ### Email assistant - [![Favicon](https://icon.horse/icon/missiveapp.com) Missive](https://missiveapp.com) - [![Favicon](https://icon.horse/icon/magicreach.ai) Magicreach](https://magicreach.ai) - [![Favicon](https://icon.horse/icon/ellieai.com) Ellie](https://ellieai.com) - [![Favicon](https://icon.horse/icon/superreply.co) Superreply](https://superreply.co) - [![Favicon](https://icon.horse/icon/chatgptwriter.ai) Chatgpt writer](https://chatgptwriter.ai) - [![Favicon](https://icon.horse/icon/superhuman.com) Superhuman](https://superhuman.com) {.icon-list .marker-none} ### Messaging - [![Favicon](https://icon.horse/icon/madgicx.com) Madgicx for facebook ads](https://madgicx.com) - [![Favicon](https://icon.horse/icon/bottr.me) Bottr.me](https://bottr.me) - [![Favicon](https://icon.horse/icon/octaneai.com) Octane ai](https://octaneai.com) - [![Favicon](https://icon.horse/icon/gonerdify.com/nerdybot) Nerdify bot](https://gonerdify.com/nerdybot) - [![Favicon](https://icon.horse/icon/fritz.ai/launch) Fritz](https://fritz.ai/launch) - [![Favicon](https://icon.horse/icon/abe.ai) Abe](https://abe.ai) {.icon-list .marker-none} ### Generative video - [![Favicon](https://icon.horse/icon/lumen5.com) Lumen5](https://lumen5.com) - [![Favicon](https://icon.horse/icon/livereacting.com) Livereacting](https://livereacting.com) - [![Favicon](https://icon.horse/icon/reachout.ai) Reachout.ai](https://reachout.ai) - [![Favicon](https://icon.horse/icon/huggingface.co/spaces/camenduru/one-shot-talking-face) One shot talking face](https://huggingface.co/spaces/camenduru/one-shot-talking-face) - [![Favicon](https://icon.horse/icon/boolvideoinvite.carrd.co) Boolvideo](https://boolvideoinvite.carrd.co) - [![Favicon](https://icon.horse/icon/quickvid.ai) Quickvid](https://quickvid.ai) {.icon-list .marker-none} ### Safari extensions - [![Favicon](https://icon.horse/icon/rezi.ai/ai-resume-builder) Rezi 3.0](https://rezi.ai/ai-resume-builder) {.icon-list .marker-none} ### Transcriber - [![Favicon](https://icon.horse/icon/fireflies.ai) Fireflies.ai](https://fireflies.ai) - [![Favicon](https://icon.horse/icon/steno.ai) Steno](https://steno.ai) - [![Favicon](https://icon.horse/icon/peech-ai.com) Peech](https://peech-ai.com) - [![Favicon](https://icon.horse/icon/anypod.ai) Anypod](https://anypod.ai) - [![Favicon](https://icon.horse/icon/supertranslate.ai) Supertranslate](https://supertranslate.ai) {.icon-list .marker-none} ### Motion capture - [![Favicon](https://icon.horse/icon/rokoko.com) Rokoko](https://rokoko.com) - [![Favicon](https://icon.horse/icon/cascadeur.com) Cascadeur](https://cascadeur.com) {.icon-list .marker-none} ### Voice - [![Favicon](https://icon.horse/icon/fineshare.com/finevoice) Fineshare](https://fineshare.com/finevoice) - [![Favicon](https://icon.horse/icon/voice.ai) Voice ai](https://voice.ai) - [![Favicon](https://icon.horse/icon/vocads.com) Vocads survey](https://vocads.com) - [![Favicon](https://icon.horse/icon/whisperapi.com) Whisperapi](https://whisperapi.com) - [![Favicon](https://icon.horse/icon/createaivoiceovers.com) Createaivoiceovers](https://createaivoiceovers.com) {.icon-list .marker-none} ### Machine learning - [![Favicon](https://icon.horse/icon/h2o.ai) H2o ai](https://h2o.ai) - [![Favicon](https://icon.horse/icon/nocodebooth.com) Nocodebooth](https://nocodebooth.com) {.icon-list .marker-none} ### Social media assistant - [![Favicon](https://icon.horse/icon/tweethunter.io) Tweet hunter](https://tweethunter.io) - [![Favicon](https://icon.horse/icon/socialbu.com) Socialbu](https://socialbu.com) - [![Favicon](https://icon.horse/icon/predis.ai) Predis](https://predis.ai) - [![Favicon](https://icon.horse/icon/feedhive.com) Feedhive](https://feedhive.com) - [![Favicon](https://icon.horse/icon/audiolabs.io) Audiolabs](https://audiolabs.io) - [![Favicon](https://icon.horse/icon/zaap.ai) Zaap.ai](https://zaap.ai) {.icon-list .marker-none} ### Inspiration - [![Favicon](https://icon.horse/icon/entreresource.com/chatgpt-cheat-sheet) Gpt cheat sheet](https://entreresource.com/chatgpt-cheat-sheet) - [![Favicon](https://icon.horse/icon/trello.com/b/4BPkSY1w/100-ai-prompts-resources-prompt-lovers) 100+ ai prompts](https://trello.com/b/4BPkSY1w/100-ai-prompts-resources-prompt-lovers) - [![Favicon](https://icon.horse/icon/aealexander.com/midjourney-prompt-database) Midjourney prompt database](https://aealexander.com/midjourney-prompt-database) - [![Favicon](https://icon.horse/icon/prompt.noonshot.com) Midjourney prompt tool](https://prompt.noonshot.com) - [![Favicon](https://icon.horse/icon/saaslibrary.dev) Saas library](https://saaslibrary.dev) - [![Favicon](https://icon.horse/icon/ordinarypeopleprompts.com) Ordinary prompts](https://ordinarypeopleprompts.com) {.icon-list .marker-none} ### Stocks - [![Favicon](https://icon.horse/icon/torto.ai/welcome) Torto.ai](https://torto.ai/welcome) {.icon-list .marker-none} ### Voice modulation - [![Favicon](https://icon.horse/icon/voice.ai/voice-ai-beta/I2p6L) Voice.ai](https://voice.ai/voice-ai-beta/I2p6L) - [![Favicon](https://icon.horse/icon/studio.themetavoice.xyz) Metavoice studio](https://studio.themetavoice.xyz) {.icon-list .marker-none} ### Paraphraser - [![Favicon](https://icon.horse/icon/paraphrasetool.com) Paraphraser](https://paraphrasetool.com) - [![Favicon](https://icon.horse/icon/rephrasely.com) Rephrasely](https://rephrasely.com) - [![Favicon](https://icon.horse/icon/bearly.ai) Bearly](https://bearly.ai) - [![Favicon](https://icon.horse/icon/wordfixerbot.com) Wordfixerbot](https://wordfixerbot.com) {.icon-list .marker-none} ### Amazon - [![Favicon](https://icon.horse/icon/TheReviewIndex.com/us) Thereviewindex](https://TheReviewIndex.com/us) {.icon-list .marker-none} ### Personalized videos - [![Favicon](https://icon.horse/icon/windsor.io) Windsor](https://windsor.io) - [![Favicon](https://icon.horse/icon/rephrase.ai) Rephrase](https://rephrase.ai) - [![Favicon](https://icon.horse/icon/trymaverick.com) Maverick](https://trymaverick.com) - [![Favicon](https://icon.horse/icon/bhuman.ai) Bhuman](https://bhuman.ai) - [![Favicon](https://icon.horse/icon/vidyo.ai) Vidyo](https://vidyo.ai) {.icon-list .marker-none} ### Spreadsheets - [![Favicon](https://icon.horse/icon/excelformulabot.com) Excel formula bot](https://excelformulabot.com) - [![Favicon](https://icon.horse/icon/boloforms.com/sheetgod) Sheetgod](https://boloforms.com/sheetgod) - [![Favicon](https://icon.horse/icon/sheetai.app) Sheet ai](https://sheetai.app) - [![Favicon](https://icon.horse/icon/sheetplus.ai) Sheet+](https://sheetplus.ai) - [![Favicon](https://icon.horse/icon/workspace.google.com/marketplace/app/simple_ml_for_sheets/685936641092) Simple ml](https://workspace.google.com/marketplace/app/simple_ml_for_sheets/685936641092) {.icon-list .marker-none} ### Ipad - [![Favicon](https://icon.horse/icon/brain.fm) Brain.fm](https://brain.fm) {.icon-list .marker-none} ### Task management - [![Favicon](https://icon.horse/icon/levity.ai) Levity](https://levity.ai) - [![Favicon](https://icon.horse/icon/apac.ai) Athena](https://apac.ai) - [![Favicon](https://icon.horse/icon/teacherbot.io) Teacherbot](https://teacherbot.io) {.icon-list .marker-none} ### Email marketing - [![Favicon](https://icon.horse/icon/phrasee.co) Phrasee](https://phrasee.co) {.icon-list .marker-none} ### Fashion - [![Favicon](https://icon.horse/icon/ca.la) Cala](https://ca.la) - [![Favicon](https://icon.horse/icon/botika.io) Botika](https://botika.io) - [![Favicon](https://icon.horse/icon/fashionadvisorai.com) Fashionadvisorai](https://fashionadvisorai.com) - [![Favicon](https://icon.horse/icon/visualhound.com) Visualhound](https://visualhound.com) {.icon-list .marker-none} ### Generator - [![Favicon](https://icon.horse/icon/blocksurvey.io/ai-surveys) Blocksurvey](https://blocksurvey.io/ai-surveys) {.icon-list .marker-none} ### 3d - [![Favicon](https://icon.horse/icon/deepmotion.com) Deepmotion](https://deepmotion.com) - [![Favicon](https://icon.horse/icon/plask.ai) Plask](https://plask.ai) - [![Favicon](https://icon.horse/icon/captures.lumalabs.ai/imagine) Imagine 3d](https://captures.lumalabs.ai/imagine) - [![Favicon](https://icon.horse/icon/lumalabs.ai) Luma ai](https://lumalabs.ai) - [![Favicon](https://icon.horse/icon/kaedim3d.com) Kaedim](https://kaedim3d.com) - [![Favicon](https://icon.horse/icon/masterpiecestudio.com) Masterpiece studio](https://masterpiecestudio.com) {.icon-list .marker-none} ### Home - [![Favicon](https://icon.horse/icon/shapescale.com) Shapescale](https://shapescale.com) - [![Favicon](https://icon.horse/icon/github.com/Shinao/SmartMirror) Smartmirror](https://github.com/Shinao/SmartMirror) {.icon-list .marker-none} ### Api - [![Favicon](https://icon.horse/icon/deepgram.com) Deepgram](https://deepgram.com) - [![Favicon](https://icon.horse/icon/banana.dev) Banana](https://banana.dev) - [![Favicon](https://icon.horse/icon/perspectiveapi.com) Perspective](https://perspectiveapi.com) - [![Favicon](https://icon.horse/icon/theneo.io) Theneo](https://theneo.io) - [![Favicon](https://icon.horse/icon/base64.ai) Base64.ai](https://base64.ai) - [![Favicon](https://icon.horse/icon/trueface.ai) Trueface.ai](https://trueface.ai) {.icon-list .marker-none} ### Software engineering - [![Favicon](https://icon.horse/icon/prodi.gy) Prodigy](https://prodi.gy) {.icon-list .marker-none} ### Open source - [![Favicon](https://icon.horse/icon/blog.floydhub.com) Floyd](https://blog.floydhub.com) - [![Favicon](https://icon.horse/icon/cloud.mindsdb.com) Mindsdb](https://cloud.mindsdb.com) - [![Favicon](https://icon.horse/icon/evidentlyai.com) Evidently ai](https://evidentlyai.com) - [![Favicon](https://icon.horse/icon/warrior.js.org) Warriorjs](https://warrior.js.org) - [![Favicon](https://icon.horse/icon/datature.io) Datature](https://datature.io) - [![Favicon](https://icon.horse/icon/bot.viseo.io) Viseo bot maker](https://bot.viseo.io) {.icon-list .marker-none} ### Chat - [![Favicon](https://icon.horse/icon/poppylist.com/askpoppy) Ask poppy](https://poppylist.com/askpoppy) - [![Favicon](https://icon.horse/icon/chatbotgpt3.bubbleapps.io/version-test) Gpt chatbot](https://chatbotgpt3.bubbleapps.io/version-test) - [![Favicon](https://icon.horse/icon/voiceflow.com) Voiceflow](https://voiceflow.com) - [![Favicon](https://icon.horse/icon/mobilespoon.net/2023/01/how-to-activate-chatgpt-with-siri-and-save-response.html) Chatgpt for siri](https://mobilespoon.net/2023/01/how-to-activate-chatgpt-with-siri-and-save-response.html) - [![Favicon](https://icon.horse/icon/trudo.ai) Trudo](https://trudo.ai) - [![Favicon](https://icon.horse/icon/unschooler.me) Unschooler](https://unschooler.me) {.icon-list .marker-none} ### Playstation - [![Favicon](https://icon.horse/icon/chatfuel.com) Chatfuel](https://chatfuel.com) {.icon-list .marker-none} ### Startup - [![Favicon](https://icon.horse/icon/rationale.jina.ai) Rationale](https://rationale.jina.ai) - [![Favicon](https://icon.horse/icon/trustfinta.com) Finta](https://trustfinta.com) - [![Favicon](https://icon.horse/icon/ideabuddy.com) Ideabuddy](https://ideabuddy.com) - [![Favicon](https://icon.horse/icon/broadn.io) Broadn](https://broadn.io) - [![Favicon](https://icon.horse/icon/validatorai.com) Validator ai](https://validatorai.com) - [![Favicon](https://icon.horse/icon/namelix.com) Namelix](https://namelix.com) {.icon-list .marker-none} ### Experiments - [![Favicon](https://icon.horse/icon/alethea.ai) Alethea](https://alethea.ai) - [![Favicon](https://icon.horse/icon/thismodeldoesnotexist.co) This model does not exist](https://thismodeldoesnotexist.co) {.icon-list .marker-none} ### Windows - [![Favicon](https://icon.horse/icon/superannotate.com) Superannotate desktop](https://superannotate.com) {.icon-list .marker-none} ### Generative code - [![Favicon](https://icon.horse/icon/gradio.app) Gradio](https://gradio.app) - [![Favicon](https://icon.horse/icon/obviously.ai) Obviously ai](https://obviously.ai) - [![Favicon](https://icon.horse/icon/sourceai.dev) Sourceai](https://sourceai.dev) - [![Favicon](https://icon.horse/icon/no-code-ai-model-builder.com) No-code ai model builder](https://no-code-ai-model-builder.com) - [![Favicon](https://icon.horse/icon/codesquire.ai) Codesquire](https://codesquire.ai) - [![Favicon](https://icon.horse/icon/aigur.dev) Aigur](https://aigur.dev) {.icon-list .marker-none} ### Photography - [![Favicon](https://icon.horse/icon/portrait.vana.com) Portrait by vana](https://portrait.vana.com) - [![Favicon](https://icon.horse/icon/photorestoration.ai) Photorestoration](https://photorestoration.ai) - [![Favicon](https://icon.horse/icon/ecosnap.vercel.app) Ecosnap](https://ecosnap.vercel.app) - [![Favicon](https://icon.horse/icon/github.com/yemount/pose-animator) Pose animator](https://github.com/yemount/pose-animator) - [![Favicon](https://icon.horse/icon/github.com/ageitgey/show-facebook-computer-vision-tags) Facebook computer vision tags](https://github.com/ageitgey/show-facebook-computer-vision-tags) - [![Favicon](https://icon.horse/icon/dpth.app) Dpth](https://dpth.app) {.icon-list .marker-none} ### Healthcare - [![Favicon](https://icon.horse/icon/whisper.ai) Whisper ai](https://whisper.ai) {.icon-list .marker-none} ### Resources - [![Favicon](https://icon.horse/icon/lablab.ai) Lablab.ai](https://lablab.ai) - [![Favicon](https://icon.horse/icon/aiartapps.com) Ai art apps database](https://aiartapps.com) - [![Favicon](https://icon.horse/icon/experiments.withgoogle.com/collection/ai) Ai experiments](https://experiments.withgoogle.com/collection/ai) - [![Favicon](https://icon.horse/icon/flowgpt.com) Flowgpt](https://flowgpt.com) {.icon-list .marker-none} ### Growth hacking - [![Favicon](https://icon.horse/icon/depict.ai) Depict.ai](https://depict.ai) {.icon-list .marker-none} ### Kids - [![Favicon](https://icon.horse/icon/brickit.app) Brickit](https://brickit.app) {.icon-list .marker-none} ### Search - [![Favicon](https://icon.horse/icon/open.ai) Open](https://open.ai) {.icon-list .marker-none} ### Speech-to-text - [![Favicon](https://icon.horse/icon/glasp.co/youtube-summary) Glasp youtube summarizer](https://glasp.co/youtube-summary) - [![Favicon](https://icon.horse/icon/relayed.ai) Relayed](https://relayed.ai) - [![Favicon](https://icon.horse/icon/meeple.ai) Meeple](https://meeple.ai) - [![Favicon](https://icon.horse/icon/app.towords.io) Towords](https://app.towords.io) - [![Favicon](https://icon.horse/icon/usemelville.com) Melville app](https://usemelville.com) {.icon-list .marker-none} ### Articles - [![Favicon](https://icon.horse/icon/riku.ai/creators) Riku](https://riku.ai/creators) {.icon-list .marker-none} ### Podcast - [![Favicon](https://icon.horse/icon/snipd.com/ai-podcast-summaries) Snipd podcast summaries](https://snipd.com/ai-podcast-summaries) - [![Favicon](https://icon.horse/icon/sumly.ai) Sumly](https://sumly.ai) - [![Favicon](https://icon.horse/icon/tapesearch.com) Tapesearch](https://tapesearch.com) {.icon-list .marker-none} ### Parenting - [![Favicon](https://icon.horse/icon/smartivity.in/pages/parentivity_bot) Parentivity](https://smartivity.in/pages/parentivity_bot) - [![Favicon](https://icon.horse/icon/gosesh.com) Sesh](https://gosesh.com) {.icon-list .marker-none} ### Education assistant - [![Favicon](https://icon.horse/icon/brain-buddy.com) Brain Buddy](https://brain-buddy.com/) - [![Favicon](https://icon.horse/icon/kobra.dev) Kobra](https://kobra.dev) - [![Favicon](https://icon.horse/icon/boldvoice.com) Boldvoice](https://boldvoice.com) - [![Favicon](https://icon.horse/icon/prepai.in/us) Prepai](https://prepai.in/us) - [![Favicon](https://icon.horse/icon/explainlikeimfive.io) Eli5](https://explainlikeimfive.io) - [![Favicon](https://icon.horse/icon/tutorai.me) Tutorai](https://tutorai.me) - [![Favicon](https://icon.horse/icon/yippity.io) Yip](https://yippity.io) {.icon-list .marker-none} ### Tracking - [![Favicon](https://icon.horse/icon/hexowatch.com) Hexowatch](https://hexowatch.com) {.icon-list .marker-none} ### Privacy - [![Favicon](https://icon.horse/icon/playground.ai) Anonymous camera](https://playground.ai) - [![Favicon](https://icon.horse/icon/useguard.com) Guard](https://useguard.com) {.icon-list .marker-none} ### Vehicle - [![Favicon](https://icon.horse/icon/polymathrobotics.com) Polymath robotics](https://polymathrobotics.com) {.icon-list .marker-none} ### Twitter - [![Favicon](https://icon.horse/icon/tribescaler.com) Tribescaler](https://tribescaler.com) - [![Favicon](https://icon.horse/icon/kanyegenerator.com) Kanye tweet generator](https://kanyegenerator.com) - [![Favicon](https://icon.horse/icon/tweetspear.com) Tweetspear](https://tweetspear.com) - [![Favicon](https://icon.horse/icon/tweept3.com) Tweept3](https://tweept3.com) - [![Favicon](https://icon.horse/icon/tweetai.com) Tweetai](https://tweetai.com) {.icon-list .marker-none} ### Dev - [![Favicon](https://icon.horse/icon/edenai.co) Eden ai](https://edenai.co) - [![Favicon](https://icon.horse/icon/meetmaya.world) Maya ai](https://meetmaya.world) - [![Favicon](https://icon.horse/icon/testkit.app) Testkit](https://testkit.app) {.icon-list .marker-none} ### Saas - [![Favicon](https://icon.horse/icon/yous.ai) Yous](https://yous.ai) - [![Favicon](https://icon.horse/icon/trydocent.ai) Docent](https://trydocent.ai) {.icon-list .marker-none} ### Podcasting - [![Favicon](https://icon.horse/icon/audo.ai) Audo ai](https://audo.ai) {.icon-list .marker-none} ### Bot - [![Favicon](https://icon.horse/icon/hirex.ai) Hirex.ai](https://hirex.ai) {.icon-list .marker-none} ### Finance - [![Favicon](https://icon.horse/icon/glean.ai) Glean ai](https://glean.ai) - [![Favicon](https://icon.horse/icon/avanz.ai) Avanzai](https://avanz.ai) {.icon-list .marker-none} ### Self-improvement - [![Favicon](https://icon.horse/icon/huberman.rile.yt) Huberman ai](https://huberman.rile.yt) {.icon-list .marker-none} ### Robots - [![Favicon](https://icon.horse/icon/activechat.ai/intents-and-insights) Activechat bot trainer](https://activechat.ai/intents-and-insights) - [![Favicon](https://icon.horse/icon/motion.ai) Motion ai](https://motion.ai) - [![Favicon](https://icon.horse/icon/apitobot.io) Api to bot](https://apitobot.io) {.icon-list .marker-none} ### Slack - [![Favicon](https://icon.horse/icon/thegist.ai) Thegist](https://thegist.ai) - [![Favicon](https://icon.horse/icon/chatbottle.co) Chatbottle](https://chatbottle.co) - [![Favicon](https://icon.horse/icon/cai.tools.sap) Bot builder by recast.ai](https://cai.tools.sap) {.icon-list .marker-none} ### Investing - [![Favicon](https://icon.horse/icon/koble.ai/founderfit) Founderfit by koble](https://koble.ai/founderfit) {.icon-list .marker-none} ### Questions - [![Favicon](https://icon.horse/icon/therocketbrew.com/jeeves) Jeeves](https://therocketbrew.com/jeeves) - [![Favicon](https://icon.horse/icon/godinabox.co) God in a box](https://godinabox.co) {.icon-list .marker-none} ### Construction - [![Favicon](https://icon.horse/icon/aim.vision) Aim](https://aim.vision) {.icon-list .marker-none} ### Data - [![Favicon](https://icon.horse/icon/geniussheets.com) Genius sheets](https://geniussheets.com) - [![Favicon](https://icon.horse/icon/askcommand.com) Ask command](https://askcommand.com) - [![Favicon](https://icon.horse/icon/noluai.com) Nolu](https://noluai.com) - [![Favicon](https://icon.horse/icon/uselookup.com) Lookup](https://uselookup.com) - [![Favicon](https://icon.horse/icon/olli.ai) Olli](https://olli.ai) - [![Favicon](https://icon.horse/icon/autopredict.co.uk) Autopredict](https://autopredict.co.uk) {.icon-list .marker-none} ### Plugin - [![Favicon](https://icon.horse/icon/tldrdev.ai) Jetbrains ide plugin](https://tldrdev.ai) {.icon-list .marker-none} ### Pet - [![Favicon](https://icon.horse/icon/digitaldogs.ai) Digital dogs](https://digitaldogs.ai) - [![Favicon](https://icon.horse/icon/aipetavatar.com) Aipetavatar](https://aipetavatar.com) {.icon-list .marker-none} ### Sports - [![Favicon](https://icon.horse/icon/sportsprediction.ai) Ai sports prediction](https://sportsprediction.ai) {.icon-list .marker-none} ### User experience - [![Favicon](https://icon.horse/icon/arcopypaste.app) Clipdrop](https://arcopypaste.app) - [![Favicon](https://icon.horse/icon/getairim.com) Airim 2.0](https://getairim.com) - [![Favicon](https://icon.horse/icon/akin.nz) Akin](https://akin.nz) {.icon-list .marker-none} ### Quiz - [![Favicon](https://icon.horse/icon/quizgecko.com) Quizgecko](https://quizgecko.com) {.icon-list .marker-none} ### Sql - [![Favicon](https://icon.horse/icon/decile.app) Decile](https://decile.app) - [![Favicon](https://icon.horse/icon/aihelperbot.com) Aihelperbot](https://aihelperbot.com) - [![Favicon](https://icon.horse/icon/aiquery.co) Ai query](https://aiquery.co) - [![Favicon](https://icon.horse/icon/ai2sql.io) Ai2sql](https://ai2sql.io) - [![Favicon](https://icon.horse/icon/usechannel.com) Channel](https://usechannel.com) {.icon-list .marker-none} ### Linkedin - [![Favicon](https://icon.horse/icon/sid.black/tools/linkedin-post-generator) Linkedin posts generator](https://sid.black/tools/linkedin-post-generator) {.icon-list .marker-none} ### Food - [![Favicon](https://icon.horse/icon/ai-recipes.softr.app) Ai recipe generator](https://ai-recipes.softr.app) - [![Favicon](https://icon.horse/icon/foodai.app) Foodai](https://foodai.app) - [![Favicon](https://icon.horse/icon/whatcaketobake.com) What cake to bake?](https://whatcaketobake.com) {.icon-list .marker-none} ### Tool - [![Favicon](https://icon.horse/icon/autoname.org) Autoname](https://autoname.org) - [![Favicon](https://icon.horse/icon/assetsai.art) Assetsai](https://assetsai.art) - [![Favicon](https://icon.horse/icon/aibusinesstool.com) Aibusinesstool](https://aibusinesstool.com) {.icon-list .marker-none} ### Emoji - [![Favicon](https://icon.horse/icon/phben.ch) Ph bench](https://phben.ch) {.icon-list .marker-none} ### Newsletters - [![Favicon](https://icon.horse/icon/subscribe.machinelearnings.co) Machine learnings](https://subscribe.machinelearnings.co) {.icon-list .marker-none} ### Streaming services - [![Favicon](https://icon.horse/icon/their.tube) Theirtube](https://their.tube) {.icon-list .marker-none} ### Excel - [![Favicon](https://icon.horse/icon/formula.dog) Formula dog](https://formula.dog) {.icon-list .marker-none} ### Ai detection - [![Favicon](https://icon.horse/icon/thomas.io/detect-gpt) Detect gpt](https://thomas.io/detect-gpt) - [![Favicon](https://icon.horse/icon/nsfw.m1guelpf.me) Is this image nsfw?](https://nsfw.m1guelpf.me) {.icon-list .marker-none} ### News - [![Favicon](https://icon.horse/icon/speechkit.io) Speechkit](https://speechkit.io) - [![Favicon](https://icon.horse/icon/useclarity.com) Clarity](https://useclarity.com) {.icon-list .marker-none} ### Vacation - [![Favicon](https://icon.horse/icon/letsroam.app) Roamr](https://letsroam.app) {.icon-list .marker-none} ### Logo generator - [![Favicon](https://icon.horse/icon/makelogoai.com) Make logo ai](https://makelogoai.com) {.icon-list .marker-none} ### Real estate - [![Favicon](https://icon.horse/icon/airoomplanner.com) Ai room planner](https://airoomplanner.com) - [![Favicon](https://icon.horse/icon/coolaiid.com) Coolaiid](https://coolaiid.com) {.icon-list .marker-none} ### Assistant - [![Favicon](https://icon.horse/icon/eddyai.com) Eddyai](https://eddyai.com) {.icon-list .marker-none} ### Bots - [![Favicon](https://icon.horse/icon/ai-chatbots.pulse.is) Ai chatbots in messengers](https://ai-chatbots.pulse.is) {.icon-list .marker-none} ### Advertising - [![Favicon](https://icon.horse/icon/jotapp.tech) Jot](https://jotapp.tech) {.icon-list .marker-none} ### Gift ideas - [![Favicon](https://icon.horse/icon/giftastic.ai) Giftastic.ai](https://giftastic.ai) - [![Favicon](https://icon.horse/icon/coolgiftideas.io) Cool gift ideas](https://coolgiftideas.io) - [![Favicon](https://icon.horse/icon/elfhelp.ai) Elf help](https://elfhelp.ai) {.icon-list .marker-none} ### Text-to-speech - [![Favicon](https://icon.horse/icon/verbatik.com) Verbatik](https://verbatik.com) {.icon-list .marker-none} ### Character - [![Favicon](https://icon.horse/icon/salewhale.chat) Salewhale](https://salewhale.chat) {.icon-list .marker-none} ### Memory - [![Favicon](https://icon.horse/icon/heyday.xyz) Heyday](https://heyday.xyz) {.icon-list .marker-none} ### Feedback - [![Favicon](https://icon.horse/icon/myess.ai) Myess](https://myess.ai) {.icon-list .marker-none} ### Background - [![Favicon](https://icon.horse/icon/zoomscape.ai) Zoomscape](https://zoomscape.ai) {.icon-list .marker-none} ### Support - [![Favicon](https://icon.horse/icon/resolveai.co) Resolveai](https://resolveai.co) {.icon-list .marker-none} ### Rank - [![Favicon](https://icon.horse/icon/reviewz.ai) Reviewz](https://reviewz.ai) {.icon-list .marker-none} ### Letter - [![Favicon](https://icon.horse/icon/recommendme.to) Recommendme](https://recommendme.to) {.icon-list .marker-none} ### Gift - [![Favicon](https://icon.horse/icon/text2present.com) Text2present](https://text2present.com) {.icon-list .marker-none} ### Dream - [![Favicon](https://icon.horse/icon/scarlettpanda.com) Scarlettpanda](https://scarlettpanda.com) {.icon-list .marker-none} ### Excuse - [![Favicon](https://icon.horse/icon/excuses.ai) Excuses ai](https://excuses.ai) {.icon-list .marker-none} ### Game - [![Favicon](https://icon.horse/icon/huggingface.co/spaces/huggingface-projects/stable-diffusion-multiplayer) Stable diffusion multiplayer](https://huggingface.co/spaces/huggingface-projects/stable-diffusion-multiplayer) {.icon-list .marker-none} ### Edit - [![Favicon](https://icon.horse/icon/bigmp4.com) Bigmp4](https://bigmp4.com) {.icon-list .marker-none} ### Translation - [![Favicon](https://icon.horse/icon/bot.petit.today) Languagepro](https://bot.petit.today) {.icon-list .marker-none} ### Startup tools - [![Favicon](https://icon.horse/icon/releasenote.ai) Releasenote.ai](https://releasenote.ai) {.icon-list .marker-none} ### E-commerce - [![Favicon](https://icon.horse/icon/recommendix.com/es-ar) Recommendix](https://recommendix.com/es-ar) {.icon-list .marker-none} ### Beauty - [![Favicon](https://icon.horse/icon/hairbyai.com) Hairbyai](https://hairbyai.com) {.icon-list .marker-none} ### Photo - [![Favicon](https://icon.horse/icon/camira.ai) 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 # Remove a package apk del # Search for a package apk search # Show package info apk info # List all installed packages apk list --installed ``` ### Advanced Package Operations ```bash # Add package from testing repository apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing # Add multiple packages apk add package1 package2 package3 # Clean package cache apk cache clean ``` ## System Administration ### Service Management (OpenRC) ```bash # Start a service rc-service start # Stop a service rc-service stop # Restart a service rc-service restart # Add service to default runlevel rc-update add default # Remove service from default runlevel rc-update del default # List all services rc-status ``` ### System Information ```bash # Show system information uname -a # Show disk usage df -h # Show memory usage free -h # Show running processes ps aux # Show system uptime uptime ``` ### Network Configuration ```bash # Show network interfaces ip addr show # Configure network interface setup-interfaces # Test network connectivity ping -c 4 google.com # Show routing table ip route show # Edit network configuration vi /etc/network/interfaces ``` ### User Management ```bash # Add a new user adduser # Add user to group addgroup # Change password passwd # Delete user deluser # List all users cat /etc/passwd ``` ## File System Operations ### Basic File Operations ```bash # Create directory mkdir # Remove directory rm -r # Copy files cp # Move/rename files mv # Change permissions chmod # Change ownership chown : ``` ## Container Operations ### Docker Support ```bash # Install Docker apk add docker # Start Docker service rc-service docker start # Enable Docker at boot rc-update add docker default ``` ## System Maintenance ### Disk Operations ```bash # Check disk space df -h # Check directory size du -sh # Mount a device mount /dev/ /mnt/ # Unmount a device umount /mnt/ ``` ### Backup and Restore ```bash # Create tar archive tar -czf backup.tar.gz /path/to/backup # Extract tar archive tar -xzf backup.tar.gz # Create system backup (root required) lbu package /media/backup.apkovl.tar.gz ``` ## Tips and Tricks ### Common Configuration Files - `/etc/apk/repositories` - Package repositories - `/etc/network/interfaces` - Network configuration - `/etc/hostname` - System hostname - `/etc/hosts` - Host mappings - `/etc/resolv.conf` - DNS configuration ### Environment Variables ```bash # Set environment variable export VARIABLE=value # View all environment variables env # Add permanent environment variable echo "export VARIABLE=value" >> ~/.profile ``` ### System Logs ```bash # View system logs less /var/log/messages # View boot messages dmesg # Follow log in real-time tail -f /var/log/messages ``` ## Security ### Firewall (using iptables) ```bash # Install iptables apk add iptables # Allow SSH (port 22) iptables -A INPUT -p tcp --dport 22 -j ACCEPT # Save iptables rules /etc/init.d/iptables save # Restore iptables rules /etc/init.d/iptables restart ``` ### SSH Configuration ```bash # Generate SSH key ssh-keygen -t rsa -b 4096 # Copy SSH key to remote server ssh-copy-id user@remote-server # Edit SSH configuration vi /etc/ssh/sshd_config ``` ## Troubleshooting ### Common Commands ```bash # Check system logs for errors dmesg | grep -i error # Check service status rc-service status # Check system resource usage top # Check network connections netstat -tuln # Check disk health smartctl -a /dev/sda # Requires smartmontools package ``` ================================================ FILE: source/_posts/android-studio.md ================================================ --- title: Android Studio date: 2022-11-23 16:23:31.704217 background: bg-[#6bd488] label: tags: - - categories: - Keyboard Shortcuts intro: | A visual cheat-sheet for the 130 keyboard shortcuts found in the Andriod Studio software --- ## Keyboard Shortcuts ### General | Shortcut | Action | | ------------------------ | ------------------------------------------------- | | `Ctrl` `S` | Save all | | `Ctrl` `Alt` `Y` | Synchronize | | `Ctrl` `Shift` `F12` | Minimize or maximize the editor | | `Alt` `Shift` `F` | Add to favorites | | `Alt` `Shift` `I` | Inspect the current file with the current profile | | `Ctrl` \` | 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 ``` ### Using a Library ```cpp #include Servo myServo; void setup() { myServo.attach(9); // Attach servo to pin 9 } void loop() { myServo.write(90); // Set servo to 90 degrees delay(1000); myServo.write(0); // Set servo to 0 degrees delay(1000); } ``` ## Common Functions ### Delay ```cpp delay(milliseconds); ``` ### Millis ```cpp unsigned long currentTime = millis(); ``` ### Map ```cpp long outputValue = map(inputValue, fromLow, fromHigh, toLow, toHigh); ``` ### Random ```cpp long randomValue = random(max); long randomValue = random(min, max); ``` ### Random Seed ```cpp randomSeed(analogRead(0)); // Seed from analog pin 0 ``` ## Sensors and Modules ### Reading Temperature with DHT Sensor ```cpp #include #define DHTPIN 2 // Pin which is connected to the DHT sensor #define DHTTYPE DHT11 // DHT 11 DHT dht(DHTPIN, DHTTYPE); void setup() { Serial.begin(9600); dht.begin(); } void loop() { float humidity = dht.readHumidity(); float temperature = dht.readTemperature(); Serial.print("Humidity: "); Serial.print(humidity); Serial.print(" %\t"); Serial.print("Temperature: "); Serial.print(temperature); Serial.println(" *C"); delay(2000); } ``` ### Blinking LED ```cpp const int ledPin = 13; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, HIGH); // Turn the LED on delay(1000); // Wait for 1 second digitalWrite(ledPin, LOW); // Turn the LED off delay(1000); // Wait for 1 second } ``` ### Read Button Input ```cpp const int buttonPin = 2; // Pin where the push button is connected const int ledPin = 13; // Pin where the LED is connected void setup() { pinMode(buttonPin, INPUT); // Set the button pin as an input pinMode(ledPin, OUTPUT); // Set the LED pin as an output } void loop() { int buttonState = digitalRead(buttonPin); // Read the state of the button if (buttonState == HIGH) { digitalWrite(ledPin, HIGH); // Turn the LED on } else { digitalWrite(ledPin, LOW); // Turn the LED off } } ``` ### Analog Input ```cpp const int potPin = A0; // Pin where the potentiometer is connected const int ledPin = 9; // Pin where the LED is connected void setup() { pinMode(ledPin, OUTPUT); // Set the LED pin as an output } void loop() { int potValue = analogRead(potPin); // Read the potentiometer value int ledBrightness = map(potValue, 0, 1023, 0, 255); // Map the value to a range from 0 to 255 analogWrite(ledPin, ledBrightness); // Set the brightness of the LED delay(10); // Small delay to make the LED change smoothly } ``` ### Serial Communication ```cpp void setup() { Serial.begin(9600); // Start the serial communication at 9600 baud rate } void loop() { Serial.println("Hello, world!"); // Send a message to the serial monitor delay(1000); // Wait for 1 second } ``` ### Temperature Sensor ```cpp const int tempPin = A0; // Pin where the TMP36 sensor is connected void setup() { Serial.begin(9600); // Start the serial communication at 9600 baud rate } void loop() { int tempValue = analogRead(tempPin); // Read the sensor value float voltage = tempValue * (5.0 / 1023.0); // Convert the value to voltage float temperatureC = (voltage - 0.5) * 100; // Convert the voltage to temperature in Celsius Serial.print("Temperature: "); Serial.print(temperatureC); Serial.println(" C"); delay(1000); // Wait for 1 second } ``` ### RGB LED Control ```cpp const int redPin = 9; const int greenPin = 10; const int bluePin = 11; const int potRedPin = A0; const int potGreenPin = A1; const int potBluePin = A2; void setup() { pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(bluePin, OUTPUT); } void loop() { int redValue = analogRead(potRedPin); int greenValue = analogRead(potGreenPin); int blueValue = analogRead(potBluePin); analogWrite(redPin, map(redValue, 0, 1023, 0, 255)); analogWrite(greenPin, map(greenValue, 0, 1023, 0, 255)); analogWrite(bluePin, map(blueValue, 0, 1023, 0, 255)); delay(10); } ``` ### Ultrasonic Sensor ```cpp const int trigPin = 9; const int echoPin = 10; void setup() { Serial.begin(9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); } void loop() { long duration; int distance; digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = duration * 0.034 / 2; Serial.print("Distance: "); Serial.print(distance); Serial.println(" cm"); delay(1000); } ``` ### Controlling a Servo Motor ```cpp #include Servo myServo; const int potPin = A0; void setup() { myServo.attach(9); // Attach the servo to pin 9 } void loop() { int potValue = analogRead(potPin); // Read the potentiometer value int angle = map(potValue, 0, 1023, 0, 180); // Map the value to an angle between 0 and 180 myServo.write(angle); // Set the servo position delay(15); // Small delay for the servo to reach the position } ``` ### Displaying Text on an LCD ```cpp #include // Initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { // Set up the LCD's number of columns and rows lcd.begin(16, 2); // Print a message to the LCD lcd.print("Hello, World!"); } void loop() { // Set the cursor to column 0, line 1 (second row) lcd.setCursor(0, 1); // Print the number of seconds since reset lcd.print(millis() / 1000); } ``` ## Wireless Communication with NRF24L01 ### Transmitter Code ```cpp #include #include #include RF24 radio(9, 10); // CE, CSN pins const byte address[6] = "00001"; // Address void setup() { radio.begin(); radio.openWritingPipe(address); radio.setPALevel(RF24_PA_MIN); radio.stopListening(); } void loop() { const char text[] = "Hello"; radio.write(&text, sizeof(text)); delay(1000); } ``` ### Receiver Code ```cpp #include #include #include RF24 radio(9, 10); // CE, CSN pins const byte address[6] = "00001"; // Address void setup() { Serial.begin(9600); radio.begin(); radio.openReadingPipe(0, address); radio.setPALevel(RF24_PA_MIN); radio.startListening(); } void loop() { if (radio.available()) { char text[32] = ""; radio.read(&text, sizeof(text)); Serial.println(text); } } ``` ## Also Read - [Ardunio](https://www.arduino.cc/en/software) ================================================ FILE: source/_posts/arduino.md ================================================ --- title: Arduino IDE date: 2022-11-23 16:23:31.697581 background: bg-[#409096] label: tags: - - categories: - Keyboard Shortcuts intro: | A visual cheat-sheet for the 12 keyboard shortcuts found in the Arduino IDE --- ## Keyboard Shortcuts ### General | Shortcut | Action | | ------------------ | -------------------------------- | | `Ctrl` `S` | Save | | `Ctrl` `Shift` `S` | Save as | | `Ctrl` `N` | Open a new sketch | | `Ctrl` `O` | Open an existing sketch | | `Ctrl` `Q` | Close the Arduino IDE | | `Ctrl` `R` | Verify | | `Ctrl` `U` | Upload | | `Ctrl` `F` | Find | | `Ctrl` `T` | Adjust the alignment and spacing | | `Ctrl` `/` | Comment | | `Ctrl` `Shift` `M` | Open the serial monitor | | `Ctrl` `K` | Open the sketch folder | {.shortcuts} ## Also see - [Keyboard shortcuts for the Arduino IDE](https://progtpoint.blogspot.com/2017/02/arduino-keyboard-shortcuts.html) _(progtpoint.blogspot.com)_ ================================================ FILE: source/_posts/asana.md ================================================ --- title: Asana date: 2022-11-23 16:23:31.697445 background: bg-[#e0726e] label: tags: - - categories: - Keyboard Shortcuts intro: | A visual cheat-sheet for the 40 keyboard shortcuts found in Asana --- ## Keyboard Shortcuts ### My Tasks | Shortcut | Action | | --------- | --------------------------------- | | `Tab` `Y` | Mark as Today in your My Tasks | | `Tab` `U` | Mark as Upcoming in your My Tasks | | `Tab` `L` | Mark as Later in your My Tasks | {.shortcuts} ### Inbox | Shortcut | Action | | -------- | ------------------- | | `K/J` | Move Up/Down | | `H` | Jump to Inbox tab | | `S` | Jump to Archive tab | | `F` | Follow or Unfollow | | `I` | Archive | | `U` | Move to Inbox | {.shortcuts} ### Task Actions {.row-span-2} | Shortcut | Action | | ------------------------ | --------------------------------------------- | | `Enter` | New Task | | `Tab` `Backspace` | Delete Selected Task(s) | | `Backspace` | Delete current task (when task name is empty) | | `Ctrl` `Enter` | Complete Selected Task(s) | | `Ctrl` `Up/Down` | Move Up/Down | | `Ctrl` `Shift` `Up/Down` | Jump Up/Down to the next Section | | `Ctrl` `C` | Copy Selected Tasks | | `Ctrl` `V` | Paste Tasks (one per line) | | `Tab` `M` | Assign to Me | | `Tab` `H` | Like a Selected Task | | `:` | Create a Section (at the end of a task name) | {.shortcuts} ### Navigation | Shortcut | Action | | --------- | ------------------------------------------ | | `Tab` `Z` | Navigate to My Tasks | | `Tab` `I` | Navigate to Inbox | | `Tab` `C` | Comment on Selected Task | | `Tab` `A` | Assign Selected Task | | `Tab` `D` | Set Due Date | | `Tab` `F` | Add Follower | | `Tab` `T` | Add a tag to the task | | `Tab` `S` | Focus Subtasks | | `Tab` `/` | Search for a project, tag, person, or task | {.shortcuts} ### Selection | Shortcut | Action | | ----------------- | ---------------------------- | | `Up/Down` | Change Selection | | `Shift` `(click)` | Select Range | | `Shift` `Up/Down` | Select Range | | `Ctrl` `(click)` | Multi-select Individual Task | {.shortcuts} ### Application | Shortcut | Action | | ------------- | --------------------------------- | | `Ctrl` `/` | Show Keyboard Shortcuts | | `Tab` | Expand the right pane | | `Esc` | Collapse the right pane | | `Tab` `X` | Enter Focus Mode | | `Tab` `Q` | Quick Add | | `Tab` `Enter` | Post Comment (from comment field) | | `Tab` `B` | What it sounds like | {.shortcuts} ## Also see - [Keyboard shortcuts for Asana](https://asana.com/guide/help/faq/shortcuts) _(asana.com)_ ================================================ FILE: source/_posts/ascii-code.md ================================================ --- title: ASCII Code date: 2023-01-05 12:44:21 tags: - ASCII - code - Table categories: - Other intro: | This cheatsheet is a complete list of ASCII Code Table with their numbers and names. --- ## ASCII Code Table {.cols-1} ### ASCII Code Table | Symbol | Dec | Oct | Hex | Bin | | ---------------------------------- | --- | --- | --- | -------- | | NUL (Null) | 0 | 0 | 0 | 0 | | SOH (Start of Heading) | 1 | 1 | 1 | 1 | | STX (Start of Text) | 2 | 2 | 2 | 10 | | ETX (End of Text) | 3 | 3 | 3 | 11 | | EOT (End of Transmission) | 4 | 4 | 4 | 100 | | ENQ (Enquiry) | 5 | 5 | 5 | 101 | | ACK (Acknowledgment) | 6 | 6 | 6 | 110 | | BEL (Bell) | 7 | 7 | 7 | 111 | | BS (Back Space) | 8 | 10 | 8 | 1000 | | HT (Horizontal Tab) | 9 | 11 | 9 | 1001 | | LF (Line Feed) | 10 | 12 | 0A | 1010 | | VT (Vertical Tab) | 11 | 13 | 0B | 1011 | | FF (Form Feed) | 12 | 14 | 0C | 1100 | | CR (Carriage Return) | 13 | 15 | 0D | 1101 | | SO (Shift Out / X-On) | 14 | 16 | 0E | 1110 | | SI (Shift In / X-Off) | 15 | 17 | 0F | 1111 | | DLE (Data Line Escape) | 16 | 20 | 10 | 10000 | | DC1 (Device Control 1 / oft. XON) | 17 | 21 | 11 | 10001 | | DC2 (Device Control 2) | 18 | 22 | 12 | 10010 | | DC3 (Device Control 3 / oft. XOFF) | 19 | 23 | 13 | 10011 | | DC4 (Device Control 4) | 20 | 24 | 14 | 10100 | | NAK (Negative Acknowledgement) | 21 | 25 | 15 | 10101 | | SYN (Synchronous Idle) | 22 | 26 | 16 | 10110 | | ETB (End of Transmit Block) | 23 | 27 | 17 | 10111 | | CAN (Cancel) | 24 | 30 | 18 | 11000 | | EM (End of Medium) | 25 | 31 | 19 | 11001 | | SUB (Substitute) | 26 | 32 | 1A | 11010 | | ESC (Escape) | 27 | 33 | 1B | 11011 | | FS (File Separator) | 28 | 34 | 1C | 11100 | | GS (Group Separator) | 29 | 35 | 1D | 11101 | | RS (Record Separator) | 30 | 36 | 1E | 11110 | | US (Unit Separator) | 31 | 37 | 1F | 11111 | | (Space) | 32 | 40 | 20 | 100000 | | ! | 33 | 41 | 21 | 100001 | | " | 34 | 42 | 22 | 100010 | | # | 35 | 43 | 23 | 100011 | | $ | 36 | 44 | 24 | 100100 | | % | 37 | 45 | 25 | 100101 | | & | 38 | 46 | 26 | 100110 | | ' | 39 | 47 | 27 | 100111 | | ( | 40 | 50 | 28 | 101000 | | ) | 41 | 51 | 29 | 101001 | | \* | 42 | 52 | 2A | 101010 | | + | 43 | 53 | 2B | 101011 | | , | 44 | 54 | 2C | 101100 | | - | 45 | 55 | 2D | 101101 | | . | 46 | 56 | 2E | 101110 | | / | 47 | 57 | 2F | 101111 | | 0 | 48 | 60 | 30 | 110000 | | 1 | 49 | 61 | 31 | 110001 | | 2 | 50 | 62 | 32 | 110010 | | 3 | 51 | 63 | 33 | 110011 | | 4 | 52 | 64 | 34 | 110100 | | 5 | 53 | 65 | 35 | 110101 | | 6 | 54 | 66 | 36 | 110110 | | 7 | 55 | 67 | 37 | 110111 | | 8 | 56 | 70 | 38 | 111000 | | 9 | 57 | 71 | 39 | 111001 | | : | 58 | 72 | 3A | 111010 | | ; | 59 | 73 | 3B | 111011 | | < | 60 | 74 | 3C | 111100 | | = | 61 | 75 | 3D | 111101 | | > | 62 | 76 | 3E | 111110 | | ? | 63 | 77 | 3F | 111111 | | @ | 64 | 100 | 40 | 1000000 | | A | 65 | 101 | 41 | 1000001 | | B | 66 | 102 | 42 | 1000010 | | C | 67 | 103 | 43 | 1000011 | | D | 68 | 104 | 44 | 1000100 | | E | 69 | 105 | 45 | 1000101 | | F | 70 | 106 | 46 | 1000110 | | G | 71 | 107 | 47 | 1000111 | | H | 72 | 110 | 48 | 1001000 | | I | 73 | 111 | 49 | 1001001 | | J | 74 | 112 | 4A | 1001010 | | K | 75 | 113 | 4B | 1001011 | | L | 76 | 114 | 4C | 1001100 | | M | 77 | 115 | 4D | 1001101 | | N | 78 | 116 | 4E | 1001110 | | O | 79 | 117 | 4F | 1001111 | | P | 80 | 120 | 50 | 1010000 | | Q | 81 | 121 | 51 | 1010001 | | R | 82 | 122 | 52 | 1010010 | | S | 83 | 123 | 53 | 1010011 | | T | 84 | 124 | 54 | 1010100 | | U | 85 | 125 | 55 | 1010101 | | V | 86 | 126 | 56 | 1010110 | | W | 87 | 127 | 57 | 1010111 | | X | 88 | 130 | 58 | 1011000 | | Y | 89 | 131 | 59 | 1011001 | | Z | 90 | 132 | 5A | 1011010 | | [ | 91 | 133 | 5B | 1011011 | | \ | 92 | 134 | 5C | 1011100 | | ] | 93 | 135 | 5D | 1011101 | | ^ | 94 | 136 | 5E | 1011110 | | \_ | 95 | 137 | 5F | 1011111 | | \` | 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 {} {} {} ... END {< final actions >} ``` #### Example ``` awk ' BEGIN { print "\n>>>Start" } !/(login|shutdown)/ { print NR, $0 } END { print "<<30 {print $1}' /etc/passwd ``` See: [Conditions](#awk-conditions) ### Generate 1000 spaces ``` awk 'BEGIN{ while (a++ < 1000) s=s " "; print s }' ``` See: [Loops](#awk-loops) ### Arrays ``` awk 'BEGIN { fruits["mango"] = "yellow"; fruits["orange"] = "orange" for(fruit in fruits) { print "The color of " fruit " is " fruits[fruit] } }' ``` See: [Arrays](#awk-arrays) ### Functions ``` # => 5 awk 'BEGIN{print length("hello")}' # => HELLO awk 'BEGIN{print toupper("hello")}' # => hel awk 'BEGIN{print substr("hello", 1, 3)}' ``` See: [Functions](#awk-functions) ## Awk Variables ### Build-in variables | - | - | | -------------- | --------------------------------------------------- | | `$0` | Whole line | | `$1, $2...$NF` | First, second… last field | | `NR` | `N`umber of `R`ecords | | `NF` | `N`umber of `F`ields | | `OFS` | `O`utput `F`ield `S`eparator
_(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 ]]` | Equal | | `[[ NUM -ne NUM ]]` | Not equal | | `[[ NUM -lt NUM ]]` | Less than | | `[[ NUM -le NUM ]]` | Less than or equal | | `[[ NUM -gt NUM ]]` | Greater than | | `[[ NUM -ge NUM ]]` | Greater than or equal | | `(( NUM < NUM ))` | Less than | | `(( NUM <= NUM ))` | Less than or equal | | `(( NUM > NUM ))` | Greater than | | `(( NUM >= NUM ))` | Greater than or equal | ### String conditions | Condition | Description | | ------------------ | --------------------------- | | `[[ -z STR ]]` | Empty string | | `[[ -n STR ]]` | Not empty string | | `[[ STR == STR ]]` | Equal | | `[[ STR = STR ]]` | Equal (Same above) | | `[[ STR < STR ]]` | Less than _(ASCII)_ | | `[[ STR > STR ]]` | Greater than _(ASCII)_ | | `[[ STR != STR ]]` | Not Equal | | `[[ STR =~ STR ]]` | Regexp | ### Example {.row-span-3} #### String ```bash if [[ -z "$string" ]]; then echo "String is empty" elif [[ -n "$string" ]]; then echo "String is not empty" else echo "This never happens" fi ``` #### Combinations ```bash if [[ X && Y ]]; then ... fi ``` #### Equal ```bash if [[ "$A" == "$B" ]]; then ... fi ``` #### Regex ```bash if [[ '1. abc' =~ ([a-z]+) ]]; then echo ${BASH_REMATCH[1]} fi ``` #### Smaller ```bash if (( $a < $b )); then echo "$a is smaller than $b" fi ``` #### Exists ```bash if [[ -e "file.txt" ]]; then echo "file exists" fi ``` ### File conditions {.row-span-2} | Condition | Description | | ----------------- | -------------------------------------- | | `[[ -e FILE ]]` | Exists | | `[[ -d FILE ]]` | Directory | | `[[ -f FILE ]]` | File | | `[[ -h FILE ]]` | Symlink | | `[[ -s FILE ]]` | Size is > 0 bytes | | `[[ -r FILE ]]` | Readable | | `[[ -w FILE ]]` | Writable | | `[[ -x FILE ]]` | Executable | | `[[ f1 -nt f2 ]]` | f1 newer than f2 | | `[[ f1 -ot f2 ]]` | f2 older than f1 | | `[[ f1 -ef f2 ]]` | Same files | ### More conditions | Condition | Description | | -------------------- | -------------------- | ----- | --- | | `[[ -o noclobber ]]` | If OPTION is enabled | | `[[ ! EXPR ]]` | Not | | `[[ X && Y ]]` | And | | `[[ X | | Y ]]` | Or | ### logical and, or ```bash if [ "$1" = 'y' -a $2 -gt 0 ]; then echo "yes" fi if [ "$1" = 'n' -o $2 -lt 0 ]; then echo "no" fi ``` ## Bash Loops ### Basic for loop ```bash for i in /etc/rc.*; do echo $i done ``` ### C-like for loop ```bash for ((i = 0 ; i < 100 ; i++)); do echo $i done ``` ### Ranges {.row-span-2} ```bash for i in {1..5}; do echo "Welcome $i" done ``` #### With step size ```bash for i in {5..50..5}; do echo "Welcome $i" done ``` ### Continue ```bash {data=3,5} for number in $(seq 1 3); do if [[ $number == 2 ]]; then continue; fi echo "$number" done ``` ### Break ```bash for number in $(seq 1 3); do if [[ $number == 2 ]]; then # Skip entire rest of loop. break; fi # This will only print 1 echo "$number" done ``` ### Until ```bash count=0 until [ $count -gt 10 ]; do echo "$count" ((count++)) done ``` ### While with increment ```bash i=1 while [[ $i -lt 4 ]]; do echo "Number: $i" ((i++)) done ``` ### While with decrement ```bash i=3 while [[ $i -gt 0 ]]; do echo "Number: $i" ((i--)) done ``` #### Combined with test ```bash i=3 while ((i--)); do echo "Number: $i" done ``` ### Forever ```bash while true; do # here is some code. done ``` ### Forever (shorthand) ```bash while :; do # here is some code. done ``` ### Reading lines ```bash while read line; do echo $line done < file.txt ``` ## Bash Functions ### Defining functions ```bash myfunc() { echo "hello $1" } ``` ```bash # Same as above (alternate syntax) function myfunc() { echo "hello $1" } ``` ```bash myfunc "John" ``` ### Returning values ```bash myfunc() { local myresult='some value' echo $myresult } ``` ```bash result="$(myfunc)" ``` ### Raising errors ```bash myfunc() { return 1 } ``` ```bash if myfunc; then echo "success" else echo "failure" fi ``` ## Bash Options {.cols-2} ### Options ```bash # Avoid overlay files # (echo "hi" > foo) set -o noclobber # Used to exit upon error # avoiding cascading errors set -o errexit # Unveils hidden failures set -o pipefail # Exposes unset variables set -o nounset ``` ### Glob options ```bash # Non-matching globs are removed # ('*.foo' => '') shopt -s nullglob # Non-matching globs throw errors shopt -s failglob # Case insensitive globs shopt -s nocaseglob # Wildcards match dotfiles # ("*.sh" => ".foo.sh") shopt -s dotglob # Allow ** for recursive matches # ('lib/**/*.rb' => 'lib/a/b/c.rb') shopt -s globstar ``` ## Bash History {.cols-2} ### Commands | Command | Description | | --------------------- | ----------------------------------------- | | `history` | Show history | | `sudo !!` | Run the previous command with sudo | | `shopt -s histverify` | Don't execute expanded result immediately | ### Expansions | Expression | Description | | ------------ | ---------------------------------------------------- | | `!$` | Expand last parameter of most recent command | | `!*` | Expand all parameters of most recent command | | `!-n` | Expand `n`th most recent command | | `!n` | Expand `n`th command in history | | `!` | Expand most recent invocation of command `` | ### Operations | Code | Description | | -------------------- | --------------------------------------------------------------------- | | `!!` | Execute last command again | | `!!:s///` | Replace first occurrence of `` to `` in most recent command | | `!!:gs///` | Replace all occurrences of `` to `` in most recent command | | `!$:t` | Expand only basename from last parameter of most recent command | | `!$:h` | Expand only directory from last parameter of most recent command | `!!` and `!$` can be replaced with any valid expansion. ### Slices | Code | Description | | -------- | ---------------------------------------------------------------------------------------- | | `!!:n` | Expand only `n`th token from most recent command (command is `0`; first argument is `1`) | | `!^` | Expand first argument from most recent command | | `!$` | Expand last token from most recent command | | `!!:n-m` | Expand range of tokens from most recent command | | `!!:n-$` | Expand `n`th token to last from most recent command | `!!` can be replaced with any valid expansion i.e. `!cat`, `!-2`, `!42`, etc. ## Miscellaneous ### Numeric calculations ```bash $((a + 200)) # Add 200 to $a ``` ```bash $(($RANDOM%200)) # Random number 0..199 ``` ### Subshells ```bash (cd somedir; echo "I'm now in $PWD") pwd # still in first directory ``` ### Inspecting commands ```bash command -V cd #=> "cd is a function/alias/whatever" ``` ### Redirection {.row-span-2 .col-span-2} ```bash python hello.py > output.txt # stdout to (file) python hello.py >> output.txt # stdout to (file), append python hello.py 2> error.log # stderr to (file) python hello.py 2>&1 # stderr to stdout python hello.py 2>/dev/null # stderr to (null) python hello.py &>/dev/null # stdout and stderr to (null) ``` ```bash python hello.py < foo.txt # feed foo.txt to stdin for python ``` ### Source relative ```bash source "${0%/*}/../share/foo.sh" ``` ### Directory of script ```bash DIR="${0%/*}" ``` ### Case/switch ```bash case "$1" in start | up) vagrant up ;; *) echo "Usage: $0 {start|stop|ssh}" ;; esac ``` ### Trap errors {.col-span-2} ```bash trap 'echo Error at about $LINENO' ERR ``` or ```bash traperr() { echo "ERROR: ${BASH_SOURCE[1]} at about ${BASH_LINENO[0]}" } set -o errtrace trap traperr ERR ``` ### printf ```bash printf "Hello %s, I'm %s" Sven Olga #=> "Hello Sven, I'm Olga printf "1 + 1 = %d" 2 #=> "1 + 1 = 2" printf "Print a float: %f" 2 #=> "Print a float: 2.000000" ``` ### Getting options {.col-span-2} ```bash while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do case $1 in -V | --version ) echo $version exit ;; -s | --string ) shift; string=$1 ;; -f | --flag ) flag=1 ;; esac; shift; done if [[ "$1" == '--' ]]; then shift; fi ``` ### Check for command's result {.col-span-2} ```bash if ping -c 1 google.com; then echo "It appears you have a working internet connection" fi ``` ### Special variables {.row-span-2} | Expression | Description | | ---------- | ---------------------------- | | `$?` | Exit status of last task | | `$!` | PID of last background task | | `$$` | PID of shell | | `$0` | Filename of the shell script | See [Special parameters](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables). ### Grep check {.col-span-2} ```bash if grep -q 'foo' ~/.bash_history; then echo "You appear to have typed 'foo' in the past" fi ``` ### Backslash escapes {.row-span-2} -   - \! - \" - \# - \& - \' - \( - \) - \, - \; - \< - \> - \[ - \| - \\ - \] - \^ - \{ - \} - \` - \$ - \* - \? {.cols-4 .marker-none} Escape these special characters with `\` ### Heredoc ```sh cat <\` | Select all layers | | `Shift` \` | 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 int main(void) { printf("Hello World!\n"); return 0; } ``` Compile `hello.c` file with `gcc` ```bash $ gcc -Wall -g hello.c -o hello ``` Run the compiled binary `hello` ```bash $ ./hello ``` Output => Hello World! ### Variables {.row-span-2} ```c int myNum = 15; int myNum2; // do not assign, then assign myNum2 = 15; int myNum3 = 15; // myNum3 is 15 myNum3 = 10; // myNum3 is now 10 float myFloat = 5.99; // floating point number char myLetter = 'D'; // character int x = 5; int y = 6; int sum = x + y; // add variables to sum // declare multiple variables int a = 5, b = 6, c = 50; ``` ### Constants ```c const int minutesPerHour = 60; const float PI = 3.14; ``` Best Practices ```c const int BIRTHYEAR = 1980; ``` ### Comment ```c // this is a comment printf("Hello World!\n"); // Can comment anywhere in file /*Multi-line comment, print Hello World! to the screen, it's awesome */ ``` ### Print text ```c printf("I am learning C.\n"); int testInteger = 5; printf("Number = %d\n", testInteger); float f = 5.99; // floating point number printf("Value = %f\n", f); short a = 0b1010110; // binary number int b = 02713; // octal number long c = 0X1DAB83; // hexadecimal number // output in octal form printf("a=%ho, b=%o, c=%lo\n", a, b, c); // output => a=126, b=2713, c=7325603 // Output in decimal form printf("a=%hd, b=%d, c=%ld\n", a, b, c); // output => a=86, b=1483, c=1944451 // output in hexadecimal form (letter lowercase) printf("a=%hx, b=%x, c=%lx\n", a, b, c); // output => a=56, b=5cb, c=1dab83 // Output in hexadecimal (capital letters) printf("a=%hX, b=%X, c=%lX\n", a, b, c); // output => a=56, b=5CB, c=1DAB83 ``` ### Control the number of spaces ```c int a1 = 20, a2 = 345, a3 = 700; int b1 = 56720, b2 = 9999, b3 = 20098; int c1 = 233, c2 = 205, c3 = 1; int d1 = 34, d2 = 0, d3 = 23; printf("%-9d %-9d %-9d\n", a1, a2, a3); printf("%-9d %-9d %-9d\n", b1, b2, b3); printf("%-9d %-9d %-9d\n", c1, c2, c3); printf("%-9d %-9d %-9d\n", d1, d2, d3); ``` output result ```bash 20 345 700 56720 9999 20098 233 205 1 34 0 23 ``` In `%-9d`, `d` means to output in `10` base, `9` means to occupy at least `9` characters width, and the width is not enough to fill with spaces, `-` means left alignment ### Strings ```c char greetings[] = "Hello World!"; printf("%s", greetings); ``` Access string ```c char greetings[] = "Hello World!"; printf("%c", greetings[0]); ``` Modify string ```c char greetings[] = "Hello World!"; greetings[0] = 'J'; printf("%s", greetings); // prints "Jello World!" ``` Another way to create a string ```c char greetings[] = {'H','e','l','l','\0'}; printf("%s", greetings); // print "Hell!" ``` Creating String using character pointer (String Literals) ```c char *greetings = "Hello"; printf("%s", greetings); // print "Hello!" ``` **NOTE**: String literals might be stored in read-only section of memory. Modifying a string literal invokes undefined behavior. You can't modify it! `C` **does not** have a String type, use `char` type and create an `array` of characters ### Condition {.row-span-2} ```c int time = 20; if (time < 18) { printf("Goodbye!\n"); } else { printf("Good evening!\n"); } // Output -> "Good evening!" int time = 22; if (time < 10) { printf("Good morning!\n"); } else if (time < 20) { printf("Goodbye!\n"); } else { printf("Good evening!\n"); } // Output -> "Good evening!" ``` ### Ternary operator {.col-span-2} ```c int age = 20; (age > 19) ? printf("Adult\n") : printf("Teenager\n"); ``` ### Switch ```c int day = 4; switch (day) { case 3: printf("Wednesday\n"); break; case 4: printf("Thursday\n"); break; default: printf("Weekend!\n"); } // output -> "Thursday" (day 4) ``` ### While Loop ```c int i = 0; while (i < 5) { printf("%d\n", i); i++; } ``` **NOTE**: Don't forget to increment the variable used in the condition, otherwise the loop will never end and become an "infinite loop"! ### Do/While Loop ```c int i = 0; do { printf("%d\n", i); i++; } while (i < 5); ``` ### For Loop ```c for (int i = 0; i < 5; i++) { printf("%d\n", i); } ``` ### Break out of the loop Break/Continue {.row-span-2} ```c for (int i = 0; i < 10; i++) { if (i == 4) { break; } printf("%d\n", i); } ``` Break out of the loop when `i` is equal to `4` ```c for (int i = 0; i < 10; i++) { if (i == 4) { continue; } printf("%d\n", i); } ``` Example to skip the value of `4` ### While Break Example ```c int i = 0; while (i < 10) { if (i == 4) { break; } printf("%d\n", i); i++; } ``` ### While continue example ```c int i = 0; while (i < 10) { i++; if (i == 4) { continue; } printf("%d\n", i); } ``` ### Arrays {.row-span-2} ```c int myNumbers[] = {25, 50, 75, 100}; printf("%d", myNumbers[0]); // output 25 ``` Change array elements ```c int myNumbers[] = {25, 50, 75, 100}; myNumbers[0] = 33; printf("%d", myNumbers[0]); ``` Loop through the array ```c int myNumbers[] = {25, 50, 75, 100}; int i; for (i = 0; i < 4; i++) { printf("%d\n", myNumbers[i]); } ``` Set array size ```c // Declare an array of four integers: int myNumbers[4]; // add element myNumbers[0] = 25; myNumbers[1] = 50; myNumbers[2] = 75; myNumbers[3] = 100; ``` ### Enumeration Enum {.col-span-2} ```c enum week { Mon = 1, Tues, Wed, Thurs, Fri, Sat, Sun }; ``` Define enum variable ```c enum week a, b, c; enum week { Mon = 1, Tues, Wed, Thurs, Fri, Sat, Sun } a, b, c; ``` With an enumeration variable, you can assign the value in the list to it ```c enum week { Mon = 1, Tues, Wed, Thurs, Fri, Sat, Sun }; enum week a = Mon, b = Wed, c = Sat; // or enum week{ Mon = 1, Tues, Wed, Thurs, Fri, Sat, Sun } a = Mon, b = Wed, c = Sat; ``` ### Enumerate sample applications ```c enum week {Mon = 1, Tues, Wed, Thurs} day; scanf("%d", &day); switch(day) { case Mon: puts("Monday"); break; case Tues: puts("Tuesday"); break; case Wed: puts("Wednesday"); break; case Thurs: puts("Thursday"); break; default: puts("Error!"); } ``` ### User input ```c // Create an integer variable to store the number we got from the user int myNum; // Ask the user to enter a number printf("Enter a number: "); // Get and save the number entered by the user scanf("%d", &myNum); // Output the number entered by the user printf("The number you entered: %d\n", myNum); ``` ### User input string ```c // create a string char firstName[30]; // Ask the user to enter some text printf("Enter your name: "); // get and save the text scanf("%s", &firstName); // output text printf("Hello %s.\n", firstName); ``` ### memory address When a variable is created, it is assigned a memory address ```c int myAge = 43; printf("%p", &myAge); // Output: 0x7ffe5367e044 ``` To access it, use the reference operator (`&`) ### create pointer ```c int myAge = 43; // an int variable printf("%d\n", myAge); // output the value of myAge(43) // Output the memory address of myAge (0x7ffe5367e044) printf("%p\n", &myAge); ``` ### pointer variable {.col-span-2} ```c int myAge = 43; // an int variable int*ptr = &myAge; // pointer variable named ptr, used to store the address of myAge printf("%d\n", myAge); // print the value of myAge (43) printf("%p\n", &myAge); // output the memory address of myAge (0x7ffe5367e044) printf("%p\n", ptr); // use the pointer (0x7ffe5367e044) to output the memory address of myAge ``` ### Dereference ```c int myAge = 43; // variable declaration int*ptr = &myAge; // pointer declaration // Reference: output myAge with a pointer // memory address (0x7ffe5367e044) printf("%p\n", ptr); // dereference: output the value of myAge with a pointer (43) printf("%d\n", *ptr); ``` ## Operators ### Arithmetic Operators ```c int myNum = 100 + 50; int sum1 = 100 + 50; // 150 (100 + 50) int sum2 = sum1 + 250; // 400 (150 + 250) int sum3 = sum2 + sum2; // 800 (400 + 400) ``` --- | Operator | Name | Example | | -------- | --------- | ------- | | `+` | Add | `x + y` | | `-` | Subtract | `x - y` | | `*` | Multiply | `x * y` | | `/` | Divide | `x / y` | | `%` | Modulo | `x % y` | | `++` | Increment | `++x` | | `--` | Decrement | `--x` | ### Assignment operator | Example | As | | -------------------- | ------------------------- | | x `=` 5 | x `=` 5 | | x `+=` 3 | x `=` x `+` 3 | | x `-=` 3 | x `=` x `-` 3 | | x `*=` 3 | x `=` x `*` 3 | | x `/=` 3 | x `=` x `/` 3 | | x `%=` 3 | x `=` x `%` 3 | | x `&=` 3 | x `=` x `&` 3 | | x \|= 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 // Get myheader.h in the local directory #include "myheader.h" #undef FILE_SIZE #define FILE_SIZE 42 // undefine and define to 42 ``` ### Predefined macros {.row-span-2} | Macro | Description | | ---------- | :-------------------------------------------------------------------- | | `__DATE__` | The current date, a character constant in the format "MMM DD YYYY" | | `__TIME__` | The current time, a character constant in the format "HH:MM:SS" | | `__FILE__` | This will contain the current filename, a string constant | | `__LINE__` | This will contain the current line number, a decimal constant | | `__STDC__` | Defined as `1` when the compiler compiles against the `ANSI` standard | {.show-header} `ANSI C` defines a number of macros that you can use, but you cannot directly modify these predefined macros #### Predefined macro example ```c #include int main(void) { printf("File: %s\n", __FILE__); printf("Date: %s\n", __DATE__); printf("Time: %s\n", __TIME__); printf("Line: %d\n", __LINE__); printf("ANSI: %d\n", __STDC__); } ``` ### Macro continuation operator (\\) A macro is usually written on a single line. ```c #define message_for(a, b) \ printf(#a " and " #b ": We love you!\n") ``` If the macro is too long to fit on a single line, use the macro continuation operator `\` ### String Constantization Operator (#) ```c #include #define message_for(a, b) \ printf(#a " and " #b ": We love you!\n") int main(void) { message_for(Carole, Debra); return 0; } ``` When the above code is compiled and executed, it produces the following result: ``` Carole and Debra: We love you! ``` When you need to convert a macro parameter to a string constant, use the string constant operator `#` ### tag paste operator (##) ```c #include #define tokenpaster(n) printf ("Token " #n " = %d\n", token##n) int main(void) { int token34 = 40; tokenpaster(34); return 0; } ``` ### defined() operator ```c #include #if !defined (MESSAGE) #define MESSAGE "You wish!" #endif int main(void) { printf("Here is the message: %s\n", MESSAGE); return 0; } ``` ### Parameterized macros ```c int square(int x) { return x * x; } ``` The macro rewrites the above code as follows: ```c #define square(x) ( (x) * (x) ) ``` No spaces are allowed between the macro name and the opening parenthesis ```c #include #define MAX(x,y) ( (x) > (y) ? (x) : (y) ) int main(void) { printf("Max between 20 and 10 is %d\n", MAX(10, 20)); return 0; } ``` ## C Function ### Function declaration and definition {.row-span-2} ```c int main(void) { printf("Hello World!\n"); return 0; } ``` The function consists of two parts ```c void myFunction() { // declaration declaration // function body (code to be executed) (definition) } ``` --- - `Declaration` declares the function name, return type and parameters _(if any)_ - `Definition` function body _(code to execute)_ --- ```c // function declaration void myFunction(); // main method int main() { myFunction(); // --> call the function return 0; } void myFunction() {// Function definition printf("Good evening!\n"); } ``` ### Call function ```c // create function void myFunction() { printf("Good evening!\n"); } int main() { myFunction(); // call the function myFunction(); // can be called multiple times return 0; } // Output -> "Good evening!" // Output -> "Good evening!" ``` ### Function parameters ```c void myFunction(char name[]) { printf("Hello %s\n", name); } int main() { myFunction("Liam"); myFunction("Jenny"); return 0; } // Hello Liam // Hello Jenny ``` ### Multiple parameters ```c void myFunction(char name[], int age) { printf("Hi %s, you are %d years old.\n",name,age); } int main() { myFunction("Liam", 3); myFunction("Jenny", 14); return 0; } // Hi Liam you are 3 years old. // Hi Jenny you are 14 years old. ``` ### Return value {.row-span-2} ```c int myFunction(int x) { return 5 + x; } int main() { printf("Result: %d\n", myFunction(3)); return 0; } // output 8 (5 + 3) ``` Two parameters ```c int myFunction(int x, int y) { return x + y; } int main() { printf("Result: %d\n", myFunction(5, 3)); // store the result in a variable int result = myFunction(5, 3); printf("Result = %d\n", result); return 0; } // result: 8 (5 + 3) // result = 8 (5 + 3) ``` ### Recursive example ```c int sum(int k); int main() { int result = sum(10); printf("%d\n", result); return 0; } int sum(int k) { if (k > 0) { return k + sum(k -1); } else { return 0; } } ``` ### Mathematical functions ```c #include void main(void) { printf("%f\n", sqrt(16)); // square root printf("%f\n", ceil(1.4)); // round up (round) printf("%f\n", floor(1.4)); // round down (round) printf("%f\n", pow(4, 3)); // x(4) to the power of y(3) } ``` --- - `abs(x)` absolute value - `acos(x)` arc cosine value - `asin(x)` arc sine - `atan(x)` arc tangent - `cbrt(x)` cube root - `cos(x)` cosine - the value of `exp(x)` Ex - `sin(x)` the sine of x - tangent of `tan(x)` angle ## C Structures ### Create structure ```c struct MyStructure { // structure declaration int myNum; // member (int variable) char myLetter; // member (char variable) }; // end the structure with a semicolon ``` Create a struct variable called `s1` ```c{7} struct myStructure { int myNum; char myLetter; }; int main() { struct myStructure s1; return 0; } ``` ### Strings in the structure ```c{9} struct myStructure { int myNum; char myLetter; char myString[30]; // String }; int main() { struct myStructure s1; strcpy(s1. myString, "Some text"); // print value printf("My string: %s\n", s1.myString); return 0; } ``` Assigning values to strings using the `strcpy` function ### Accessing structure members {.row-span-2} ```c{11,12,16} // create a structure called myStructure struct myStructure { int myNum; char myLetter; }; int main() { // Create a structure variable called myStructure called s1 struct myStructure s1; // Assign values ​​to the members of s1 s1.myNum = 13; s1.myLetter = 'B'; // Create a structure variable of myStructure called s2 // and assign it a value struct myStructure s2 = {13, 'B'}; // print value printf("My number: %d\n", s1.myNum); printf("My letter: %c\n", s1.myLetter); return 0; } ``` Create different structure variables ```c struct myStructure s1; struct myStructure s2; // Assign values ​​to different structure variables s1.myNum = 13; s1.myLetter = 'B'; s2.myNum = 20; s2.myLetter = 'C'; ``` ### Copy structure ```c{6} struct myStructure s1 = { 13, 'B', "Some text" }; struct myStructure s2; s2 = s1; ``` In the example, the value of `s1` is copied to `s2` ### Modify value ```c{6,7} // Create a struct variable and assign it a value struct myStructure s1 = { 13, 'B' }; // modify the value s1.myNum = 30; s1.myLetter = 'C'; // print value printf("%d %c", s1.myNum, s1.myLetter); ``` ## File Processing ### File processing function | Function | Description | | ----------- | :------------------------------------------------ | | `fopen()` | `open` a new or existing file | | `fprintf()` | write data to `file` | | `fscanf()` | `read` data from a file | | `fputc()` | write a character to `file` | | `fgetc()` | `read` a character from a file | | `fclose()` | `close` the file | | `fseek()` | set the file pointer to `the given position` | | `fputw()` | Write an integer `to` a file | | `fgetw()` | `read` an integer from a file | | `ftell()` | returns the current `position` | | `rewind()` | set the file pointer to the beginning of the file | {.show-header} There are many functions in the C library to `open`/`read`/`write`/`search` and `close` files ### Open mode parameter | Mode | Description | | ----- | :---------------------------------------------------------------------------------------------------------- | | `r` | Open a text file in `read` mode, allowing the file to be read | | `w` | Open a text file in `write` mode, allowing writing to the file | | `a` | Open a text file in `append` mode
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 void main() { FILE *fp; char ch; fp = fopen("file_handle.c", "r"); while (1) { ch = fgetc(fp); if (ch == EOF) break; printf("%c", ch); } fclose(fp); } ``` After performing all operations on the file, the file must be closed with `fclose()` ### Write to file: fprintf() ```c{7} #include void main() { FILE *fp; fp = fopen("file.txt", "w"); // open the file // write data to file fprintf(fp, "Hello file for fprintf..\n"); fclose(fp); // close the file } ``` ### Read the file: fscanf() ```c{6} #include void main() { FILE *fp; char buff[255]; // Create a char array to store file data fp = fopen("file.txt", "r"); while(fscanf(fp, "%s", buff) != EOF) { printf("%s ", buff); } fclose(fp); } ``` ### Write to file: fputc() ```c{6} #include void main() { FILE *fp; fp = fopen("file1.txt", "w"); // open the file fputc('a',fp); // write a single character to the file fclose(fp); // close the file } ``` ### Read the file: fgetc() ```c{8} #include #include void main() { FILE *fp; char c; clrscr(); fp = fopen("myfile.txt", "r"); while( (c = fgetc(fp) ) != EOF) { printf("%c", c); } fclose(fp); getch(); } ``` ### Write to file: fputs() ```c {8} #include #include void main() { FILE *fp; clrscr(); fp = fopen("myfile2.txt","w"); fputs("hello c programming",fp); fclose(fp); getch(); } ``` ### Read files: fgets() ```c {10} #include #include void main() { FILE *fp; char text[300]; clrscr(); fp = fopen("myfile2.txt", "r"); printf("%s", fgets(text, 200, fp)); fclose(fp); getch(); } ``` ### fseek() ```c{8} #include void main(void) { FILE *fp; fp = fopen("myfile.txt","w+"); fputs("This is Book", fp); // Set file pointer to the given position fseek(fp, 7, SEEK_SET); fputs("Kenny Wong", fp); fclose(fp); } ``` Set the file pointer to the given position ### rewind() ```c{11} #include #include void main() { FILE *fp; char c; clrscr(); fp = fopen("file.txt", "r"); while( (c = fgetc(fp) ) != EOF) { printf("%c", c); } rewind(fp); // move the file pointer to the beginning of the file while( (c = fgetc(fp) ) != EOF) { printf("%c", c); } fclose(fp); getch(); } // output // Hello World! Hello World! ``` ### ftell() ```c{11} #include #include void main () { FILE *fp; int length; clrscr(); fp = fopen("file.txt", "r"); fseek(fp, 0, SEEK_END); length = ftell(fp); // return current position fclose(fp); printf("File size: %d bytes", length); getch(); } // output // file size: 18 bytes ``` ================================================ FILE: source/_posts/canvas.md ================================================ --- title: HTML Canvas date: 2024-05-28 22:16:42 background: bg-[#cc5534] tags: - web categories: - Programming intro: | This HTML Canvas quick reference cheat sheet lists the common HTML5 Canvas design tags in readable layout. plugins: - copyCode - runCode --- ## Getting Started ### Basic Setup ```html Canvas Example ``` ### Getting the Context ```js const canvas = document.getElementById('myCanvas'); const ctx = canvas.getContext('2d'); ``` ## Drawing Shapes ### Rectangles ```js ctx.fillStyle = 'red'; ctx.fillRect(10, 10, 150, 100); // x, y, width, height ctx.strokeStyle = 'blue'; ctx.lineWidth = 5; ctx.strokeRect(200, 10, 150, 100); // x, y, width, height ctx.clearRect(15, 15, 30, 30); // x, y, width, height ``` ## Paths ### Lines ```js ctx.beginPath(); ctx.moveTo(50, 50); // Starting point ctx.lineTo(200, 50); // Ending point ctx.lineTo(200, 200); // Next line ending point ctx.closePath(); // Connects the end point to the start point ctx.stroke(); ``` ### Circles ```js ctx.beginPath(); ctx.arc(150, 150, 75, 0, 2 * Math.PI); // x, y, radius, startAngle, endAngle ctx.fillStyle = 'green'; ctx.fill(); ctx.stroke(); ``` ### Arcs ```js ctx.beginPath(); ctx.arc(150, 150, 75, 0, Math.PI); // x, y, radius, startAngle, endAngle ctx.stroke(); ``` ## Bezier and Quadratic Curves ### Quadratic Curve ```js ctx.beginPath(); ctx.moveTo(50, 250); ctx.quadraticCurveTo(200, 100, 400, 250); // cpX, cpY, endX, endY ctx.stroke(); ``` ### Bezier Curve ```js ctx.beginPath(); ctx.moveTo(50, 300); ctx.bezierCurveTo(150, 100, 350, 500, 450, 300); // cp1X, cp1Y, cp2X, cp2Y, endX, endY ctx.stroke(); ``` ### Text ```js ctx.font = '30px Arial'; ctx.fillStyle = 'black'; ctx.fillText('Hello Canvas', 10, 50); // text, x, y ctx.strokeText('Hello Canvas', 10, 100); // text, x, y ``` ### Images ```js const img = new Image(); img.src = 'path/to/image.jpg'; img.onload = () => { ctx.drawImage(img, 10, 10); // img, x, y ctx.drawImage(img, 50, 50, 100, 100); // img, x, y, width, height ctx.drawImage(img, 100, 100, 100, 100, 150, 150, 200, 200); // img, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight }; ``` ## Transformations ### Translation ```js ctx.translate(100, 100); // x, y ctx.fillRect(0, 0, 50, 50); ``` ### Rotation ```js ctx.rotate((Math.PI / 180) * 45); // Angle in radians ctx.fillRect(100, 100, 50, 50); ``` ### Scaling ```js ctx.scale(2, 2); // x, y ctx.fillRect(50, 50, 50, 50); ``` ## Gradients ### Linear Gradient ```js const linearGradient = ctx.createLinearGradient(0, 0, 200, 0); // x0, y0, x1, y1 linearGradient.addColorStop(0, 'red'); linearGradient.addColorStop(1, 'blue'); ctx.fillStyle = linearGradient; ctx.fillRect(10, 10, 200, 100); ``` ### Radial Gradient ```js const radialGradient = ctx.createRadialGradient(75, 50, 5, 90, 60, 100); // x0, y0, r0, x1, y1, r1 radialGradient.addColorStop(0, 'red'); radialGradient.addColorStop(1, 'blue'); ctx.fillStyle = radialGradient; ctx.fillRect(10, 10, 200, 100); ``` ### Patterns ```js const img = new Image(); img.src = 'path/to/image.jpg'; img.onload = () => { const pattern = ctx.createPattern(img, 'repeat'); // 'repeat', 'repeat-x', 'repeat-y', 'no-repeat' ctx.fillStyle = pattern; ctx.fillRect(0, 0, 300, 300); }; ``` ### Shadows ```js ctx.shadowColor = 'rgba(0, 0, 0, 0.5)'; ctx.shadowBlur = 10; ctx.shadowOffsetX = 5; ctx.shadowOffsetY = 5; ctx.fillStyle = 'red'; ctx.fillRect(100, 100, 100, 100); ``` ## Compositing ### Global Alpha ```js ctx.globalAlpha = 0.5; ctx.fillStyle = 'red'; ctx.fillRect(100, 100, 100, 100); ctx.fillStyle = 'blue'; ctx.fillRect(150, 150, 100, 100); ``` ### Global Composite Operation ```js ctx.globalCompositeOperation = 'source-over'; // Default ctx.fillStyle = 'red'; ctx.fillRect(100, 100, 100, 100); ctx.globalCompositeOperation = 'destination-over'; ctx.fillStyle = 'blue'; ctx.fillRect(150, 150, 100, 100); ``` ### Animations ```js let x = 0; function draw() { ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.fillStyle = 'blue'; ctx.fillRect(x, 100, 50, 50); x += 2; requestAnimationFrame(draw); } draw(); ``` ## Also read - [MDN doc ](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API) ================================================ FILE: source/_posts/chatgpt.md ================================================ --- title: ChatGPT date: 2023-02-09 10:28:43 background: bg-[#4aa181] tags: - AI - OpenAI - Prompts - Tips categories: - Toolkit intro: This cheat sheet lists out prompts and tips from all over the world on how to use ChatGPT effectively plugins: - copyCode --- ## Glossary ### AI - Prompt: input or query that guides an AI model in generating a response.[[s]](https://time.com/collections/the-ai-dictionary-from-allbusiness-com/7273982/definition-of-prompt-ai-prompt) - Tokens: the smallest units of text processed by an AI model (e.g., words, subwords, characters, and punctuation marks) that varies depending on the model and the tokenization method.[[s]](https://time.com/collections/the-ai-dictionary-from-allbusiness-com/7273998/definition-of-token/) - Token Limit: the maximum number of tokens an AI model can process in one interaction.[[s]](https://time.com/collections/the-ai-dictionary-from-allbusiness-com/7273998/definition-of-token/) - Artificial intelligence (AI): technology that enables machines to simulate human cognition (e.g., human learning, comprehension, problem solving, decision making, creativity, and autonomy).[[s]](https://www.ibm.com/think/topics/artificial-intelligence) - AI Model: program trained on a set of data to recognize patterns or make decisions without further human intervention.[[s]](https://www.ibm.com/think/topics/ai-model) - Large language model (LLM): transformer-based AI model trained on large text datasets to understand and generate natural language.[[s]](https://www.ibm.com/think/topics/large-language-models) - Hallucination: AI response that detects nonexistent patterns and creates outputs that are nonsensical and inaccurate.[[s]](https://www.ibm.com/think/topics/ai-hallucinations) - Jailbreak: exploiting vulnerabilities in AI systems to bypass their ethical guidelines and perform restricted actions.[[s]](https://www.ibm.com/think/insights/ai-jailbreak) ### Prompt Engineering Techniques - Zero-shot: prompt with no examples.[[s]](https://www.ibm.com/think/topics/zero-shot-prompting) - One-shot: prompt with one example.[[s]](https://www.ibm.com/think/topics/one-shot-prompting) - Few-shot: prompt with multiple examples.[[s]](https://www.ibm.com/think/topics/few-shot-prompting) - Chain of thought: prompt guiding the model to break down complex reasoning into intermediate steps.[[s]](https://cloud.google.com/discover/what-is-prompt-engineering?hl=en) ### Modes - Study and learn: interactive learning that encourages step by step problem solving instead of giving direct answers.[[s]](https://openai.com/index/chatgpt-study-mode/) - Create image: generate images from text prompts.[[s]](https://help.openai.com/en/articles/9260256-chatgpt-capabilities-overview) - Think longer: performs deeper reasoning and generates more accurate, thoughtful, and detailed responses.[[s]](https://openai.com/index/introducing-gpt-5) - Deep research: reads and synthesizes content across multiple online sources and produces cited structured outputs.[[s]](https://help.openai.com/en/articles/9260256-chatgpt-capabilities-overview) - Web search: finds recent and real-time information online.[[s]](https://help.openai.com/en/articles/9260256-chatgpt-capabilities-overview) - Canvas: separate interface for collaborative writing and coding that provides inline editing, suggestions, and feedback.[[s]](https://openai.com/index/introducing-canvas/) ## Prompt Tips ### Efficiency - Use the latest model as it's generally more capable and easier to prompt.[[s]](https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-the-openai-api) - Provide general instructions at the start of conversations or when changing direction to avoid repeating them. - Don't say polite phrases to the AI (e.g., please, thank you) as it adds unecessary computational costs.[[s]](https://www.techradar.com/computing/artificial-intelligence/chatgpt-spends-tens-of-millions-of-dollars-on-people-playing-please-and-thank-you-but-sam-altman-says-its-worth-it?utm_source=chatgpt.com) - Don't explicitly ask the AI for help (e.g., can you help me do x?). - Don't explicitly reference yourself unless clarifying multiple entities (e.g., I want to, do x for me). ### Clarity - Be clear, specific, and provide enough context for the model to understand what you are asking.[[s]](https://help.openai.com/en/articles/10032626-prompt-engineering-best-practices-for-chatgpt) - Prompt engineering often requires iterative refinement by adjusting wording, adding context, and simplifying requests.[[s]](https://help.openai.com/en/articles/10032626-prompt-engineering-best-practices-for-chatgpt) - Break complex tasks into smaller focused prompts.[[s]](https://help.openai.com/en/articles/4936848-how-do-i-create-a-good-prompt-for-an-ai-model) - Specify focus areas, highlight important aspects, and ask for multiple options.[[s]](https://help.openai.com/en/articles/4936848-how-do-i-create-a-good-prompt-for-an-ai-model) - Provide examples of the desired output format to improve accuracy.[[s]](https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-the-openai-api) - Focus on specifying what to do and not just what to avoid.[[s]](https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-the-openai-api) - Before writing a prompt, identify the goal and expected output.[[s]](https://www.techtarget.com/searchenterpriseai/definition/AI-prompt) - Provide important keywords or phrases where possible to faciliate SEO and communicate term preferences to the AI model.[[s]](https://www.techtarget.com/searchenterpriseai/definition/AI-prompt) - Keep prompts precise and clean by omitting unnecessary or redundant information.[[s]](https://www.techtarget.com/searchenterpriseai/definition/AI-prompt) - Avoid conflicting terms that might confuse the AI.[[s]](https://www.techtarget.com/searchenterpriseai/definition/AI-prompt) - Open-ended questions usually provide more detailed responses than [closed-ended questions] and yes/no questions.[[s]](https://www.techtarget.com/searchenterpriseai/definition/AI-prompt) - When in doubt, ask AI to generate prompts for you.[[s]](https://www.techtarget.com/searchenterpriseai/definition/AI-prompt) ### Security - Don't share sensitive information with AI as you can't be certain how it's stored, if it will be shared, of if it's vulnerable to data breaches.[[s]](https://www.grantthornton.com/insights/articles/advisory/2023/anticipate-cybersecurity-and-privacy-risks-in-ai) ## Prompt Structure ### Prompt Frameworks General Purpose ``` [role] [task] [style] [output format] [constraint] ``` ### Role Standard - Act as [occupation] with [specifications] - [List of roles](https://github.com/f/awesome-chatgpt-prompts) Roleplay - Act as [name] with [visual description] [personality] [behaviour examples] [lore] in [scenario] ### Tasks (Language And Text) {.secondary} [verb] [task] [specifics] Generate - Generate [content type] to [entity] about [topic] and cover [aspects] - Generate random [names|numbers|words|ideas|X] matching [criteria] - [Continue|extend|lengthen] Summarise - [Summarise|shorten|write concise|write key points|write main lesson] - Create outline Refine - [Write better|improve] - Paraphrase - Correct spelling, grammar, and punctuation errors - Change [narrative voice A] to [narrative voice B] - Replace X with Y Explain - [Explain|elaborate] - Explain [how to do|each step of] X - Explain what X does - Explain X [in simple terms|like I’m 5|simplify]; Simplify X - Teach me about [topic|subject] - Provide [example|analogy] Organize - Sort X by [key] in [order] - Categorize Advise - Create [strategy|goals|milestones|roadmap|schedule|timeline] for X - Recommend [media type] [on|similar to] [topic] - Recommend [gifts|X] for [entity|occasion] - Recommend improvements - Provide [advice|feedback] for X Analyze - Extract [themes|keywords|info] about X - Identify [similarities|differences] between X and Y - Analyse the [sentiment|tone] of X - Identify gaps in X - Evaluate [strengths and weaknesses|pros and cons] of X - Is X [comparison] Y? Translate - Translate [language A] into [language B] - Convert [unit A] to [unit B] - Reformat as [output format] Filter - Filter items where [condition] - Choose best from [options] - Choose [top|lowest|first|last|random] [quantity] from [options] Engage - Provide questions about X Research - Get up-to-date [facts|news|data] on X - Find [sources|references|citations] for X - Is this true? ### Tasks (Meta) {.secondary} Chat Memory - Based on [previous context] do X ### Tasks (Code) {.secondary} Generate - Generate code in [programming language] to do X Translate - Translate [programming language A] into [programming language B] Optimize - Optimize X for [benefit] Debug - Debug X and explain why it's doing Y ### Tasks (Image) {.secondary} Generate - Generate image of X in [style] Edit - Edit image to have X ### Tasks (File And Image Upload) {.secondary} Explain - Question what is shown - Interpet visuals Analysis - Extract data ### Task (5W1H Questions) {.secondary} Who - Who is X? - Who is [involved|affected by|responsible] for X? - Who should I contact for help with X? What - [What is|define|explain|describe] X? - What are the key topics of X? - What does [quote] mean? - [What is done well?|what can be improved?] - What is the best way to do X? When - When [did|will] X happen? - When is the best time to do X? Where - Where did X take place? - Where to find X? Why - Why did X happen? - Why is this approach used? - Why is X important? - Why might X succeed or fail? - Why is X preferable to Y? How - How to do X? - How does X work? - How did this happen? ### Style Using [style] Imitate - Using style of [person|brand|genre|character] Formality - Formal - Informal Directness - Direct - Indirect Tones Positive - Optimistic - Appreciative - Assertive - Calm - Confident - Encouraging - Friendly - Humorous - Inspirational Negative - Pessimistic - Accusatory - Concerned - Critical - Regretful - Sarcastic - Urgent ### Output Format (Text) {.secondary} In [output format] Paragraphs - Paragraphs **_(default)_** List - Bulleted list - Numbered list - Check list Code - Code Instructions - Step-by-step instructions Knowledge Base - Q&A - FAQ Creative Writing - [Joke|humour] - [Lyrics|song] - [Metaphorical|stylized language] - Poetry - [Script|screenplay|dialogue] - [Story|narrative] Games - [Quiz|test|flashcards|drills] - [Riddle|puzzle] - [rpg|choose-your-own-adventure] ### Output Format (Visual) {.secondary} Data Visualization - Table - [Chart type] chart Creative Visual - ASCII Art - Emojis - Word cloud ### Output Format (File Type) {.secondary} Document - PDF Structured Data And Markup - Plain text - Markdown - HTML - XML - CSV - JSON - LaTeX Programming Code And Scripting - [Programming language] - Pseudocode - Regular expression ### Constraint But [constraint] Length - Be [extremely detailed|concise] - In [quantity] [words|sentences] Language - No jargon or technical terms Structure - Show [quantity] [examples|options] - No headers - No pretext titles Voice And Style - Use [first-person|second-person|third-person] narrative voice - Don't change the wording - Use pop culture references Edits - Do [minor|major] edits - Only show [changed|unchanged] content ## Examples ### Job Name Business ```{.wrap} Suggest creative name for tech startup ``` ```{.wrap} Suggest catchy names for bakery business ``` Interview Questions ```{.wrap} Suggest common software engineer interview questions ``` Create Course Outline ```{.wrap} Create course outline on web development for beginners ``` ```{.wrap} Create training program outline for customer service workshop ``` ### Relationship Gift Ideas ```{.wrap} Suggest gift ideas for clients ``` ```{.wrap} Suggest gift ideas for clients who work as flourists ``` ```{.wrap} Suggest gift ideas for my wife who loves steampunk art and crafts, mystery sci-fi, journalling ``` ```{.wrap} Suggest creative ideas for 10 year old’s birthday ``` ### Competition Select Contest Winners ```{.wrap} Randomly select 1 name from this list ``` ```{.wrap} Randomly select 5 email addresses from this list ``` ```{.wrap} Select top 3 records with the shortest lap times from this list ``` ### Programming Create Code ```{.wrap} Create program to calculate the factorial of given number in python ``` Create Regular Expressions ```{.wrap} Create regex to match all email addresses in list ``` ```{.wrap} Create regex to match all words that start with "ban" ``` ```{.wrap} Create regex to match 8-digit password ``` Explain Code ```{.wrap} Explain why code not working ``` ```{.wrap} Explain what code does ``` ```{.wrap} Explain how to make a HTTP request in javascript ``` Update Code ```{.wrap} Add code comments ``` ```{.wrap} Add class "header" to header tag ``` ```{.wrap} Update CSS to change font color to blue ``` Translate - Specifically called transpile when addressing programming languages. ```{.wrap} Translate code to Python ``` ### Email Create Emails ```{.wrap} Write email inviting Jack to dinner on the weekend ``` ```{.wrap} Write email sequence for our new customer onboarding process ``` ```{.wrap} Write email to inform staff of elevator maintenance on 23 June 2025, elevators unavailable for 24 hours, apologise for inconvenience ``` ```{.wrap} Suggest response to message asking about project status ``` Format Email ```{.wrap} Proofread and format email ``` Email Marketing ```{.wrap} Suggest tips to increase open and click-through rates for my email campaigns ``` ```{.wrap} Suggest ways to make my email content more engaging and relevant to my subscribers ``` Extract Data ```{.wrap} Extract all email addresses in text ``` ### Spreadsheet Create Something ```{.wrap} Create excel formula to calculate sum of cells A1 to A10 ``` ```{.wrap} Generate spreadsheet dummy data as a placeholder ``` ```{.wrap} Create macro to calculate average of cells B1 to B10 and insert result in cell C1 ``` Explain Something ```{.wrap} Explain formula =SUM(A1:A10) in simple terms ``` ```{.wrap} Suggest tips to improve spreadsheet efficiency ``` ### Social Media Create Content ```{.wrap} Suggest meme ideas for dogs ``` ```{.wrap} Suggest climate change post ideas to engage my followers ``` ```{.wrap} Generate hashtags and caption for a picture of scenic sunset ``` ### Reading Text Analysis ```{.wrap} Summarize article ``` ```{.wrap} Write concise main points ``` Translate ```{.wrap} Translate to spanish ``` Recommendations ```{.wrap} Recommend books similar to Hunger Games ``` ### Design Design Prompts ```{.wrap} Create design prompt of logo for new sports brand ``` ```{.wrap} Suggest eye-catching thumbnail designs for youtube video on healthy eating ``` Aesthetic Pairings ```{.wrap} Suggest font pairing for travel blog header design ``` ```{.wrap} Suggest color palette for wedding photography website ``` ### Data Analysis Data Extraction ```{.wrap} Extract all numbers from text ``` Data Filtering ```{.wrap} Filter list based on [condition] ``` Data Presentation ```{.wrap} Create table from data ``` ### Paid Ads Create Ad ```{.wrap} Suggest creative ideas for new product launch ``` ```{.wrap} Suggest ad copy for travel company ``` ```{.wrap} Create headlines, body text, and calls to action for new fitness program ad ``` Ad Targeting ```{.wrap} Recommend target Facebook audience for clothing line ad campaign ``` Ad Technical Support ```{.wrap} Review tag manager code for errors ``` ### Amazon FBA Product Content ```{.wrap} Write compelling product description for latest item ``` Communication ```{.wrap} Rewrite appeal letter to make it more persuasive ``` ```{.wrap} Write effective email to reach out to potential suppliers ``` Product Strategy ```{.wrap} Suggest items that would make a good bundle for our customers ``` ```{.wrap} Organize product and pricing information into a neat and manageable spreadsheet ``` ### Writing Name Something ```{.wrap} Suggest titles for short story ``` ```{.wrap} Suggest titles for article 10 options ``` ```{.wrap} Suggest domain name for gardening blog ``` Content Creation ```{.wrap} Create outline for essay on exercise ``` ```{.wrap} Suggest ideas for blog on sustainable fashion ``` ```{.wrap} Create blog post on financial planning ``` ```{.wrap} Expand jazz music sentence ``` Editing And Formatting ```{.wrap} Change report tone to conversational ``` ```{.wrap} Proofread article ``` ```{.wrap} Format headings for blog post ``` Evaluation ```{.wrap} Check for bias ``` ```{.wrap} Check for plagiarism ``` ### Teacher Teaching Support ```{.wrap} Convert work history fact list into multiple-choice quiz ``` ```{.wrap} Suggest ideas for history assignment on American Revolution ``` ```{.wrap} Divide list of 30 students into groups of 6 ``` ```{.wrap} Create grading curve for class based on their test scores ``` ```{.wrap} Grade history essay and provide feedback on any areas for improvement ``` ### YouTube Content Creation ```{.wrap} Create timestamps for podcast episode transcript ``` ```{.wrap} Convert youtube cooking video into blog post with headings and bullet points ``` ```{.wrap} Create outline for a video about the benefits of meditation ``` ```{.wrap} Suggest thumbnail ideas for video on "DIY home decor" ``` ```{.wrap} Suggest fashion video ideas for individual episodes ``` Analyse ```{.wrap} What is the script tone for environmental issues video ``` Communication ```{.wrap} Create thoughtful and polite response to negative comment on youtube video ``` ### Research History Research ```{.wrap} Explain events leading up to American Civil War ``` ```{.wrap} Provide key details about printing press invention ``` ```{.wrap} Research olympic games history ``` ```{.wrap} Provide key details about French Revolution ``` ```{.wrap} Explain history of Byzantine Empire ``` Science Reseearch ```{.wrap} Explain quantum computing in simple terms ``` ```{.wrap} Explain rocket science like i'm five ``` ### SEO Keywords ```{.wrap} Find best keywords for [topic] with low competition ``` ```{.wrap} Generate list of keywords targeting multiple geographic locations ``` ```{.wrap} Generate list of keyword synonyms for [topic] ``` Content Optimization ```{.wrap} Find opportunities for internal linking related to [topic] ``` ```{.wrap} Research industry-specific terminology for use in [topic] content ``` ```{.wrap} Find best time to publish content related to [topic] ``` Link Building ```{.wrap} Find authoritative websites to acquire backlinks for [topic] content ``` ```{.wrap} Research best external linking strategies for [topic] ``` Tools ```{.wrap} Find most popular tools used for [topic] seo ``` Tactics ```{.wrap} Research best tactics for [topic] mobile optimization ``` ```{.wrap} What are the best tactics for [topic] international seo? ``` Competitors ```{.wrap} Research competitor strategies related to [topic] ``` ```{.wrap} What are the best affiliate marketing websites for [topic]? ``` ### Roleplay ```{.wrap} Name: William Shakespeare Visual description: - Wearing Elizabethan attire. - Holding quill. Personality: - Keen observer and a masterful weaver of tales. - Knack for finding humor in the most unlikely places. Behaviour examples: - "To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them?" - "Canst thou not minister to a mind diseased?" Lore: - Grew up in Stratford-upon-Avon and later moved to London. - Famous for his tragedies, comedies, and historical plays. Scenario: - Night of a grand performance at the Globe Theatre. - Lead actor is missing and staff are concerned about how to achieve the performance. ``` ================================================ FILE: source/_posts/chmod.md ================================================ --- title: Chmod date: 2021-07-01 10:51:44 background: bg-indigo-600 tags: - permission categories: - Linux Command intro: | This quick reference cheat sheet provides a brief overview of file permissions, and the operation of the chmod command plugins: - copyCode --- ## Getting Started ### Syntax ```shell script $ chmod [options] ``` #### Example ```shell $ chmod 755 foo.txt $ chmod +x cheatsheets.py $ chmod u-x cheatsheets.py $ chmod u=rwx,g=rx,o= cheatsheets.sh ``` #### Change files and directories recursively ```shell $ chmod -R 755 my_directory ``` The `chmod` command stands for "change mode" ### Chmod Generator Chmod Generator allows you to quickly and visually generate permissions in numerical and symbolic. ### Common Permissions | Command | s | Meaning | | ------- | --------- | ---------------------------- | | `400` | r-------- | Readable by owner only | | `500` | r-x------ | Avoid Changing | | `600` | rw------- | Changeable by user | | `644` | rw-r--r-- | Read and change by user | | `660` | rw-rw---- | Changeable by user and group | | `700` | rwx------ | Only user has full access | | `755` | rwxr-xr-x | Only changeable by user | | `775` | rwxrwxr-x | Sharing mode for a group | | `777` | rwxrwxrwx | Everybody can do everything | ### Explains ```shell $ ls -l -rw-r--r-- 1 root root 3 Jun 29 15:35 a.log drwxr-xr-x 2 root root 2 Jun 30 18:06 dir ``` #### Permission analysis of "dir" ```text d rwx r-x r-x ┬ ─┬─ ─┬─ ─┬─ │ │ │ │ │ │ │ └─ 4. Other|5 (4+0+1) │ │ └────── 3. Group|5 (4+0+1) │ └─────────── 2. User |7 (4+2+1) └─────────────── 1. File Type | directory ``` ### Permission Modes {.col-span-2} | Permission | Description | Octal | Decimal | | ---------- | ----------------------- | ----- | --------- | | `---` | No Permission | 000 | 0 (0+0+0) | | `--x` | Execute | 001 | 1 (0+0+1) | | `-w-` | Write | 010 | 2 (0+2+0) | | `-wx` | Execute and Write | 011 | 3 (0+2+1) | | `r--` | Read | 100 | 4 (4+0+0) | | `r-x` | Read and Execute | 101 | 5 (4+0+1) | | `rw-` | Read and Write | 110 | 6 (4+2+0) | | `rwx` | Read, Write and Execute | 111 | 7 (4+2+1) | {.show-header} ### Objects | Who (abbr.) | Meaning | | ----------- | ------------------ | | `u` | `U`ser | | `g` | `G`roup | | `o` | `O`thers | | `a` | `A`ll, same as ugo | {.show-header} ### Permissions | Abbreviation | Permission | Value | | ------------ | ------------- | ----- | | `r` | `R`ead | 4 | | `w` | `W`rite | 2 | | `x` | E`x`ecute | 1 | | `-` | No permission | 0 | {.show-header} ### File Types | Abbreviation | File Type | | ------------ | --------------- | | `d` | `D`irectory | | `-` | Regular file | | `l` | Symbolic `L`ink | {.show-header} ## Chmod Examples ### Operators | Symbol | Description | | ------ | ----------- | | `+` | Add | | `-` | Remove | | `=` | Set | ### chmod 600 ```shell $ chmod 600 example.txt $ chmod u=rw,g=,o= example.txt $ chmod a+rwx,u-x,g-rwx,o-rwx example.txt ``` ### chmod 664 ```shell $ chmod 664 example.txt $ chmod u=rw,g=rw,o=r example.txt $ chmod a+rwx,u-x,g-x,o-wx example.txt ``` ### chmod 777 ```shell $ chmod 777 example.txt $ chmod u=rwx,g=rwx,o=rwx example.txt $ chmod a=rwx example.txt ``` ### Symbolic mode {.row-span-3} Deny execute permission to everyone. ```shell $ chmod a-x chmodExampleFile.txt ``` Allow read permission to everyone. ```shell $ chmod a+r chmodExampleFile.txt ``` Make a file readable and writable by the group and others. ```shell $ chmod go+rw chmodExampleFile.txt ``` Make a shell script executable by the user/owner. ```shell $ chmod u+x chmodExampleScript.sh ``` Allow everyone to read, write, and execute the file and turn on the set group-ID. ```shell $ chmod =rwx,g+s chmodExampleScript.sh ``` ### Removing Permissions {.row-span-3} In order to remove read write permissions given to a file, use the following syntax: ```shell $ chmod o-rw example.txt ``` For our file example.txt, we can remove read write permissions using chmod for group by running the following command: ```shell $ chmod g-rx example.txt ``` To remove chmod read write permissions from the group while adding read write permission to public/others, we can use the following command: ```shell $ chmod g-rx, o+rx example.txt ``` But, if you wish to remove all permissions for group and others, you can do so using the go= instead: ```shell $ chmod go= example.txt ``` ### Executable ```shell $ chmod +x ~/example.py $ chmod u+x ~/example.py $ chmod a+x ~/example.py ``` ### chmod 754 ```shell $ chmod 754 foo.sh $ chmod u=rwx,g=rx,o=r foo.sh ``` ## Chmod Practices ### SSH Permissions ```shell script $ chmod 700 ~/.ssh $ chmod 600 ~/.ssh/authorized_keys $ chmod 600 ~/.ssh/id_rsa $ chmod 600 ~/.ssh/id_rsa.pub $ chmod 400 /path/to/access_key.pem ``` ### Web Permissions ```shell script $ chmod -R 644 /var/www/html/ $ chmod 644 .htaccess $ chmod 644 robots.txt $ chmod 755 /var/www/uploads/ $ find /var/www/html -type d -exec chmod 755 {} \; ``` ### Batch Change ```shell script $ chmod -R 644 /your_path $ find /path -type d -exec chmod 755 {} \; $ find /path -type f -exec chmod 644 {} \; ``` See: [Command Substitution](https://tldp.org/LDP/abs/html/commandsub.html) ## Also see - [Modify File Permissions with chmod](https://www.linode.com/docs/guides/modify-file-permissions-with-chmod/) _(linode.com)_ ================================================ FILE: source/_posts/chrome-devtools.md ================================================ --- title: Chrome Developer Tools date: 2022-11-23 16:23:31.696017 background: bg-[#c64d3e] label: tags: - - categories: - Keyboard Shortcuts intro: | A visual cheat-sheet for the 56 keyboard shortcuts found in Chrome's Developer Tools --- ## Keyboard Shortcuts ### Opening DevTools | Shortcut | Action | | ------------------ | --------------------------------- | | `Ctrl` `Shift` `I` | Open whatever panel you used last | | `Ctrl` `Shift` `J` | Open the Console panel | | `Ctrl` `Shift` `C` | Open the Elements panel | {.shortcuts} ### Global Shortcuts {.row-span-2} | Shortcut | Action | | ------------------ | ------------------------------------------------------ | | `F1` | Show Settings | | `Ctrl` `]` | Focus the next panel | | `Ctrl` `[` | Focus the previous panel | | `Ctrl` `Shift` `D` | Switch back to whatever docking position you last used | | `Ctrl` `Shift` `M` | Toggle Device Mode | | `Ctrl` `Shift` `C` | Toggle Inspect Element Mode | | `Ctrl` `Shift` `P` | Open the Command Menu | | `Esc` | Toggle the Drawer | | `Ctrl` `R` | Normal reload | | `Ctrl` `Shift` `R` | Hard reload | | `Ctrl` `F` | Search for text within the current panel | | `Ctrl` `Shift` `F` | Opens the Search tab in the Drawer | | `Ctrl` `P` | Open a file in the Sources panel | | `Ctrl` `Shift` `+` | Zoom in | | `Ctrl` `-` | Zoom out | | `Ctrl` `0` | Restore default zoom level | | `Ctrl` `O` `!` | Run snippet | {.shortcuts} ### Elements Panel | Shortcut | Action | | ------------- | ----------------------------------------------------------------- | | `Ctrl` `Z` | Undo change | | `Ctrl` `Y` | Redo change | | `Up/Down` | Select the element above or below the currently-selected element | | `Right` | Expand the currently-selected node | | `Left` | Collapse the currently-selected node | | `Enter` | Toggle Edit Attributes mode on the currently-selected element | | `Tab` | Select the next attribute after entering Edit Attributes mode | | `Shift` `Tab` | Select the previous attribute after entering Edit Attributes mode | | `H` | Hide the currently-selected element | | `F2` | Toggle Edit as HTML mode on the currently-selected element | {.shortcuts} ### Sources Panel | Shortcut | Action | | ------------------ | ----------------------------------------------------------------- | | `Ctrl` `\` | Pause script execution (if running), or resume (if paused) | | `Ctrl` `'` | Step over next function call | | `Ctrl` `;` | Step into next function call | | `Ctrl` `Shift` `;` | Step out of current function | | `Ctrl` `./,` | Select the call frame below or above the currently-selected frame | | `Ctrl` `S` | Save changes to local modifications | | `Ctrl` `Alt` `S` | Save all changes | | `Ctrl` `G` | Go to line | | `Alt` `W` | Close the active tab | {.shortcuts} ### Code Editor | Shortcut | Action | | ------------ | -------------------------------------------------------------- | | `Ctrl` `Del` | Delete all characters in the last word, up to the cursor | | `Ctrl` `M` | Go to matching bracket | | `Ctrl` `/` | Toggle single-line comment | | `Ctrl` `D` | Select the next occurrence of whatever word the cursor is on | | `Ctrl` `U` | Deselect the next occurrence of whatever word the cursor is on | {.shortcuts} ### Performance Panel | Shortcut | Action | | ---------- | ----------------------- | | `Ctrl` `E` | Start or stop recording | | `Ctrl` `S` | Save recording | | `Ctrl` `O` | Load recording | {.shortcuts} ### Memory Panel | Shortcut | Action | | ---------- | ----------------------- | | `Ctrl` `E` | Start or stop recording | {.shortcuts} ### Console Panel | Shortcut | Action | | ---------------------- | ------------------------------ | | `Tab` | Accept autocomplete suggestion | | `Esc` | Reject autocomplete suggestion | | `Up` | Get previous statement | | `Down` | Get next statement | | `Ctrl` \` | 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} ## Gradient CSS ### Gradient Maker {.col-span-3} | Parameter | Description | Example | |:--------------|:----------------------------------|:-----------------------------------------------| | **to right** | Gradient goes from left to right | `linear-gradient(to right, #ff7e5f, #feb47b)` | | **to left** | Gradient goes from right to left | `linear-gradient(to left, #ff7e5f, #feb47b)` | | **to bottom** | Gradient goes from top to bottom | `linear-gradient(to bottom, #ff7e5f, #feb47b)` | | **to top** | Gradient goes from bottom to top | `linear-gradient(to top, #ff7e5f, #feb47b)` | | **deg** | Specify an angle in degrees | `linear-gradient(45deg, ...)` | ================================================ FILE: source/_posts/colorscreen.md ================================================ --- title: ColorScreen date: 2026-01-04 12:00:00 background: bg-gradient-to-br from-slate-800 via-slate-900 to-black tags: - Tool - Display - Productivity categories: - Other intro: A quick reference collection of full-screen color pages, monitor tests, prank screens, screensavers, and timers. plugins: - copyCode --- ## Overview {.cols-2} ### What is ColorScreen? {.col-span-2} **[ColorScreen](https://colorscreen.co/)** is a collection of browser-based screen utilities designed for simplicity and privacy. It provides full-screen tools without ads or login requirements. - **Utilities**: Pure color pages, monitor diagnostics, prank screens, screensavers, and timers. - **Features**: System-level fullscreen support, local storage for settings, static web app. - **Use Cases**: Bias lighting, display testing (dead pixels/bleed), streaming backdrops, and productivity timing. [Visit ColorScreen.co](https://colorscreen.co/) {.link-arrow} ## Tools Directory {.cols-3} ### Pure Colors {.col-span-2} - [White Screen for Light](https://colorscreen.co/white-screen) — full-screen white page for lighting & testing - [Black Screen for OLED](https://colorscreen.co/black-screen) — pure black screen for OLED power saving & bleed tests - [Red Screen for Night Vision](https://colorscreen.co/red-screen) — red light for dark adaptation - [Green Screen for Chroma Key](https://colorscreen.co/green-screen) — green background for keying / streaming - [Blue Screen for Chroma Key](https://colorscreen.co/blue-screen) — blue background for keying / video - [Yellow Screen for Warm Light](https://colorscreen.co/yellow-screen) — warm yellow light - [Purple Screen for Ambient Light](https://colorscreen.co/purple-screen) — ambient purple vibe - [Orange Screen for Creativity](https://colorscreen.co/orange-screen) — energetic orange glow - [Pink Screen for Beauty Light](https://colorscreen.co/pink-screen) — soft pink beauty light {.cols-2 .marker-none} ### Lighting - [Meeting Zoom Lighting](https://colorscreen.co/meeting-zoom-lighting) — monitor-as-softbox lighting - [Live Streaming Lighting](https://colorscreen.co/live-streaming-lighting) — adjustable softbox screen {.marker-none} ### Screen Tests - [Online Dead Pixel Monitor Test](https://colorscreen.co/dead-pixel-test) — detect dead / stuck pixels - [Burn-in Fixer & Stuck Pixel Tool](https://colorscreen.co/burn-in-fixer) — reduce image retention - [Gradient / Color Banding Test](https://colorscreen.co/gradient-test) — check banding & transitions - [Grid Alignment & Projector Calibration](https://colorscreen.co/grid-alignment-test) — alignment / overscan test {.marker-none} ### Fake Update Screens (Prank) {.col-span-2} - [Windows 11 fake update](https://colorscreen.co/fake-update-screen-windows-11) - [Windows 10 fake update](https://colorscreen.co/fake-update-screen-windows-10) - [Windows 8 fake update](https://colorscreen.co/fake-update-screen-windows-8) - [Windows 7 fake update](https://colorscreen.co/fake-update-screen-windows-7) - [Windows XP fake update](https://colorscreen.co/fake-update-screen-windows-xp) - [Mac fake update](https://colorscreen.co/fake-update-screen-mac) - [Android fake update](https://colorscreen.co/fake-update-screen-android) - [iPad fake update](https://colorscreen.co/fake-update-screen-apple-ipad) - [iOS fake update](https://colorscreen.co/fake-update-screen-apple-iphone-ios) - [Ubuntu fake update](https://colorscreen.co/fake-update-screen-ubuntu) - [Steam fake update](https://colorscreen.co/fake-update-screen-steam) - [Sarcastic fake update](https://colorscreen.co/fake-update-screen-sarcastic) {.cols-2 .marker-none} ### Prank Screens - [Blue Screen of Death (BSOD)](https://colorscreen.co/bsod-prank) - [Broken Screen Simulator](https://colorscreen.co/broken-screen-prank) - [Hacker Typer](https://colorscreen.co/hacker-typer-prank) - [Matrix Rain Code](https://colorscreen.co/matrix-rain-prank) {.marker-none} ### Screensavers - [No Signal / SMPTE Bars](https://colorscreen.co/no-signal-screensaver) - [DVD Bounce](https://colorscreen.co/dvd-screensaver) - [Radar Scan](https://colorscreen.co/radar-screensaver) - [White Noise / TV Static](https://colorscreen.co/white-noise-screensaver) {.marker-none} ### Clocks & Timers - [Stopwatch (Lap Timer)](https://colorscreen.co/stopwatch) - [Countdown Timer](https://colorscreen.co/countdown-timer) - [Pomodoro Timer](https://colorscreen.co/pomodoro-timer) - [Flip Clock](https://colorscreen.co/flip-clock-screensaver) {.marker-none} ================================================ FILE: source/_posts/conventional-commits.md ================================================ --- title: Conventional Commits date: 2024-03-11 09:51:44 background: bg-[#e86d7a] tags: - permission categories: - Other intro: | A cheat sheet of the Conventional Commits and Conventional Comments standards plugins: --- ## Getting Started {.cols-3} ### Quick Guide #### Why Conventional Commits - Easy-to-follow structure for commit messages. - Clearly states the nature of changes. - Ensures uniformity in commit messages across teams. - Enables automated versioning and changelog generation. - Makes commit history easy to browse. - Allows the specification of 'scope' for more clarity. - Has a special notation for breaking changes. - Facilitates better understanding among team members. - Makes the review process efficient. - Helps in future troubleshooting with descriptive commit messages. #### Structure ```javascript [optional scope]: [optional body] [optional footer(s)] ``` [Official Website](https://www.conventionalcommits.org/en) {.link-arrow} ### Examples - feat: add jwt support - feat!: breaking change in API - feat(ui)!: redesign user profile page - fix: fix SQL injection vulnerability - fix(database): resolve data race condition - docs: update setup section of README - style(login): correct indentation in login component - refactor: refactor user database schema - perf: optimize user retrieval code for faster response - test: add tests for jwt authentication - test(payment): add tests for the payment gateway - chore: update build script - chore(deps): update dependencies - build(docker): update Dockerfile to use node 14 - ci: add job for integration tests - revert: revert commit a1b2c3d4e5f ### Types | Type | Description | | -------- | ---------------------------------------------------------------------------------------------------------------- | | `feat` | Introduces a new feature | | `fix` | Fixes a bug | | `docs` | Changes in documentation only | | `style` | Code changes that do not impact the functionality (e.g., formatting, white-space, etc) | | refactor | Code changes that neither fix a bug nor introduce a feature, typically improving code readability or structure | | perf | Code changes that improve performance | | test | Addition of missing tests or corrections to existing tests | | `chore` | Changes that do not modify the source code or test files, like tweaking the build process or adding dependencies | | build | Changes affecting the build system or external dependencies (e.g., changes in webpack, npm packages) | | ci | Changes to Continuous Integration configuration files and scripts (e.g., Travis, CircleCI, Jenkins) | | revert | Reverts a previously made commit | {.bold-first} ## Specification {.cols-1} ### Specification - Commits MUST be prefixed with a type, which consists of a noun, feat, fix, etc., followed by the OPTIONAL scope, OPTIONAL !, and REQUIRED terminal colon and space. - The type feat MUST be used when a commit adds a new feature to your application or library. - The type fix MUST be used when a commit represents a bug fix for your application. - A scope MAY be provided after a type. A scope MUST consist of a noun describing a section of the codebase surrounded by parenthesis, e.g., fix(parser): - A description MUST immediately follow the colon and space after the type/scope prefix. The description is a short summary of the code changes, e.g., fix: array parsing issue when multiple spaces were contained in string. - A longer commit body MAY be provided after the short description, providing additional contextual information about the code changes. The body MUST begin one blank line after the description. - A commit body is free-form and MAY consist of any number of newline separated paragraphs. - One or more footers MAY be provided one blank line after the body. Each footer MUST consist of a word token, followed by either a : or # separator, followed by a string value (this is inspired by the [git trailer convention](https://git-scm.com/docs/git-interpret-trailers)). - A footer’s token MUST use - in place of whitespace characters, e.g., Acked-by (this helps differentiate the footer section from a multi-paragraph body). An exception is made for BREAKING CHANGE, which MAY also be used as a token. - A footer’s value MAY contain spaces and newlines, and parsing MUST terminate when the next valid footer token/separator pair is observed. - Breaking changes MUST be indicated in the type/scope prefix of a commit, or as an entry in the footer. - If included as a footer, a breaking change MUST consist of the uppercase text BREAKING CHANGE, followed by a colon, space, and description, e.g., BREAKING CHANGE: environment variables now take precedence over config files. - If included in the type/scope prefix, breaking changes MUST be indicated by a ! immediately before the :. If ! is used, BREAKING CHANGE: MAY be omitted from the footer section, and the commit description SHALL be used to describe the breaking change. - Types other than feat and fix MAY be used in your commit messages, e.g., docs: update ref docs. - The units of information that make up Conventional Commits MUST NOT be treated as case sensitive by implementors, with the exception of BREAKING CHANGE which MUST be uppercase. - BREAKING-CHANGE MUST be synonymous with BREAKING CHANGE, when used as a token in a footer. ## Also see - [Conventional Commits](https://conventionalcommits.org/) _(conventionalcommits.org)_ ================================================ FILE: source/_posts/cpp.md ================================================ --- title: C++ date: 2021-06-01 11:51:44 background: bg-[#6d94c7] tags: categories: - Programming intro: | C++ quick reference cheat sheet that provides basic syntax and methods. plugins: - copyCode - runCode --- ## Getting Started ### hello.cpp ```cpp #include int main() { std::cout << "Hello CheatSheets\n"; return 0; } ``` Compiling and running ```shell script $ g++ hello.cpp -o hello $ ./hello Hello CheatSheets ``` ### Variables ```cpp int number = 5; // Integer float f = 0.95; // Floating number double PI = 3.14159; // Floating number char yes = 'Y'; // Character std::string s = "ME"; // String (text) bool isRight = true; // Boolean // Constants const float RATE = 0.8; ``` --- ```cpp int age {25}; // Since C++11 std::cout << age; // Print 25 ``` ### Primitive Data Types | Data Type | Size | Range | | --------- | -------------- | ------------------- | | `int` | 4 bytes | -2^31^ ^to^ 2^31^-1 | | `float` | 4 bytes | _N/A_ | | `double` | 8 bytes | _N/A_ | | `char` | 1 byte | -128 ^to^ 127 | | `bool` | 1 byte | true / false | | `void` | _N/A_ | _N/A_ | | `wchar_t` | 2 ^or^ 4 bytes | 1 wide character | {.show-header} ### User Input ```cpp int num; std::cout << "Type a number: "; std::cin >> num; std::cout << "You entered " << num; ``` ### Swap ```cpp int a = 5, b = 10; std::swap(a, b); // Outputs: a=10, b=5 std::cout << "a=" << a << ", b=" << b; ``` ### Comments ```cpp // A single one line comment in C++ /* This is a multiple line comment in C++ */ ``` ### If statement ```cpp if (a == 10) { // do something } ``` See: [Conditionals](#c-conditionals) ### Loops ```cpp for (int i = 0; i < 10; i++) { std::cout << i << "\n"; } ``` See: [Loops](#c-loops) ### Functions ```cpp #include void hello(); // Declaring int main() { // main function hello(); // Calling } void hello() { // Defining std::cout << "Hello CheatSheets!\n"; } ``` See: [Functions](#c-functions) ### References ```cpp int i = 1; int& ri = i; // ri is a reference to i ri = 2; // i is now changed to 2 std::cout << "i=" << i; i = 3; // i is now changed to 3 std::cout << "ri=" << ri; ``` `ri` and `i` refer to the same memory location. ### Namespaces ```cpp #include namespace ns1 {int val(){return 5;}} int main() { std::cout << ns1::val(); } ``` --- ```cpp #include namespace ns1 {int val(){return 5;}} using namespace ns1; using namespace std; int main() { cout << val(); } ``` Namespaces allow global identifiers under a name ## C++ Arrays ### Declaration ```cpp std::array marks; // Definition marks[0] = 92; marks[1] = 97; marks[2] = 98; // Define and initialize std::array = {92, 97, 98}; // With empty members std::array marks = {92, 97}; std::cout << marks[2]; // Outputs: 0 ``` ### Manipulation ```cpp ┌─────┬─────┬─────┬─────┬─────┬─────┐ | 92 | 97 | 98 | 99 | 98 | 94 | └─────┴─────┴─────┴─────┴─────┴─────┘ 0 1 2 3 4 5 ``` --- ```cpp std::array marks = {92, 97, 98, 99, 98, 94}; // Print first element std::cout << marks[0]; // Change 2nd element to 99 marks[1] = 99; // Take input from the user std::cin >> marks[2]; ``` ### Displaying ```cpp char ref[5] = {'R', 'e', 'f'}; // Range based for loop for (const int &n : ref) { std::cout << std::string(1, n); } // Traditional for loop for (int i = 0; i < sizeof(ref); ++i) { std::cout << ref[i]; } ``` ### Multidimensional ```cpp j0 j1 j2 j3 j4 j5 ┌────┬────┬────┬────┬────┬────┐ i0 | 1 | 2 | 3 | 4 | 5 | 6 | ├────┼────┼────┼────┼────┼────┤ i1 | 6 | 5 | 4 | 3 | 2 | 1 | └────┴────┴────┴────┴────┴────┘ ``` --- ```cpp int x[2][6] = { {1,2,3,4,5,6}, {6,5,4,3,2,1} }; for (int i = 0; i < 2; ++i) { for (int j = 0; j < 6; ++j) { std::cout << x[i][j] << " "; } } // Outputs: 1 2 3 4 5 6 6 5 4 3 2 1 ``` ## C++ Conditionals ### If Clause ```cpp if (a == 10) { // do something } ``` --- ```cpp int number = 16; if (number % 2 == 0) { std::cout << "even"; } else { std::cout << "odd"; } // Outputs: even ``` ### Else if Statement ```cpp int score = 99; if (score == 100) { std::cout << "Superb"; } else if (score >= 90) { std::cout << "Excellent"; } else if (score >= 80) { std::cout << "Very Good"; } else if (score >= 70) { std::cout << "Good"; } else if (score >= 60) std::cout << "OK"; else std::cout << "What?"; ``` ### Operators {.row-span-2} #### Relational Operators | | | | -------- | ---------------------------- | | `a == b` | a is equal to b | | `a != b` | a is NOT equal to b | | `a < b` | a is less than b | | `a > b` | a is greater b | | `a <= b` | a is less than or equal to b | | `a >= b` | a is greater or equal to b | #### Assignment Operators | Example | Equivalent to | | -------- | ---------------- | | `a += b` | _Aka_ a = a + b | | `a -= b` | _Aka_ a = a - b | | `a *= b` | _Aka_ a = a \* b | | `a /= b` | _Aka_ a = a / b | | `a %= b` | _Aka_ a = a % b | #### Logical Operators | Example | Meaning | | --------------------------- | ---------------------- | | `exp1 && exp2` | Both are true _(AND)_ | | 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 #include int main() { auto print = [](int num) { std::cout << num << std::endl; }; std::array arr = {1, 2, 3, 4}; std::for_each(arr.begin(), arr.end(), print); return 0; } ``` ### Range-based (Since C++11) ```cpp for (int n : {1, 2, 3, 4, 5}) { std::cout << n << " "; } // Outputs: 1 2 3 4 5 ``` --- ```cpp std::string hello = "CheatSheets.zip"; for (char c: hello) { std::cout << c << " "; } // Outputs: Q u i c k R e f . M E ``` ### Break statements ```cpp int password, times = 0; while (password != 1234) { if (times++ >= 3) { std::cout << "Locked!\n"; break; } std::cout << "Password: "; std::cin >> password; // input } ``` ### Several variations ```cpp for (int i = 0, j = 2; i < 3; i++, j--){ std::cout << "i=" << i << ","; std::cout << "j=" << j << ";"; } // Outputs: i=0,j=2;i=1,j=1;i=2,j=0; ``` ## C++ Functions ### Arguments & Returns ```cpp #include int add(int a, int b) { return a + b; } int main() { std::cout << add(10, 20); } ``` `add` is a function taking 2 ints and returning int ### Overloading ```cpp void fun(string a, string b) { std::cout << a + " " + b; } void fun(string a) { std::cout << a; } void fun(int a) { std::cout << a; } ``` ### Built-in Functions ```cpp #include #include // import library int main() { // sqrt() is from cmath std::cout << sqrt(9); } ``` ## C++ Classes & Objects {.cols-2} ### Defining a Class ```cpp class MyClass { public: // Access specifier int myNum; // Attribute (int variable) string myString; // Attribute (string variable) }; ``` ### Creating an Object ```cpp MyClass myObj; // Create an object of MyClass myObj.myNum = 15; // Set the value of myNum to 15 myObj.myString = "Hello"; // Set the value of myString to "Hello" cout << myObj.myNum << endl; // Output 15 cout << myObj.myString << endl; // Output "Hello" ``` ### Constructors ```cpp class MyClass { public: int myNum; string myString; MyClass() { // Constructor myNum = 0; myString = ""; } }; MyClass myObj; // Create an object of MyClass cout << myObj.myNum << endl; // Output 0 cout << myObj.myString << endl; // Output "" ``` ### Destructors ```cpp class MyClass { public: int myNum; string myString; MyClass() { // Constructor myNum = 0; myString = ""; } ~MyClass() { // Destructor cout << "Object destroyed." << endl; } }; MyClass myObj; // Create an object of MyClass // Code here... // Object is destroyed automatically when the program exits the scope ``` ### Class Methods ```cpp class MyClass { public: int myNum; string myString; void myMethod() { // Method/function defined inside the class cout << "Hello World!" << endl; } }; MyClass myObj; // Create an object of MyClass myObj.myMethod(); // Call the method ``` ### Access Modifiers ```cpp class MyClass { public: // Public access specifier int x; // Public attribute private: // Private access specifier int y; // Private attribute protected: // Protected access specifier int z; // Protected attribute }; MyClass myObj; myObj.x = 25; // Allowed (public) myObj.y = 50; // Not allowed (private) myObj.z = 75; // Not allowed (protected) ``` ### Getters and Setters ```cpp class MyClass { private: int myNum; public: void setMyNum(int num) { // Setter myNum = num; } int getMyNum() { // Getter return myNum; } }; MyClass myObj; myObj.setMyNum(15); // Set the value of myNum to 15 cout << myObj.getMyNum() << endl; // Output 15 ``` ### Inheritance ```cpp class Vehicle { public: string brand = "Ford"; void honk() { cout << "Tuut, tuut!" << endl; } }; class Car : public Vehicle { public: string model = "Mustang"; }; Car myCar; myCar.honk(); // Output "Tuut, tuut!" cout << myCar.brand + " " + myCar.model << endl; // Output "Ford Mustang" ``` ## C++ Preprocessor ### Preprocessor {.row-span-3} - [if](https://en.cppreference.com/w/cpp/preprocessor/conditional) - [elif](https://en.cppreference.com/w/cpp/preprocessor/conditional) - [else](https://en.cppreference.com/w/cpp/preprocessor/conditional) - [endif](https://en.cppreference.com/w/cpp/preprocessor/conditional) - [ifdef](https://en.cppreference.com/w/cpp/preprocessor/conditional) - [ifndef](https://en.cppreference.com/w/cpp/preprocessor/conditional) - [define](https://en.cppreference.com/w/cpp/preprocessor/replace) - [undef](https://en.cppreference.com/w/cpp/preprocessor/replace) - [include](https://en.cppreference.com/w/cpp/preprocessor/include) - [line](https://en.cppreference.com/w/cpp/preprocessor/line) - [error](https://en.cppreference.com/w/cpp/preprocessor/error) - [pragma](https://en.cppreference.com/w/cpp/preprocessor/impl) - [defined](https://en.cppreference.com/w/cpp/preprocessor/conditional) - [\_\_has_include](https://en.cppreference.com/w/cpp/feature_test) - [\_\_has_cpp_attribute](https://en.cppreference.com/w/cpp/feature_test) - [export](https://en.cppreference.com/w/cpp/keyword/export) - [import](https://en.cppreference.com/mwiki/index.php?title=cpp/keyword/import&action=edit&redlink=1) - [module](https://en.cppreference.com/mwiki/index.php?title=cpp/keyword/module&action=edit&redlink=1) {.marker-none .cols-2} ### Includes ```cpp #include "iostream" #include ``` ### Defines ```cpp #define FOO #define FOO "hello" #undef FOO ``` ### If {.row-span-2} ```cpp #ifdef DEBUG console.log('hi'); #elif defined VERBOSE ... #else ... #endif ``` ### Error ```cpp #if VERSION == 2.0 #error Unsupported #warning Not really supported #endif ``` ### Macro ```cpp #define DEG(x) ((x) * 57.29) ``` ### Token concat ```cpp #define DST(name) name##_s name##_t DST(object); #=> object_s object_t; ``` ### Stringification ```cpp #define STR(name) #name char * a = STR(object); #=> char * a = "object"; ``` ### file and line ```cpp #define LOG(msg) console.log(__FILE__, __LINE__, msg) #=> console.log("file.txt", 3, "hey") ``` ## Miscellaneous ### Escape Sequences | Escape Sequences | Characters | | ---------------- | --------------------- | | `\b` | Backspace | | `\f` | Form feed | | `\n` | Newline | | `\r` | Return | | `\t` | Horizontal tab | | `\v` | Vertical tab | | `\\` | Backslash | | `\'` | Single quotation mark | | `\"` | Double quotation mark | | `\?` | Question mark | | `\0` | Null Character | ### Keywords {.col-span-2 .row-span-2} - [alignas](https://en.cppreference.com/w/cpp/keyword/alignas) - [alignof](https://en.cppreference.com/w/cpp/keyword/alignof) - [and](https://en.cppreference.com/w/cpp/keyword/and) - [and_eq](https://en.cppreference.com/w/cpp/keyword/and_eq) - [asm](https://en.cppreference.com/w/cpp/keyword/asm) - [atomic_cancel](https://en.cppreference.com/w/cpp/keyword/atomic_cancel) - [atomic_commit](https://en.cppreference.com/w/cpp/keyword/atomic_commit) - [atomic_noexcept](https://en.cppreference.com/w/cpp/keyword/atomic_noexcept) - [auto](https://en.cppreference.com/w/cpp/keyword/auto) - [bitand](https://en.cppreference.com/w/cpp/keyword/bitand) - [bitor](https://en.cppreference.com/w/cpp/keyword/bitor) - [bool](https://en.cppreference.com/w/cpp/keyword/bool) - [break](https://en.cppreference.com/w/cpp/keyword/break) - [case](https://en.cppreference.com/w/cpp/keyword/case) - [catch](https://en.cppreference.com/w/cpp/keyword/catch) - [char](https://en.cppreference.com/w/cpp/keyword/char) - [char8_t](https://en.cppreference.com/w/cpp/keyword/char8_t) - [char16_t](https://en.cppreference.com/w/cpp/keyword/char16_t) - [char32_t](https://en.cppreference.com/w/cpp/keyword/char32_t) - [class](https://en.cppreference.com/w/cpp/keyword/class) - [compl](https://en.cppreference.com/w/cpp/keyword/compl) - [concept](https://en.cppreference.com/w/cpp/keyword/concept) - [const](https://en.cppreference.com/w/cpp/keyword/const) - [consteval](https://en.cppreference.com/w/cpp/keyword/consteval) - [constexpr](https://en.cppreference.com/w/cpp/keyword/constexpr) - [constinit](https://en.cppreference.com/w/cpp/keyword/constinit) - [const_cast](https://en.cppreference.com/w/cpp/keyword/const_cast) - [continue](https://en.cppreference.com/w/cpp/keyword/continue) - [co_await](https://en.cppreference.com/w/cpp/keyword/co_await) - [co_return](https://en.cppreference.com/w/cpp/keyword/co_return) - [co_yield](https://en.cppreference.com/w/cpp/keyword/co_yield) - [decltype](https://en.cppreference.com/w/cpp/keyword/decltype) - [default](https://en.cppreference.com/w/cpp/keyword/default) - [delete](https://en.cppreference.com/w/cpp/keyword/delete) - [do](https://en.cppreference.com/w/cpp/keyword/do) - [double](https://en.cppreference.com/w/cpp/keyword/double) - [dynamic_cast](https://en.cppreference.com/w/cpp/keyword/dynamic_cast) - [else](https://en.cppreference.com/w/cpp/keyword/else) - [enum](https://en.cppreference.com/w/cpp/keyword/enum) - [explicit](https://en.cppreference.com/w/cpp/keyword/explicit) - [export](https://en.cppreference.com/w/cpp/keyword/export) - [extern](https://en.cppreference.com/w/cpp/keyword/extern) - [false](https://en.cppreference.com/w/cpp/keyword/false) - [float](https://en.cppreference.com/w/cpp/keyword/float) - [for](https://en.cppreference.com/w/cpp/keyword/for) - [friend](https://en.cppreference.com/w/cpp/keyword/friend) - [goto](https://en.cppreference.com/w/cpp/keyword/goto) - [if](https://en.cppreference.com/w/cpp/keyword/if) - [inline](https://en.cppreference.com/w/cpp/keyword/inline) - [int](https://en.cppreference.com/w/cpp/keyword/int) - [long](https://en.cppreference.com/w/cpp/keyword/long) - [mutable](https://en.cppreference.com/w/cpp/keyword/mutable) - [namespace](https://en.cppreference.com/w/cpp/keyword/namespace) - [new](https://en.cppreference.com/w/cpp/keyword/new) - [noexcept](https://en.cppreference.com/w/cpp/keyword/noexcept) - [not](https://en.cppreference.com/w/cpp/keyword/not) - [not_eq](https://en.cppreference.com/w/cpp/keyword/not_eq) - [nullptr](https://en.cppreference.com/w/cpp/keyword/nullptr) - [operator](https://en.cppreference.com/w/cpp/keyword/operator) - [or](https://en.cppreference.com/w/cpp/keyword/or) - [or_eq](https://en.cppreference.com/w/cpp/keyword/or_eq) - [private](https://en.cppreference.com/w/cpp/keyword/private) - [protected](https://en.cppreference.com/w/cpp/keyword/protected) - [public](https://en.cppreference.com/w/cpp/keyword/public) - [reflexpr](https://en.cppreference.com/w/cpp/keyword/reflexpr) - [register](https://en.cppreference.com/w/cpp/keyword/register) - [reinterpret_cast](https://en.cppreference.com/w/cpp/keyword/reinterpret_cast) - [requires](https://en.cppreference.com/w/cpp/keyword/requires) - [return](https://en.cppreference.com/w/cpp/language/return) - [short](https://en.cppreference.com/w/cpp/keyword/short) - [signed](https://en.cppreference.com/w/cpp/keyword/signed) - [sizeof](https://en.cppreference.com/w/cpp/keyword/sizeof) - [static](https://en.cppreference.com/w/cpp/keyword/static) - [static_assert](https://en.cppreference.com/w/cpp/keyword/static_assert) - [static_cast](https://en.cppreference.com/w/cpp/keyword/static_cast) - [struct](https://en.cppreference.com/w/cpp/keyword/struct) - [switch](https://en.cppreference.com/w/cpp/keyword/switch) - [synchronized](https://en.cppreference.com/w/cpp/keyword/synchronized) - [template](https://en.cppreference.com/w/cpp/keyword/template) - [this](https://en.cppreference.com/w/cpp/keyword/this) - [thread_local](https://en.cppreference.com/w/cpp/keyword/thread_local) - [throw](https://en.cppreference.com/w/cpp/keyword/throw) - [true](https://en.cppreference.com/w/cpp/keyword/true) - [try](https://en.cppreference.com/w/cpp/keyword/try) - [typedef](https://en.cppreference.com/w/cpp/keyword/typedef) - [typeid](https://en.cppreference.com/w/cpp/keyword/typeid) - [typename](https://en.cppreference.com/w/cpp/keyword/typename) - [union](https://en.cppreference.com/w/cpp/keyword/union) - [unsigned](https://en.cppreference.com/w/cpp/keyword/unsigned) - [using](https://en.cppreference.com/w/cpp/keyword/using) - [virtual](https://en.cppreference.com/w/cpp/keyword/virtual) - [void](https://en.cppreference.com/w/cpp/keyword/void) - [volatile](https://en.cppreference.com/w/cpp/keyword/volatile) - [wchar_t](https://en.cppreference.com/w/cpp/keyword/wchar_t) - [while](https://en.cppreference.com/w/cpp/keyword/while) - [xor](https://en.cppreference.com/w/cpp/keyword/xor) - [xor_eq](https://en.cppreference.com/w/cpp/keyword/xor_eq) - [final](https://en.cppreference.com/w/cpp/language/final) - [override](https://en.cppreference.com/w/cpp/language/override) - [transaction_safe](https://en.cppreference.com/w/cpp/language/transactional_memory) - [transaction_safe_dynamic](https://en.cppreference.com/w/cpp/language/transactional_memory) {.marker-none .cols-5} ### Preprocessor - [if](https://en.cppreference.com/w/cpp/preprocessor/conditional) - [elif](https://en.cppreference.com/w/cpp/preprocessor/conditional) - [else](https://en.cppreference.com/w/cpp/preprocessor/conditional) - [endif](https://en.cppreference.com/w/cpp/preprocessor/conditional) - [ifdef](https://en.cppreference.com/w/cpp/preprocessor/conditional) - [ifndef](https://en.cppreference.com/w/cpp/preprocessor/conditional) - [define](https://en.cppreference.com/w/cpp/preprocessor/replace) - [undef](https://en.cppreference.com/w/cpp/preprocessor/replace) - [include](https://en.cppreference.com/w/cpp/preprocessor/include) - [line](https://en.cppreference.com/w/cpp/preprocessor/line) - [error](https://en.cppreference.com/w/cpp/preprocessor/error) - [pragma](https://en.cppreference.com/w/cpp/preprocessor/impl) - [defined](https://en.cppreference.com/w/cpp/preprocessor/conditional) - [\_\_has_include](https://en.cppreference.com/w/cpp/feature_test) - [\_\_has_cpp_attribute](https://en.cppreference.com/w/cpp/feature_test) - [export](https://en.cppreference.com/w/cpp/keyword/export) - [import](https://en.cppreference.com/mwiki/index.php?title=cpp/keyword/import&action=edit&redlink=1) - [module](https://en.cppreference.com/mwiki/index.php?title=cpp/keyword/module&action=edit&redlink=1) {.marker-none .cols-2} ## Also see - [C++ Infographics & Cheat Sheets](https://hackingcpp.com/cpp/cheat_sheets.html) _(hackingcpp.com)_ - [C++ reference](https://en.cppreference.com/w/) _(cppreference.com)_ - [C++ Language Tutorials](http://www.cplusplus.com/doc/tutorial/) _(cplusplus.com)_ ================================================ FILE: source/_posts/cron.md ================================================ --- title: Cron date: 2020-12-16 18:28:43 background: bg-red-500 tags: - schedule - crontab - time categories: - Linux Command intro: | [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. plugins: - copyCode --- ## Crontab Format {.cols-2} ### Format ``` Min Hour Day Mon Weekday ``` --- ``` * * * * * command to be executed ``` ``` ┬ ┬ ┬ ┬ ┬ │ │ │ │ └─ Day of Week (0=Sun .. 6=Sat) │ │ │ └────── Month (1..12) │ │ └─────────── Day of Month (1..31) │ └──────────────── Hour (0..23) └───────────────────── Minute (0..59) ``` --- | Field | Range | Special characters | | ------------ | ------ | ------------------ | | Minute | 0 - 59 | , - \* / | | Hour | 0 - 23 | , - \* / | | Day of Month | 1 - 31 | , - \* ? / L W | | Month | 1 - 12 | , - \* / | | Day of Week | 0 - 6 | , - \* ? / L # | {.show-header} ### Examples | Example | Description | | -------------- |--------------------------------------------------------------------| | `*/15 * * * *` | Every 15 mins | | `0 * * * *` | Every hour | | `0 */2 * * *` | Every 2 hours | | `15 2 * * *` | At 2:15AM (of every day) | | `15 2 * * ?` | At 2:15AM (of every day) | | `10 9 * * 5` | At 9:10AM (of every Friday) | | `0 0 * * 0` | At 12:00 AM, only on Sunday | | `15 2 * * 1L` | At 2:15am on the last monday of every month | | `15 0 * * 4#2` | At 00:15am on the second thursday of every month | | `0 0 1 * *` | At 12:00 AM, on day 1 of the month (1st of month / monthly) | | `0 0 1 1 *` | At 12:00 AM, on day 1 of the month, only in January (1st of month) | | `@reboot` | Every reboot
_(non-standard)_ | ### Cron Generator {.col-span-3} ### Special strings | Special String | Meaning | | -------------- | ---------------------------------------------------- | | @reboot | Run once, at system startup _(non-standard)_ | | @yearly | Run once every year, "0 0 1 1 \*" _(non-standard)_ | | @annually | (same as @yearly) _(non-standard)_ | | @monthly | Run once every month, "0 0 1 \* \*" _(non-standard)_ | | @weekly | Run once every week, "0 0 \* \* 0" _(non-standard)_ | | @daily | Run once each day, "0 0 \* \* \*" _(non-standard)_ | | @midnight | (same as @daily) _(non-standard)_ | | @hourly | Run once an hour, "0 \* \* \* \*" _(non-standard)_ | ### Crontab command | - | - | | ------------ | ----------------------------------------------------------------------- | | `crontab -e` | Edit or create a crontab file if doesn’t already exist. | | `crontab -l` | Display the crontab file. | | `crontab -r` | Remove the crontab file. | | `crontab -v` | Display the last time you edited your crontab file.
_(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

Blue, 18-point text

``` ### Add class ```html
``` Support multiple classes on one element. ### !important ```css .post-title { color: blue !important; } ``` Overrides all previous styling rules. ### Selector ```css h1 { } #job-title { } div.hero { } div > p { } ``` See: [Selectors](#css-selectors) ### Text color ```css color: #2a2aff; color: green; color: rgb(34, 12, 64, 0.6); color: hsla(30 100% 50% / 0.6); ``` See: [Colors](#css-colors) ### Background ```css background-color: blue; background-image: url('nyan-cat.gif'); background-image: url('../image.png'); ``` See: [Backgrounds](#css-backgrounds) ### Font ```css .page-title { font-weight: bold; font-size: 30px; font-family: 'Courier New'; } ``` See: [Fonts](#css-fonts) ### Position ```css .box { position: relative; top: 20px; left: 20px; } ``` See also: [Position](https://learn-the-web.algonquindesign.ca/topics/css-layout-cheat-sheet/) ### Animation ```css animation: 300ms linear 0s infinite; animation: bounce 300ms linear infinite; ``` See: [Animation](#css-animation) ### Comment ```css /* This is a single line comment */ /* This is a multi-line comment */ ``` ### Flex layout ```css div { display: flex; justify-content: center; } div { display: flex; justify-content: flex-start; } ``` See: [Flexbox](#css-flexbox) | [Flex Tricks](#css-flexbox-tricks) ### Grid layout ```css #container { display: grid; grid: repeat(2, 60px) / auto-flow 80px; } #container > div { background-color: #8ca0ff; width: 50px; height: 50px; } ``` See: [Grid Layout](#css-grid-layout) ### Variable & Counter ```css counter-set: subsection; counter-increment: subsection; counter-reset: subsection 0; :root { --bg-color: brown; } element { background-color: var(--bg-color); } ``` See: [Dynamic content](#css-dynamic-content) ## CSS Selectors ### Examples {.row-span-2} #### Groups Selector ```css h1, h2 { color: red; } ``` #### Chaining Selector ```css h3.section-heading { color: blue; } ``` #### Attribute Selector ```css div[attribute='SomeValue'] { background-color: red; } ``` #### First Child Selector ```css p:first-child { font-weight: bold; } ``` #### No Children Selector ```css .box:empty { background: lime; height: 80px; width: 80px; } ``` ### Basic | | | | ------------ | --------------------------- | | `*` | All elements | | `div` | All div tags | | `.classname` | All elements with class | | `#idname` | Element with ID | | `div,p` | All divs and paragraphs | | `#idname *` | All elements inside #idname | See also: [Type](https://developer.mozilla.org/en-US/docs/Web/CSS/Type_selectors) / [Class](https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors) / [ID](https://developer.mozilla.org/en-US/docs/Web/CSS/ID_selectors) / [Universal](https://developer.mozilla.org/en-US/docs/Web/CSS/Universal_selectors) selectors ### Combinators | Selector | Description | | --------------- | ------------------------------------- | | `div.classname` | Div with certain classname | | `div#idname` | Div with certain ID | | `div p` | Paragraphs inside divs | | `div > p` | All p tags
_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 target attribute | | `a[target="_blank"]` | Open in new tab | | `a[href^="/index"]` | Starts with /index | | `[class | ="chair"]` | Starts with chair | | `[class*="chair"]` | containing chair | | `[title~="chair"]` | Contains the word chair | | `a[href$=".doc"]` | Ends with .doc | | `[type="button"]` | Specified type | See also: [Attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) ### User action pseudo classes | | | | ------------ | ----------------------- | | `a:link ` | Link in normal state | | `a:active ` | Link in clicked state | | `a:hover ` | Link with mouse over it | | `a:visited ` | Visited link | ### Pseudo classes | | | | ----------------- | --------------------------------------------------------------------------------------- | | `p::after` | Add content after p | | `p::before` | Add content before p | | `p::first-letter` | First letter in p | | `p::first-line` | First line in p | | `::selection` | Selected by user | | `::placeholder` | [Placeholder](https://developer.mozilla.org/en-US/docs/Web/CSS/::placeholder) attribute | | `:root` | Documents root element | | `:target` | Highlight active anchor | | `div:empty` | Element with no children | | `p:lang(en)` | P with en language attribute | | `:not(span)` | Element that's not a span | ### Input pseudo classes | | | | --------------------- | ------------------------------------------------------------------------------------------- | | `input:checked` | Checked inputs | | `input:disabled` | Disabled inputs | | `input:enabled` | Enabled inputs | | `input:focus` | Input has focus | | `input:in-range` | Value in range | | `input:out-of-range` | Input value out of range | | `input:valid` | Input with valid value | | `input:invalid` | Input with invalid value | | `input:optional` | No required attribute | | `input:required` | Input with required attribute | | `input:read-only` | With readonly attribute | | `input:read-write` | No readonly attribute | | `input:indeterminate` | With [indeterminate](https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate) state | ### Structural pseudo classes | | | | ----------------------- | -------------------------- | | `p:first-child` | First child | | `p:last-child` | Last child | | `p:first-of-type` | First of some type | | `p:last-of-type` | Last of some type | | `p:nth-child(2)` | Second child of its parent | | `p:nth-child(3n42)` | Nth-child (an + b) formula | | `p:nth-last-child(2)` | Second child from behind | | `p:nth-of-type(2)` | Second p of its parent | | `p:nth-last-of-type(2)` | ...from behind | | `p:only-of-type` | Unique of its parent | | `p:only-child` | Only child of its parent | ## CSS Fonts ### Properties {.row-span-3} | Property | Description | | ----------------- | --------------- | | `font-family:` | \ | | `font-size:` | \ | | `letter-spacing:` | \ | | `line-height:` | \ | | `font-weight:` | \ / bold / normal | | `font-style:` | italic / normal | | `text-decoration:` | underline / none | | `text-align:` | left / right
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:` | \ | | `animation-duration:` | \