Skip to content

Instantly share code, notes, and snippets.

View batFormat's full-sized avatar
🏠
Working from home

Maxim Kot batFormat

🏠
Working from home
View GitHub Profile
@nathandaly
nathandaly / BaseResource.php
Last active May 15, 2024 20:19
Tenancy for Laravel & Filament V3 (Tenant per database)
<?php
/**
* Below is an the extended Filament resource your tenant panel resources
* will have to extend so that the queries are scoped properly.
*/
namespace App\Filament;
use Filament\Resources\Resource;
@DavyJohnes
DavyJohnes / links.md
Last active September 26, 2023 12:49
Links
@kirumbik
kirumbik / run_tests.sh
Last active February 12, 2024 07:27
Check tests for Route 365 contest
#!/bin/bash
COLOR_BLACK=0
COLOR_RED=1
COLOR_GREEN=2
COLOR_YELLOW=3
COLOR_GREY=8
reset_color="$(tput sgr0)"
@batFormat
batFormat / _slug_now_work.vue
Last active May 8, 2019 12:03
Dynamic Component Injection
<template>
<div class="container">
<h1 class="text-2xl">{{ page.meta_h1 }}</h1>
<component
:is="component.name"
v-for="(component, i) in components"
:key="i"
v-bind="component.props"
/>
</div>
@mattcdavis1
mattcdavis1 / GoogleDocsReplaceAllFail.php
Last active February 17, 2021 01:48
Google Docs Replace Fails
<?php
namespace App\Console\Commands\Google;
use Google_Client;
use Google_Http_Batch;
use Google_Service_Docs_BatchUpdateDocumentRequest;
use Google_Service_Docs_ReplaceAllTextRequest;
use Google_Service_Docs_SubstringMatchCriteria;
use Google_Service_Docs;
@igogrek
igogrek / Cookbook.md
Last active April 27, 2024 03:58
Cookbook

This cookbook is similar to Vue cookbook but contains our custom recipes for some specific cases.

Form validation

For form validation we use Vuelidate

export default Vue.extend({
  ...
 validations: {
@igogrek
igogrek / Vue code style.md
Last active April 11, 2021 06:58
Code style and application structure

Application structure

General

  1. Application has tree structure with folders for each "feature"
  2. Feature folders are named with lowerCamelCase → myComponentDashboard
  3. Feature can contain any number of components and nested features
  4. Components are named using UpperCamelCase → MyWidgetComponent.vue
  5. Component can have translation .yml file named correspondingly → MyWidgetComponent.yml
  6. If component requires more than 2 files: .vue and .yml file - folder is created with the same name → MyWidgetComponent
@timacdonald
timacdonald / ContactIndexResponse.php
Last active February 9, 2023 21:48
Easily respond to content types and url extensions
<?php
namespace App\Http\Responses;
use App\Models\ContactType;
use App\Factories\CsvFactory;
class ContactIndexResponse extends Response
{
public function __construct($contacts)
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active May 26, 2024 07:54
crack activate Office on mac with license file
@behroozam
behroozam / gist:54ffd583f10c453f92354eae5b5e4b6b
Created April 8, 2018 07:52
php deoplyer for deploy docker-compose laravel project in test and production server
<?php
namespace Deployer;
require 'recipe/common.php';
const PRODUCTION_ENV = 'production';
const TEST_ENV = 'test';
// Project name
set('application', 'my_project');