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 / 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));
@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()
@chiragparekh
chiragparekh / sublime-text-3-build-3065-license.md
Created December 22, 2015 17:05
Sublime Text 3 (build 3065+) - VALID License

SublimeText3 Valid License without cracking! Just download/install then use this license.

Notice that it may not work on dev builds, but still works on 3083 build!

----- BEGIN LICENSE -----

Andrew Weber
Single User License
EA7E-855605
813A03DD 5E4AD9E6 6C0EEB94 BC99798F
@chiragparekh
chiragparekh / .Xdefaults
Last active September 22, 2015 07:04 — forked from yevgenko/.Xdefaults
URxvt settings with solarized theme
!-------------------------------------------------------------------------------
! Xft settings
!-------------------------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: false
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
@chiragparekh
chiragparekh / angularjs-providers-explained.md
Last active September 9, 2015 14:34 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant