Skip to content

Instantly share code, notes, and snippets.

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

Chirag Parekh chiragparekh

🏠
Working from home
View GitHub Profile
@chiragparekh
chiragparekh / laravel-pint-with-sail-phpstorm.md
Created August 16, 2024 11:59 — forked from WalrusSoup/laravel-pint-with-sail-phpstorm.md
Run laravel pint from Phpstorm with WSL on save

Saving this so I dont forget later.

Run Laravel Pint from Phpstorm with WSL on save with Laravel Sail

  1. create custom file watcher
  2. For tool to Run on Changes add the full path to vendor/bin/sail via WSL like so \\wsl$\Ubuntu\home\ozen\projects-sail\MYPROJECT\vendor\bin\sail
  3. Arguments bin pint $/FileRelativePath$
  4. Output paths to refresh $FilePath$
  5. Working Directory $ProjectFileDir$
@chiragparekh
chiragparekh / Laravel-Pint-PHPStorm-Sail.md
Created July 3, 2023 06:31
Setup Laravel Pint with PHPStorm - Laravel Sail

Setup Image

@chiragparekh
chiragparekh / gist:16b85d1813e603b42b0750d5b6d2d57b
Created June 15, 2022 15:27
Laravel Sail Existing Application Install Without local php composer install with docker
#composer install
docker pull composer/composer
docker run --rm -it -v "$(pwd):/app" composer/composer require laravel/sail --dev
#artisan install
docker pull php
docker container run --rm -v $(pwd):/app/ php php /app/artisan sail:install
@chiragparekh
chiragparekh / DateInput.vue
Created September 18, 2019 18:54 — forked from reinink/DateInput.vue
Pikaday Vue Component
<template>
<div>
<label v-if="label" class="form-label" :for="`date-input-${_uid}`">{{ label }}:</label>
<input v-bind="$attrs" class="form-input" :id="`date-input-${_uid}`" :class="{ error: error }" type="text" ref="input" :value="value" @change="change" @keyup="change">
<div v-if="error" class="form-error">{{ error }}</div>
</div>
</template>
<script>
import pikaday from 'pikaday'
@chiragparekh
chiragparekh / 1-add-middleware.php
Created February 16, 2018 10:10 — forked from adamwathan/1-add-macros.php
Multiformat Endpoints in Laravel
<?php
namespace App\Http\Middleware;
class CaptureRequestExtension
{
public function handle($request, $next)
{
if ($request->route()->parameter('_extension') !== null) {
$request->attributes->set('_extension', substr($request->route()->parameter('_extension'), 1));
NOTE : Following procedure are for windows user.
* Tools needed
- HeidiSQL
- Putty
Steps:
1) Create a new session in session manager and give appropriate name to it
2) In settings tab make changes following:
@chiragparekh
chiragparekh / OpenWithSublimeText3.bat
Created September 8, 2016 08:50 — forked from roundand/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@chiragparekh
chiragparekh / gist:423daa5eedf9ddb0b2b772f4fdc1bd1c
Created June 6, 2016 06:07
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@chiragparekh
chiragparekh / import-variation.php
Created January 26, 2016 12:07 — forked from galalaly/import-variation.php
Create WooCommerce variations with PHP
<?php
// In a class constructor
$this->size_tax = wc_attribute_taxonomy_name( 'Size' );
$this->color_tax = wc_attribute_taxonomy_name( 'Color' );
// Insert the main product first
// It will be used as a parent for other variations (think of it as a container)
$product_id = wp_insert_post( array(
@chiragparekh
chiragparekh / BlogController.php
Created December 26, 2015 13:13 — forked from tobysteward/BlogController.php
Laravel AJAX Pagination with JQuery
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()