1/124
Flashcards covering basic, intermediate, and advanced concepts in GitHub, PHP, and HTML
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Git
A distributed version control system for tracking changes in code.
GitHub
A cloud-based hosting service for Git repositories that adds collaboration features (PRs, issues, Actions).
git clone <repo-url>
Command to clone a repository from GitHub.
git fetch
Downloads changes from a remote repository but doesn’t merge them into the current branch.
git pull
Downloads changes from a remote repository and merges them into the current branch in one step.
Git Branch
An independent line of development within a Git repository.
Resolving a Merge Conflict (Git)
Open the conflicted file, edit manually to choose desired changes, then git add
the file and git commit
.
git reset
Moves the branch pointer to a specified commit, potentially discarding subsequent history.
git revert
Creates a new commit that undoes the changes introduced by a previous commit, preserving history.
GitHub Fork
A copy of a repository under your GitHub account, allowing independent development.
Git Clone
A local copy of a repository on your machine, including all its files and history.
git log
Command used to check the commit history of a Git repository.
.gitignore
A file listing untracked files and directories that Git should ignore (e.g., logs, node_modules).
Pull Request (PR)
A request to merge code changes from one branch into another branch of a repository.
git merge
Combines the history of two branches by creating a new merge commit.
git rebase
Applies commits from one branch on top of another branch, creating a linear history.
Squashing Commits (Git)
Using git rebase -i HEAD~n
and marking commits as squash to combine multiple commits into a single one.
GitHub Actions
A CI/CD (Continuous Integration/Continuous Deployment) service for automating workflows like testing and deployment directly within GitHub.
Contributing to Open-Source (GitHub)
The process involves: Fork → Clone → Create branch → Commit → Push → Open PR.
Rolling back a commit while keeping history (Git)
Use the git revert
command.
Git Tags
Used to mark specific points in the repository's history, typically for releases (e.g., v1.0.0).
git diff commit1 commit2
Command to see the differences between two specific commits.
git stash
Temporarily saves changes that are not ready to be committed, allowing you to switch branches or work on something else. Use git stash save "msg"
and apply with git stash pop
.
GitHub Projects
A project management tool integrated with GitHub repositories for organizing and tracking work.
Branch Protection Rules (GitHub)
Configured in repository settings → Branches → Protection rules to enforce certain workflows (e.g., requiring reviews).
Managing Secrets in GitHub Actions
Secrets are stored in repository settings → Secrets and accessed in workflows via secrets.NAME
.
Handling Large Files in GitHub
Use Git LFS (Large File Storage) for tracking large files efficiently.
Enforcing Code Quality (GitHub)
Achieved using linters, GitHub Actions checks, and required status checks.
Bare Git Repository
A repository that does not have a working directory, typically used for remote hosting (e.g., on a server).
Non-bare Git Repository
A repository that includes a working directory, visible and modifiable files, used for local development.
Git Submodule
A repository embedded inside another repository as a sub-directory.
GitFlow Branching Strategy
A branching model using master
for releases, develop
for integration, and feature
/hotfix
branches for specific work.
Signing Git Commits
Done using GPG keys with the git commit -S
command to verify authenticity.
Deleting a Git Branch (Local)
Use git branch -d branch-name
.
Deleting a Git Branch (Remote)
Use git push origin --delete branch-name
.
git cherry-pick
Applies a specific commit from one branch onto another branch.
Handling Monorepos in GitHub
Use GitHub Actions with path filters, separate directories, and submodules if needed to manage large repositories containing multiple projects.
PHP
A server-side scripting language mainly used for web development.
echo (PHP)
Outputs strings, generally faster, and has no return value.
print (PHP)
Outputs strings, returns 1, and can be used in expressions.
== (PHP)
Compares values for equality, performing type juggling if necessary.
=== (PHP)
Compares values and types for strict equality, no type juggling.
Handling POST data (PHP)
Access submitted data using $_POST['fieldname']
.
PHP Sessions
Server-side storage for user-specific data that persists across multiple requests.
require (PHP)
Includes a file; if the file is missing, it throws a fatal error and stops script execution.
include (PHP)
Includes a file; if the file is missing, it throws a warning but continues script execution.
PHP Default Session Storage
Server temporary files.
Checking Variable Type (PHP)
Use gettype()
or var_dump()
functions.
PHP Superglobals
Built-in arrays that are always available in all scopes, such as $_GET
, $_POST
, $_SESSION
.
PHP Code in HTML
Started using the <?php ... ?>
tags.
PDO (PHP)
PHP Data Objects, a database abstraction layer providing a consistent interface for accessing databases.
Preventing SQL Injection (PHP)
Use prepared statements with PDO or MySQLi.
PHP Traits
A mechanism for code reuse in multiple independent classes within single inheritance languages.
Handling File Uploads (PHP)
Use the $_FILES
superglobal with move_uploaded_file()
function.
PHP Namespaces
A way to group related classes, interfaces, functions, and constants to prevent naming conflicts.
GET request (PHP)
Appends data in the URL (query string), suitable for non-sensitive data and idempotent requests.
POST request (PHP)
Sends data in the request body, suitable for sensitive data or data that changes server state.
Connecting to a database (PHP PDO)
Example: $pdo = new PDO("mysql:host=localhost;dbname=test", "user", "pass");
.
PHP Magic Methods
Predefined methods in PHP classes that start with __
(double underscore), such as __construct
, __destruct
, __get
.
Error Handling (PHP)
Use try...catch
blocks for exceptions, error_reporting()
to control error levels, and custom error handlers.
isset() (PHP)
Checks if a variable exists and is not NULL
.
empty() (PHP)
Checks if a variable is considered "empty" (e.g., ""
, 0
, 0.0
, "0"
, NULL
, FALSE
, array()
).
Dependency Injection (PHP)
A design pattern where dependencies are passed into an object (usually via its constructor or setter methods) rather than being created inside the object.
PHP Garbage Collection
Cleans up cyclic references using a reference counting mechanism.
Composer (PHP)
A dependency manager for PHP, used to declare and install libraries your project depends on.
Securing PHP Applications
Key practices include validating input, escaping output, using prepared statements, and implementing CSRF tokens.
JWT Authentication (PHP)
Encode user data into a token on login, and verify the token's signature on subsequent requests.
Synchronous PHP
Normal PHP execution where operations block until completed.
Asynchronous PHP
PHP execution where operations can run in the background without blocking the main thread (possible with libraries like ReactPHP, Swoole).
PHP Performance Optimization
Methods include opcode caching (OPcache), using PHP-FPM, database indexing, and caching layers (e.g., Redis, Memcached).
REST API (PHP context)
Typically uses JSON over HTTP, lightweight, and uses standard HTTP methods.
SOAP API (PHP context)
XML-based, utilizes strict contracts (WSDL), and often involves more overhead.
PSR (PHP)
PHP Standards Recommendations, a set of coding standards and guidelines developed by the PHP Framework Interop Group (PHP-FIG).
Password Hashing (PHP)
Use the built-in functions password_hash()
to hash passwords and password_verify()
to check them.
HTML
HyperText Markup Language, a standard for creating web pages.
XHTML
Extensible HyperText Markup Language, a stricter XML-based version of HTML where all tags must be closed and attributes quoted.
Semantic HTML
Using HTML tags that convey meaning about the content they contain, such as <header>
, <article>
, <footer>
, enhancing accessibility and SEO.
<div> (HTML)
A block-level generic container for content.
<span> (HTML)
An inline generic container for content, typically used for styling small portions of text.
Embedding an Image (HTML)
Use the <img>
tag with src
attribute for the image path and alt
attribute for descriptive text, e.g., <img src="path" alt="desc">
.
Block-level element (HTML)
Takes up the full width available, starts on a new line, and allows width/height/margin/padding (e.g., <div>
).
Inline element (HTML)
Flows with the text content, only takes up as much width as necessary, and does not allow explicit width/height (e.g., <span>
).
Inline-block element (HTML)
Flows with text like an inline element but allows setting width, height, and vertical margins/padding (e.g., <img>
).
<ul> (HTML)
Unordered list, typically rendered with bullet points.
<ol> (HTML)
Ordered list, typically rendered with numbers or letters.
<dl> (HTML)
Description list, used for defining terms and their descriptions.
Creating a Hyperlink (HTML)
Use the <a>
(anchor) tag with the href
attribute pointing to the URL, e.g., <a href="url">link</a>
.
Self-closing tags (HTML)
HTML tags that do not require a separate closing tag because they don't contain content, e.g., <br>
, <hr>
, <img>
.
alt attribute (HTML <img>
)
Provides alternative text for an image, important for accessibility (screen readers) and SEO, displayed if the image fails to load.
<strong> (HTML)
Gives semantic importance to text, indicating stronger emphasis.
<b> (HTML)
Applies bold styling to text without conveying any semantic importance.
<section> (HTML)
Groups related content thematically.
<article> (HTML)
Represents self-contained, independent content that could be distributed and reused independently (e.g., a blog post, news story).
Relative URL
Specifies a path relative to the current page or domain.
Absolute URL
Provides the full, complete path to a resource, including the scheme (e.g., https://
).
<link> (HTML)
Used to link to external resources, typically stylesheets (<link rel="stylesheet" href="style.css">
).
<a> (HTML)
Used to create hyperlinks to other web pages or resources.
<thead> (HTML)
Defines the heading content of a table.
<tbody> (HTML)
Defines the body content of a table.
<tfoot> (HTML)
Defines the footer content of a table.