Skip to content

Instantly share code, notes, and snippets.

View rizkhal's full-sized avatar
🌴
On vacation

Rizkal rizkhal

🌴
On vacation
View GitHub Profile
@rizkhal
rizkhal / CustomPaginate.php
Created December 2, 2020 13:00
Laravel custom paginate, you can make paginate using Builder or array
<?php
namespace App\Utils;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Collection;
class CustomPaginate
{
@rizkhal
rizkhal / nginxproxy.md
Created December 7, 2020 19:33 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

// this is for understanding reduce, counter qty when same item
const serverData = [
{
code: 1,
item: "ball",
salesman: "Braan",
quantity: 5,
price: 10.0,
},
<?php
namespace App\Http\Livewire\Stats;
use Illuminate\Support\Facades\DB;
use Livewire\Component;
class DistanceByYear extends Component
{
public $chartId;
@rizkhal
rizkhal / laravel-livewire-tables-demo-table.php
Created August 17, 2021 02:54 — forked from rappasoft/laravel-livewire-tables-demo-table.php
Laravel Livewire Tables Demo Table Source
<?php
namespace App\Http\Livewire;
use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
use Rappasoft\LaravelLivewireTables\DataTableComponent;
use Rappasoft\LaravelLivewireTables\Views\Column;
use Rappasoft\LaravelLivewireTables\Views\Filter;
<x-layout>
<x-section>
<x-tabs active="First">
<x-tab name="First">
First content goes here.
</x-tab>
<x-tab name="Second">
Second content goes here.
</x-tab>
@rizkhal
rizkhal / centos7-nginx-laravel-configuration
Created November 3, 2021 02:05 — forked from breekoy/centos7-nginx-laravel-configuration
Configuration steps on CentOS7 server to run Laravel applications + Redis and Node.JS on nginx
==== CENTOS 7 LEMP STACK INSTALLATION ====
0. Make sure the centos 7 server have internet connection
1. Install the EPEL Repository
sudo yum -y install epel-release
2. Install the Remi Repository
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
3. Install Nginx
@rizkhal
rizkhal / config.conf
Created February 12, 2022 09:31
Nuxt or Vue Nginx Configuration Reverse Proxy
server {
listen 80;
listen 443 ssl;
server_name domainname.com;
gzip on;
gzip_types text/plain application/xml;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
@rizkhal
rizkhal / ConsoleSchedulingTest.php
Created March 14, 2022 13:37 — forked from MattApril/ConsoleSchedulingTest.php
A simple way of testing that your Laravel commands are scheduled exactly when and how you expect. This approach does not trigger commands to actually execute, which is what a lot of other suggestions do.
<?php
use App\Console\Kernel;
use Carbon\Carbon;
use Illuminate\Console\Scheduling\Event;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\Collection;
class ConsoleSchedulingTest extends TestCase
{

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example