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 / 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;
<?php
namespace App\Http\Livewire\Stats;
use Illuminate\Support\Facades\DB;
use Livewire\Component;
class DistanceByYear extends Component
{
public $chartId;
// this is for understanding reduce, counter qty when same item
const serverData = [
{
code: 1,
item: "ball",
salesman: "Braan",
quantity: 5,
price: 10.0,
},
@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

@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 / GitCommitEmoji.md
Created July 21, 2020 20:07 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
<?php
echo "Input number: \n";
while ($input = trim(fgets(STDIN))) {
$args[] = $input;
if ($input == "=") {
print(array_sum($args));
break;
}
}
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
@extends('layouts.master')
@push('heading')
@component('components.heading')
All Posts
@endcomponent
@endpush
@push('button')
@component('components.button')
@extends('layouts.master')
@push('heading')
@component('components.heading')
Edit Post
@endcomponent
@endpush
@push('button')
@component('components.button')