Skip to content

Instantly share code, notes, and snippets.

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

Ashish Shakya ashishakya

🏠
Working from home
  • YoungInnovations
  • Kumaripati
View GitHub Profile
@ashishakya
ashishakya / .env
Last active February 28, 2022 07:29
.env Config structure for cypress
CYPRESS_APP_BASE_URL=""
CYPRESS_APP_EMAIL=""
CYPRESS_APP_PASSWORD=""
@ashishakya
ashishakya / bitbucket-pipelines.yml
Created February 17, 2022 06:12
bitbucket pipline
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.4-fpm-alpine
pipelines:
custom:
Check-Coding-Quality:
@ashishakya
ashishakya / nginx-isolated.conf
Created July 2, 2021 05:45
Nginx server block for isolated deployment
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
@ashishakya
ashishakya / server.conf
Last active June 5, 2021 16:39
Server block for laravel
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
@ashishakya
ashishakya / BaseFilter.php
Last active February 16, 2023 13:04
Filters in Laravel with OOP practices
<?php
namespace App\CriteriaFilters;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
/**
* Class BaseFilter
@ashishakya
ashishakya / symlink npm
Last active March 28, 2022 04:40
biksss
switch user by super_user: sudo su guy_wali
NGINX (https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04)
sudo apt update
sudo apt install nginx
sudo apt-get install php7.4 php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-mbstring php7.4-mcrypt php7.4-zip php7.4-fpm php7.4-xml php7.4-pgsql
sudo apt-get install php8.0 php8.0-cli php8.0-common php8.0-opcache php8.0-mbstring php8.0-mcrypt php8.0-zip php8.0-fpm php8.0-xml php8.0-pgsql php8.0-curl
@ashishakya
ashishakya / hacks.php
Last active March 18, 2021 04:59
Gist from ecommerce site
<?php
if (!$request->ajax() || !$request->wantsJson()) {
abort(404);
}
// -------------------------------------------
Arr::forget($condition, 'status')
@ashishakya
ashishakya / Stats.js
Last active March 4, 2021 05:09
Interacting with service classes in JS
import StatsService from '../Services/StatsService';
export default {
methods: {
async getStats() {
this.stats = await StatsService.stats.index(/* parameters */);
}
}
}
@ashishakya
ashishakya / hosts
Created November 23, 2020 10:34
Nginx server configuration for subdomain
127.0.0.1 jugal.localhost
127.0.0.1 localhost
127.0.1.1 ashishakya-Inspiron-5567
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
@ashishakya
ashishakya / BaseService.php
Created October 12, 2020 04:58
BaseServiceClass
<?php
namespace App\AIMS\Services;
use App\AIMS\Criteria\BaseCriteria;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
use Prettus\Repository\Eloquent\BaseRepository;
use Prettus\Repository\Exceptions\RepositoryException;
use Prettus\Repository\Presenter\FractalPresenter;