View bagaimana_melakukan_print_console_pada_pytest.sh
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
# gunakan saat pytest error | |
pytest --capture=sys | |
# gunakan saat pytest success | |
pytest -s |
View gist:787fbf04c8bdf7d98b47933c9d4033b3
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
git rm -r --cached . |
View Selection_Sort_dng_Python_1.py
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
def selection_sort(mylist): | |
# i indicates how many items were sorted | |
for i in range(len(mylist)-1): | |
# To find the minimum value of the unsorted segment | |
# we first assume that the first element is the lowest | |
min_index = i | |
# We then use j to loop through the remaining elements | |
dex = 0 | |
for j in range(i+1, len(mylist)): | |
if mylist[j] < mylist[min_index]: |
View fungsi_php_range_2.php
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 | |
//...dengan menggunakan step akan menghasilkan kelipatan 10 | |
//...yang dimulai dari 0 dan diakhiri di nilai 100 | |
//...array(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100) | |
foreach (range(0, 100, 10) as $number) { | |
echo $number; | |
} |
View fungsi_php_range_1.php
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 | |
//...array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) | |
foreach (range(0, 12) as $number) { | |
echo $number; | |
} |
View menghubungkan_php_dng_mysql_2.php
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 | |
//...kosongkan parameter password bila tidak ada password | |
$conn = mysql_connect("localhost", "root", ""); | |
//...bila koneksi gagal | |
if(!$conn) { | |
die("koneksi gagal, periksa lagi parameter."); | |
} | |
//...mysql_error() untuk menampilkan pesan error |
View menghubungkan_php_dng_mysql_1.php
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 | |
//...kosongkan parameter password bila tidak ada password | |
$conn = mysql_connect("localhost", "root", ""); | |
//...bila koneksi gagal | |
if(!$conn) { | |
die("koneksi gagal, periksa lagi parameter."); | |
} else { | |
echo "koneksi berhasil."; | |
} |
NewerOlder