Skip to content

Instantly share code, notes, and snippets.

View rizkhal's full-sized avatar
🌴
On vacation

Rizkhal rizkhal

🌴
On vacation
View GitHub Profile
@rizkhal
rizkhal / fetch-api-examples.md
Created May 31, 2019 19:06 — forked from justsml/fetch-api-examples.md
JavaScript Fetch API Examples
@rizkhal
rizkhal / GitCommitEmoji.md
Created July 21, 2020 20:07 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@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

<?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 / 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

@rizkhal
rizkhal / GoogleDriveServiceProvider.php
Created June 26, 2022 13:59 — forked from sergomet/GoogleDriveServiceProvider.php
Setup a Laravel Storage driver with Google Drive API
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class GoogleDriveServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.