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 | |
namespace App\Rules; | |
use Illuminate\Contracts\Validation\Rule; | |
/** | |
* check valid Password format | |
*/ | |
class ValidPassword implements Rule |
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
class HashIdCast implements CastsAttributes | |
{ | |
public function get($model, $key, $value, $attributes) | |
{ | |
$hash = new Hashids(); | |
return $hash->encode($value); | |
} | |
public function set($model, $key, $value, $attributes) | |
{ |
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
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
upstream websocket { | |
server host.docker.internal:8080; | |
} | |
server { |
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
NEW VER utk current | |
+++++ | |
updated 2021-04-14 Guna struktur table baru | |
-- | |
SELECT | |
t.*, | |
b.TarikhWarta , | |
b.DPT, | |
b.Penerangan | |
FROM |
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
based on https://www.tothenew.com/blog/indoor-positioning-systemtrilateration/ | |
/** | |
* Calculates the distance from Beacon to device. | |
**/ | |
private void calculateBeaconDistance(Beacon beacon) { | |
float txPower = -74.0; // Manufacture set this power in the device | |
if (beacon .rssi == 0){ |
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 run -it --rm -v "$(pwd):/app" -w /app composer create-project --prefer-dist laravel/laravel src --ignore-platform-reqs | |
docker run -it --rm -v "$(pwd):/app" -w /app composer update --ignore-platform-reqs | |
docker exec -it -w /var/www/projects/spark/src php7.fpm php artisan spark:install --force | |
docker exec -it -w /var/www/projects/spark/src php7.fpm php artisan storage:link | |
docker run -it --rm -v "$(pwd):/app" -w /app node:alpine npm install | |
docker run -it --rm -v "$(pwd):/app" -w /app node:alpine npm run dev |
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
([0-9][0-9])((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))([0-9][0-9])([0-9][0-9][0-9][0-9]) |
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
Yii::$app->session->setFlash('success', "Rekod telah didaftar"); | |
Yii::$app->session->setFlash('success', "Rekod telah dikemaskini"); | |
Yii::$app->session->setFlash('success', "Rekod telah dihapuskan"); |
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 | |
session_start(); | |
if (!isset($_SESSION['count'])) { | |
$_SESSION['count'] = 0; | |
} else { | |
$_SESSION['count']++; | |
} | |
echo "count {$_SESSION['count']}"; |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE |
NewerOlder