Skip to content

Instantly share code, notes, and snippets.

View lomotech's full-sized avatar

Muhammad Syafiq Zainuddin lomotech

View GitHub Profile
@lomotech
lomotech / starbuck-haram.md
Last active May 14, 2016 10:31
Starbuck Haram (Lagi)

TL; DR;

Ini semua fitnah. Malangnya manusia itu tidak mahu belajar. Tahun depan akan ada lagi. Cuma nama yang bertanggungjawab akan bertukar.

Baca: Matlamat boikot itu tak menghalalkan untuk memfitnah.

Pendahuluan

Aku pernah menulis tentang perkara ini dahulu dalam blog. Tetapi malang sekali blog tersebut telah hilang dan aku lupa untuk masukkan kedalam blogspot supaya apa yang ditulis paling tidak tetap akan ada di sesuatu tempat yang boleh dianggap ‘kekal’.

Maka aku rasa wajib bagi aku untuk tulis kembali isu ini dan terangkan secara seterperinci yang aku mampu tentang Starbuck Haram ini.

@lomotech
lomotech / fyp-title-generator.php
Last active July 11, 2018 15:14
Sistem Jana Tajuk FYP
<?php
$a = ['pengurusan', 'pemantauan', 'penyelidikan', 'pengiraan', 'analisa','pemilihan','navigasi','maklumat','mekanisma','permohonan'];
$b = ['kapal','udang','itik','ayam','bayi','kesihatan', 'masalah','kamus','tender','projek','lelong','bergeografi','pemilihan','kelayakan','cuti','kerja'];
$c = ['menggunakan','berasaskan'];
$d = ['six sigma', 'AI', 'image processing','tensor flow','raspi','WAP','web'];
echo PHP_EOL;
echo 'Sistem '.$a[array_rand($a)].' '.$b[array_rand($b)].' '.$c[array_rand($c)].' '.$d[array_rand($d)];
echo PHP_EOL;
@lomotech
lomotech / esolat.md
Last active December 18, 2023 03:56
JAKIM eSolat API
@lomotech
lomotech / appserviceprovider
Created September 20, 2018 03:22
laravel custom validation
public function boot()
{
Validator::extend('both_not_filled', function ($attribute, $value, $parameters) {
$other = $parameters[0];
if (!empty($value) && !empty($other)) {
return false;
}
return true;
});
@lomotech
lomotech / migration.php
Last active September 24, 2018 06:41
Running number management
<?php
Schema::create('runners', function (Blueprint $table) {
$table->increments('id');
$table->string('rule_1');
$table->string('rule_2')->nullable();
$table->string('rule_3')->nullable();
$table->string('rule_4')->nullable();
$table->integer('index')->nullable();
$table->timestamps();
@lomotech
lomotech / getdatediff.php
Created September 27, 2018 04:49
get date diff exclude multiple day
use Carbon\Carbon;
$dt = Carbon::create(2018, 9, 17);
$dt2 = Carbon::create(2018, 9, 24);
$holiday = ['2018-09-21'];
$offday = ['2018-09-22', '2018-09-21'];
$daysForExtraCoding = $dt->diffInDaysFiltered(function(Carbon $date) use ($holiday, $offday){
return !in_array($date->toDateString(), $offday) && !in_array($date->toDateString(), $holiday);
}, $dt2);
dd($daysForExtraCoding);
table.table.table-striped.table-bordered>(thead>tr>th{head}*3)+(tbody>tr*5>td{datum}*3)+tfoot>tr>td{total}*3
@lomotech
lomotech / StatusRepo.php
Created March 13, 2019 19:05
repository problem
<?php
public static function getAll()
{
return Cache::remember('status:all', 60, function () {
return Status::all();
});
}
/**
@lomotech
lomotech / bank code
Created October 4, 2019 08:24
additional bank code
$data = [
'AFB' => 'AFFIN BANK',
'ALB' => 'ALLIANCE BANK',
'AMB' => 'AMBANK',
'BMB' => 'BANK MUAMALAT',
'BIM' => 'BANK ISLAM MALAYSIA',
'BRB' => 'BANK RAKYAT',
'CIM' => 'CIMB BANK',
'NULL' => 'EON BANK BERHAD',
'HLB' => 'HONG LEONG BANK',
@lomotech
lomotech / uiblock processing box
Created October 4, 2019 21:31
uiblock processing box
// CSS
/*block ui loading*/
.blockui > .boxes {
--size: 32px;
--duration: 800ms;
height: calc(var(--size) * 2);
width: calc(var(--size) * 3);
position: relative;
-webkit-transform-style: preserve-3d;