Common types:
feat - New feature (new functionality)
fix - Bug fix
docs - Documentation changes
style - Code style/formatting changes
refactor - Code refactoring (no new features)
test - Adding or updating tests
chore - Maintenance tasks (build, dependencies, etc.)
feat: Add user authentication system
fix: Resolve memory leak in User class
docs: Update README with installation instructions
style: Fix indentation in user.hpp
refactor: Simplify User constructor
test: Add unit tests for User clas
// plugins/api.ts
export default defineNuxtPlugin((nuxtApp) => {
const api = $fetch.create({
baseURL: 'https://api.example.com',
onRequest({ options }) {
options.headers.set('Authorization', 'Bearer your-token');
},
});
return {
provide: {
api,
},
};
});
Using it in a co
Similarities:
Both tell the build system what to compile
Both specify dependencies between files
Both define compiler flags and linker options
Both handle include directories
Key Differences:
Makefile:
Direct build instructions - you write the exact commands
Platform specific - might not work on different OS
Manual dependency management - you track what depends on what
More control but more work
CMakeLists.txt:
Build system generator - creates Makefiles (or other build files) automatically
Cross
# 3. The Age of Tokens - Stateless and Flexible
While session-based authentication (often using cookies) is robust for many traditional websites, the digital landscape has evolved significantly. We now have:
- [**Single Page Applications (SPAs):**](https://www.quantummetric.com/single-page-application-spa) Web front-ends built with frameworks like React, Angular, Vue.js, which behave more like native applications running in the browser.
- [**Mobile Applications:**](https://cheatsheetseries.owas
Before we jump into the more modern and robust solutions, it's **helpful to understand some of the earlier methods**.
These not only provide historical context but also **highlight the problems that newer technologies aimed to solve**.
We'll start with one of the simplest (and most primitive by today's standards): **HTTP Basic Authentication**.
---
# **Chapter 2: Traditional Roadblocks - Early Authentication Methods**
## **2.1: HTTP Basic Authentication**
Imagine the very early days of the w
☝️ Basically this will answer to the following questions:
- **Who are you?**
- **What can you do?**
At the heart of securing any system, whether it's a website, an application, or even a physical building, lie two fundamental concepts: **Authentication** and **Authorization**. People often use these terms interchangeably, but they mean very different, though related, things. Getting this distinction clear from the outset is crucial.
---
# **Chapter 1: The Fundamentals**
## **1. Authentication
/// 欢迎数据 Model
class WelcomeModel {
/// 图片url
String? image;
/// 标题
String? title;
/// 说明
String? desc;
WelcomeModel({this.image, this.title, this.desc});
WelcomeModel.fromJson(dynamic json) {
image = json["image"];
title = json["title"];
desc = json["desc"];
}
Map<String, dynamic> toJson() {
var map = <String, dynamic>{};
map["image"] = image;
map["title"] = title;
map["desc"] = desc;
return map;
}
}
flutter_native_splash:
background_image_android: "assets/launcher/background.png"
background_image_ios: "assets/launcher/background.png"
android_12:
image: "assets/launcher/android12.png"
icon_background_color: "#324ea1"
# 图片填充样式

import 'package:flutter/material.dart';
import 'package:flutter_application_1/common/index.dart';
import 'package:get/get.dart';
import 'index.dart';
class SplashPage extends GetView<SplashController> {
const SplashPage({super.key});
// 主视图
Widget _buildView() {
return SizedBox.expand(
child: const ImageWidget.img(
AssetsImages.splash1Jpg,
fit: BoxFit.cover, // 等比例缩放,填充整个容器
),
);
}
@override
Widget build(BuildContext conte
import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:af_ui_template/af_ui_template.dart';
import 'package:flutter/material.dart';
import 'package:flutter_application_1/common/index.dart';
import 'package:get/get_navigation/get_navigation.dart';
import 'global.dart';
void main() async {
await Global.init();
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
/**
* @param {number[]} nums - Array containing 3n integers
* @return {number} - Minimum difference between two parts after removing n elements
*/
var minimumDifference = function(nums) {
const n = nums.length / 3;
// Max heap for prefix sums (we want the smallest n elements for left side)
let maxHeap = [];
let leftSum = 0;
const leftDiff = new Array(n + 1);
// Initialize max heap and compute initial leftSum from first n elements
for (let i = 0; i < n; i++) {
https://fontdrop.info/
# снёс базу
bin/console aramuz:vitess:drop-schema --force
bin/console aramuz:vitess:init-schema
# накатил миграции
bin/console doctrine:migration:migrate --no-interaction
# обновил схему
bin/console aramuz:vitess:update-schema
# накати фикстуры
bin/console doctrine:fixture:load --no-interaction
add_action('woocommerce_order_status_completed', 'schedule_coupon_after_purchase');
function schedule_coupon_after_purchase($order_id)
{
$order = wc_get_order($order_id);
$user_email = $order->get_billing_email();
create_coupon_and_send_email($user_email);
}
add_action('create_delayed_coupon', 'create_coupon_and_send_email');
function create_coupon_and_send_email($user_email)
{
$coupon_code = 'thankyou-' . wp_generate_password(6, false); // generate unique code
$coupon
{% comment %}
Renders product-badges for product and card product
Accepts:
- product: {Object} product object.
- is_card: {Boolean} default false
Usage:
{%- render 'product-badges', product: product -%}
{% endcomment %}
{%- liquid
assign has_tags = false
assign wrapper_class = 'product__sticker'
assign badge_size = 'badge--lg'
if is_card == true
assign wrapper_class = 'card__badge'
assign badge_size = 'badge--md'
endif
if product.availabl