Skip to content

Instantly share code, notes, and snippets.

View Oleksandr-Moik's full-sized avatar

Oleksandr Moik Oleksandr-Moik

View GitHub Profile

My collection of shell aliases

Common

alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

alias mkdir='mkdir -p'

Laravel

Run Locally

Clone the project

  git clone <project_url>

PhpStorm, Laravel IDEA plugin, ide.json (v1) configuration file for package jeroennoten/laravel-adminlte. Place in the root of your project. Hints for components and types from a package.

ide.json

{
  "$schema": "http://laravel-ide.com/schema/laravel-ide-v1.json",
  "completion": {
  },
  "view": {
@Oleksandr-Moik
Oleksandr-Moik / postman.md
Created August 24, 2023 19:59
Posman utils

set default header for api requests

write in pre-requrest/prepare

pm.request.addHeader('Accept: application/json')

automaticaly set api token to variables

@Oleksandr-Moik
Oleksandr-Moik / UnitTest.php
Created May 19, 2024 21:53
Extract the YouTube Video ID from a URL in PHP (Larave, test suite on Pest)
<?php
it('extracts video ID from YouTube URLs', function ($url, $expectedId) {
expect(get_youtube_video_id($url))->toBe($expectedId);
})->with([
['https://youtu.be/dQw4w9WgXcQ', 'dQw4w9WgXcQ'],
['https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'dQw4w9WgXcQ'],
['http://youtube.com/v/dQw4w9WgXcQ', 'dQw4w9WgXcQ'],
['https://www.youtube.com/embed/dQw4w9WgXcQ', 'dQw4w9WgXcQ'],
['https://www.youtube.com/shorts/dQw4w9WgXcQ', 'dQw4w9WgXcQ'],