Skip to content

Instantly share code, notes, and snippets.

View rizkhal's full-sized avatar
🌴
On vacation

Rizkal rizkhal

🌴
On vacation
View GitHub Profile
<?php
namespace App\Repositories;
interface PostRepositoryInterface {
public function all();
public function take(int $limit);
@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 / avg.php
Last active May 5, 2019 19:30
Simple way to calculate stars ratings like ecomerce
<?php
// our php array for example, if you using data from database, make it
$array = [
252, 124, 40, 29, 1
];
// stars, 1 - 5
$star = [
5, 4, 3, 2, 1
@rizkhal
rizkhal / file.cpp
Created October 8, 2018 12:48
Hitung Luas Persegi Panjang Menggunakan C++
#include "stdio.h"
#include "iostream"
using namespace std;
int main()
{
int luas = 0, panjang = 0, lebar = 0;
printf("%s" "\n", "Calculate the area of ​​a rectangle");
<?php
function setActive($path, $active = 'active'){
return call_user_func_array('Request::is', (array) $path) ? $active : '';
}