Skip to content

Instantly share code, notes, and snippets.

View vhood's full-sized avatar

Viktor Khramov vhood

View GitHub Profile
.DEFAULT_GOAL := help
help:
@make --help
# git
remove-branches:
git fetch -p; LANG=en_US git branch -v | grep "\[gone\]" | cut -d ' ' -f3 | xargs git branch -d
@vhood
vhood / 1.README.md
Last active May 31, 2023 10:38
Yii2 without SearchModel example

Yii2 without SearchModel

This is an architecture example how to create Yii2 a typical page with widgets and a DataProvider.

Popular solution

An action should handle query params, provide a DataProvider and a SerachModel dependent on those params, and return a page.

A typical solition is creating a SearchModel with properties, validation rules and the search() method

@vhood
vhood / json-api-open-api.yml
Last active April 5, 2024 19:09
JSON:API swagger (OpenAPI) example
openapi: 3.0.3
info:
title: JSON:API
version: 1.1.0
description: |
This is an example of [JSON:API](https://jsonapi.org) specification
according to OpenAPI documentation
paths:
/posts:
get: