Source: Laravel Eloquent Relationship
This file contains hidden or 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 | |
$start = microtime(true); | |
$numbers = array(1, 2, 3, 4, 5); | |
$new_numbers = array_map(function ($num) { | |
return $num * $num; | |
}, $numbers); | |
print_r($new_numbers); |
This file contains hidden or 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
<script> | |
document.onreadystatechange = function () { | |
if (document.readyState === 'complete') { | |
// Init library or something else | |
new Choices('#topicSpeaker', { | |
removeItemButton: true, | |
}); | |
} | |
} | |
</script> |
This file contains hidden or 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 | |
namespace App\Http\Middleware; | |
use Closure; | |
use \Firebase\JWT\JWT; | |
class CheckOauth2Token | |
{ | |
/** |
This file contains hidden or 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 | |
namespace App\Http\Middleware; | |
use Illuminate\Auth\Middleware\Authenticate as Middleware; | |
class Authenticate extends Middleware | |
{ | |
/** | |
* Get the path the user should be redirected to when they are not authenticated. |
This file contains hidden or 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
customers = ["kresna", "satya", "dyah", "nugraha"] | |
# Mengakses semua nama pelanggan? | |
for name in customers: | |
# print() ini dieksekusi di dalam for karena di bawa menjorok ke dalam | |
print(f"Nama pelanggan: {name}") | |
# print di bawah tidak di eksekusi di dalam for | |
print("aku di luar for") |
This file contains hidden or 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
{ | |
"editor.fontSize": 16, | |
"editor.fontFamily": "'Roboto Mono', Consolas, 'Courier New', monospace", | |
"editor.lineHeight": 40, | |
"editor.suggestLineHeight": 20, | |
"git.autofetch": true, | |
"git.enableSmartCommit": true, | |
} |
This file contains hidden or 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
<head> | |
<!-- CSS --> | |
<link rel="preload" href="{{ $styles.RelPermalink }}" as="style" onload="this.onload=null;this.rel='stylesheet'"> | |
<!-- Firefox will load this because of it doesn't support preload yet! --> | |
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen"> | |
</head> |
This file contains hidden or 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
server { | |
listen 80; | |
listen [::]:80; | |
# SSL configuration | |
# | |
# listen 443 ssl default_server; | |
# listen [::]:443 ssl default_server; | |
# | |
# Note: You should disable gzip for SSL traffic. |
This file contains hidden or 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
pm.test("response is ok", function () { | |
pm.response.to.have.status(200); | |
}); | |
// Old postman | |
var jsonData = JSON.parse(responseBody); | |
// New postman | |
var data = pm.response.json(); |