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
FROM php:8.0-apache | |
RUN apt-get update && apt-get install -y \ | |
libmagickwand-dev \ | |
--no-install-recommends \ | |
&& pecl install imagick \ | |
&& docker-php-ext-enable imagick opcache \ | |
&& docker-php-ext-install pdo_mysql \ | |
&& apt-get autoclean -y \ | |
&& rm -rf /var/lib/apt/lists/* |
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
FROM php:8.0-apache | |
RUN apt-get update && apt-get install -y \ | |
libfreetype6-dev \ | |
libjpeg-dev \ | |
libpng-dev \ | |
libwebp-dev \ | |
--no-install-recommends \ | |
&& docker-php-ext-enable opcache \ | |
&& docker-php-ext-configure gd --with-freetype --with-jpeg \ |
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
FROM php:8.0-fpm | |
RUN apt-get update && apt-get install -y \ | |
libmagickwand-dev \ | |
--no-install-recommends \ | |
&& pecl install imagick \ | |
&& docker-php-ext-enable imagick \ | |
&& docker-php-ext-install pdo_mysql |
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
FROM php:8.0-fpm | |
RUN apt-get update && apt-get install -y \ | |
libfreetype6-dev \ | |
libjpeg-dev \ | |
libpng-dev \ | |
libwebp-dev \ | |
--no-install-recommends \ | |
&& docker-php-ext-configure gd --with-freetype --with-jpeg \ | |
&& docker-php-ext-install pdo_mysql -j$(nproc) gd |
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
# Docker aliases | |
alias di='sudo docker images' | |
alias dps='sudo docker ps -a' | |
# useful Docker functions | |
dock-run() { sudo docker run -i -t --privileged $@ ;} | |
dock-exec() { sudo docker exec -i -t $@ /bin/bash ;} | |
dock-log() { sudo docker logs --tail=all -f $@ ;} | |
dock-port() { sudo docker port $@ ;} | |
dock-vol() { sudo docker inspect --format '{{ .Volumes }}' $@ ;} |
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
void main(){ | |
var anuMu="hihihi"; | |
print(terbalik(anuMu)); | |
} | |
String terbalik(anu){ | |
return anu.split('').reversed.join();} | |
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
// Peubah-peubah | |
// Bahkan di dalam kode Dart yang bersifat tipe-aman | |
// Banyak peubah-peubah tidak memerlukan tipe yang tersurat, | |
// Terima-kasih pada penalaran tipe. | |
var name = 'Voyager I'; | |
var year = 1977; | |
var antennaDiameter = 3.7; | |
var flybyObjects = ['Jupiter','Saturn','Uranus','Neptune']; | |
var image = { | |
'tags':['saturn'], |
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
// Hello World | |
// Setiap aplikasi mempunyai fungsi main(). | |
// Untuk menampilkan teks ke konsol, | |
// Anda dapat menggunakan fungsi level-teratas print() | |
void main(){ | |
print('Hello, World!'); | |
} |
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
// Exceptions | |
// Untuk membangkitkan sebuah eksepsi, gunakan throw: | |
if(astonauts == 0){ | |
throw StateError('No astronauts.'); | |
} | |
// Untuk menangkap sebuah eksepsi, gunakan sebuah pernyataan try dengan on atau | |
// catch (atau keduanya) | |
try{ | |
for(var object in flybyObjects){ | |
var description = await File('$object.txt').readAsString(); |
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
// Hindari neraka panggilnanti dan buat kode anda jadi lebih mudah dibaca | |
// dengan menggunakan async dan await | |
const oneSecond = Duration(seconds:1); | |
// ... | |
Future<void> printWithDelay(String message) async{ | |
await Future.delayed(oneSecond); | |
print(message); | |
} | |
// metode di atas sama dengan berikut | |
Future<void> printWithDelay(String message){ |
NewerOlder