Skip to content

Instantly share code, notes, and snippets.

View maldechavda's full-sized avatar
😀

Malde Chavda maldechavda

😀
View GitHub Profile
@maldechavda
maldechavda / PurchaseController.php
Created July 14, 2023 08:28
Verify IOS inapp purchase
?php
namespace App\Http\Controllers\Api;
use App\Enums\PurchaseType;
use App\Http\Requests\PurchaseRequest;
use App\Http\Resources\UserResource;
use App\Models\App;
use App\Models\Subscription;
use App\Models\User;
@maldechavda
maldechavda / bem-and-sass.md
Created April 30, 2019 05:14 — forked from radist2s/bem-and-sass.md
BEM & SASS best practices

BEM & SASS best practices

Every block should be in separated file named as block.

Filename: rating-star.scss

.rating-star {
    $font-size: 0.5em;
    
    display: inline-block; // `display` style may be set freely
@maldechavda
maldechavda / .php_cs
Last active January 3, 2019 05:14
PHP laravel php cs fixer settings
<?php
$finder = PhpCsFixer\Finder::create()
->name('*.php')
->in(__DIR__ . DIRECTORY_SEPARATOR . 'app')
->in(__DIR__ . DIRECTORY_SEPARATOR . 'tests');
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
@maldechavda
maldechavda / .bash_profile
Last active February 21, 2020 10:21
Macbook bash_profile
export PATH="$PATH:$HOME/.composer/vendor/bin"
export PATH="$HOME/.npm-packages/bin:$PATH"
export PATH=/Users/Shared/DBngin/mysql/5.7.23/bin:$PATH
function pushme {
br=`git branch | grep "*"`
git add --all
if (($# > 1)); then
@maldechavda
maldechavda / Cors.php
Created July 14, 2018 06:58 — forked from drewjoh/Cors.php
Laravel CORS Middleware
<?php // /app/Http/Middleware/Cors.php
namespace App\Http\Middleware;
use Closure;
class Cors {
public function handle($request, Closure $next)
{
return $next($request)
@maldechavda
maldechavda / multiple_ssh_setting.md
Created March 27, 2018 10:10 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@maldechavda
maldechavda / AddAvatarTest.php
Created February 19, 2018 12:30
Laravel File Upload test
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use Illuminate\Foundation\Testing\RefreshDatabase;
class AddAvatarTest extends TestCase
@maldechavda
maldechavda / php7.2.sh
Created December 2, 2017 09:29
Install php7.2 over php7.1 in laravel server
#!/bin/bash
sudo apt-get install -y php7.2 php7.2-cli php7.2-dev \
php7.2-pgsql php7.2-sqlite3 php7.2-gd \
php7.2-curl php7.2-memcached \
php7.2-imap php7.2-mysql php7.2-mbstring \
php7.2-xml php7.2-zip php7.2-bcmath php7.2-soap \
php7.2-intl php7.2-readline
@maldechavda
maldechavda / ForceHttps.php
Created July 6, 2017 11:29
Laravel force redirect to https using Middleware
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\RedirectResponse;
class ForceHttps
{
/**
@maldechavda
maldechavda / README.md
Created March 24, 2017 09:41 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/