commits

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

Nuxt own fetch plugin

// 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

Makefile or CMakelists for a Backend C++ project

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️⃣ Authentication & Authorization - Token-Based Authentication Methods

# 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

🔐2️⃣ Authentication & Authorization - Early Authentication Methods

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

🔐1️⃣ Authentication & Authorization - Fundamentals

☝️ 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 

欢迎屏

1.安装插件 flutter pub add carousel_slider 2.配置i18n 3.创建model类 4.创建组件 5.welcome pgae的开发 6.splash跳转到welcome
/// 欢迎数据 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;
  }
}

native 启动图

# 由于安卓12有强制规范,所以需要灵活的配置各个版本的启动图 参考 https://pub.dev/packages/flutter_native_splash https://pub.dev/packages/flutter_native_splash#android-12-support https://developer.android.com/about/versions/12/features/splash-screen # 安装插件 flutter pub add flutter_native_splash -d # 生成启动图 dart run flutter_native_splash:create # 删除启动图 dart run flutter_native_splash:remove ```yaml 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" ```
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"

样式总结


# 图片填充样式
![](https://cdn.cacher.io/attachments/u/3p5uxhfad6s5u/pFPSoFFZEFa3oRTF3_VrTO5jIYG3WTRw/kxcxnvb6h.png)

splash启动屏

1.导入图片 2.view中使用 ![](https://cdn.cacher.io/attachments/u/3p5uxhfad6s5u/mYqbLpvr8ITzMt7dVF3zmKHtB4DLEUMt/wd5bltjlf.png)
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

屏幕适配screenuntill

![](https://cdn.cacher.io/attachments/u/3p5uxhfad6s5u/GIRocGrztOGzcJS8RQdjXvSnx86BOP79/w5dpw82d6.png)
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

2163. Minimum Difference in Sums After Removal of Elements

You are given a 0-indexed integer array nums consisting of 3 * n elements. You are allowed to remove any subsequence of elements of size exactly n from nums. The remaining 2 * n elements will be divided into two equal parts: The first n elements belonging to the first part and their sum is sumfirst. The next n elements belonging to the second part and their sum is sumsecond. The difference in sums of the two parts is denoted as sumfirst - sumsecond. For example, if sumfirst = 3 and sumsecond = 2, their difference is 1. Similarly, if sumfirst = 2 and sumsecond = 3, their difference is -1. Return the minimum difference possible between the sums of the two parts after the removal of n elements.
/**
 * @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++) {
   

View font file information

https://fontdrop.info/

commands


# снёс базу
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

send coupon mailchimp



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

Liquid - Badges for product and card-product

{% 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