Skip to content

Instantly share code, notes, and snippets.

@aabeben
aabeben / Dockerfile
Created March 31, 2022 05:03 — forked from ChewySalmon/Dockerfile
Laravel development Docker setup using PHP 8+, Apache, MySql 8+, PhpMyAdmin and Mailhog. Includes relevant application Dockerfile and the Compose file. [Imagick edition]
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/*
@aabeben
aabeben / Dockerfile
Created March 31, 2022 05:02 — forked from ChewySalmon/Dockerfile
Laravel development Docker setup using PHP 8+, Apache, MySql 8+, PhpMyAdmin and Mailhog. Includes relevant application Dockerfile and the Compose file. [GD edition]
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 \
@aabeben
aabeben / app.dockerfile
Created March 31, 2022 05:02 — forked from ChewySalmon/app.dockerfile
Laravel development docker setup using PHP 8+, Nginx, MySql 8+, PhpMyAdmin and Mailhog. Includes all relevant service Dockerfiles and the Compose file. [Imagick edition]
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
@aabeben
aabeben / app.dockerfile
Created March 31, 2022 05:02 — forked from ChewySalmon/app.dockerfile
Laravel development docker setup using PHP 8+, Nginx, MySql 8+, PhpMyAdmin and Mailhog. Includes all relevant service Dockerfiles and the Compose file. [GD edition]
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
@aabeben
aabeben / linux-shell-docker-cli.sh
Created March 8, 2022 06:55 — forked from rafaeltuelho/linux-shell-docker-cli.sh
Some useful shell aliases and function for Docker command line
# 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 }}' $@ ;}
@aabeben
aabeben / terbalik.dart
Created August 18, 2020 21:56
Balikin kata pada dartlang
void main(){
var anuMu="hihihi";
print(terbalik(anuMu));
}
String terbalik(anu){
return anu.split('').reversed.join();}
@aabeben
aabeben / peubah_peubah.dart
Created December 17, 2019 01:17
Peubah-peubah
// 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'],
@aabeben
aabeben / hello_world.dart
Created December 17, 2019 01:13
Hello World pada Dart
// Hello World
// Setiap aplikasi mempunyai fungsi main().
// Untuk menampilkan teks ke konsol,
// Anda dapat menggunakan fungsi level-teratas print()
void main(){
print('Hello, World!');
}
@aabeben
aabeben / exceptions.dart
Created December 17, 2019 01:10
Exceptions
// 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();
// 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){