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
alias pas="php artisan serve" | |
alias pcr="php artisan make:controller $* --resource" | |
alias pmm="php artisan make:model $* -m" | |
alias pc="php artisan make:controller $*" | |
alias pm="php artisan make:model $*" | |
alias pp="php artisan make:policy $*" | |
alias ppm="php artisan make:policy $* --model=$*" | |
alias mg="php artisan migrate" | |
alias ms="php artisan migrate $*" | |
alias rl="php artisan route:list" |
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 format_rupiah($uang) | |
{ | |
$nominal = "Rp.".number_format($uang,2,',','.'); | |
return $nominal; | |
} | |
echo format_rupiah(100000); |
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 | |
// NAMED ARGUMENTS | |
// PHP 7 | |
htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); | |
// PHP 8 | |
htmlspecialchars($string, double_encode: 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 | |
// initialization | |
$ch = curl_init(); | |
// set option curl | |
curl_setopt($ch,CURLOPT_URL,"https://ihzarizkyk.space/"); | |
// set option curl | |
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>LocalStorage HTML5 - FWD</title> | |
<script> | |
function save() | |
{ | |
var storage = document.getElementById('inputan').value; | |
localStorage.setItem('Text',storage); | |
} |
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
''' | |
Author : Mochammad Ihza Rizky Karim | |
''' | |
# Polymorphism | |
# simple example using len function | |
print(len("Polymorphism")) | |
print(len([0,1,2,3])) |
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
''' | |
Author : Mochammad Ihza Rizky Karim | |
''' | |
# Magic Methods | |
class OrangTua(): | |
def __init__(self,nama): | |
self.nama = nama | |
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
''' | |
Author : Mochammad Ihza Rizky Karim | |
''' | |
# Overriding Method dan Super | |
class OrangTua(): | |
def perilaku(self): | |
print("ini perilaku Orang Tua") |
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
''' | |
Author : Mochammad Ihza Rizky Karim | |
''' | |
# Overriding Method | |
class OrangTua(): | |
def perilaku(self): | |
print("ini perilaku Orang Tua") |
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
''' | |
Author : Mochammad Ihza Rizky Karim | |
''' | |
# Encapsulation / Enkapsulasi | |
class manusia(): | |
def __init__(self): | |
self.__tinggi = 160 # private | |
def dukur(self): |
NewerOlder