This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "../manifest"; | |
// import '../node_modules/materialize-css/dist/css/materialize.min.css'; | |
import "./nav"; | |
import "./register-sw"; | |
import home from "./home"; | |
import "./article"; | |
import "./db"; | |
document.addEventListener("DOMContentLoaded", home); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dan begini lah penampakan variabel timezone di .env | |
APP_NAME=Laravel | |
APP_ENV=local | |
APP_KEY= | |
APP_DEBUG=true | |
APP_URL=http://localhost | |
APP_TIMEZONE="Asia/Jakarta" | |
// ketika sc dibuka di komputer lain tinggal setting di .env jika timezone disetting menggunakan .env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// routes/web.php | |
// 1. Menulis Alamat Controller ketika Pendefinisian | |
// Contohnya: | |
Route::get('/user',[App\Http\Controllers\User\UserController::class, 'index']); | |
// 2. Menggunakan use | |
// Contohnya: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="header"> | |
<h3>Example of floatable</h3> | |
</div> | |
<div class="card floatable"> | |
<h4> | |
Hover me! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reverseString(str) { | |
return str.split('').reverse().join(''); | |
} | |
console.log(reverseString('ya ndak tau')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function factorial($n) { | |
return ($n == 1 ? $n : $n * factorial($n - 1)); | |
} | |
echo factorial(6); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function threeSummableToZero($arr) { | |
for($i = 0; $i < count($arr); $i++) { | |
for($j = 0; $j < count($arr); $j++) { | |
for($k = 0; $k < count($arr); $k++) { | |
if($i == $j || $j == $k || $i == $k) continue; | |
if($arr[$i] + $arr[$j] + $arr[$k] == 0) return "[".$arr[$i].", ".$arr[$j].", ".$arr[$k]."]"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function isPalindrome($string) { | |
for($i = 0, $j = strlen($string) - 1; $i < strlen($string) / 2; $i++, $j--) { | |
if($string[$i] != $string[$j]) { | |
return 'false'; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fizzBuzz($total) { | |
for($i = 1; $i <= $total; $i++) { | |
if($i % 3 == 0 && $i % 5 == 0) { | |
$result .= "Fizz Buzz\n"; | |
} | |
elseif($i % 3 == 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getPrimeNumbers($total) { | |
// 1 is impossible to be the prime number. 2 is the first prime number. | |
// the law is prime number cannot be divided by other prime number. | |
// so our logic here is to try to divide the number that we want to check | |
// with prime number that is previously identified. | |
$result = [2]; | |
for($i = 2; $i <= $total; $i++) { |
OlderNewer