Skip to content

Instantly share code, notes, and snippets.

View adinata-id's full-sized avatar

Adinata adinata-id

View GitHub Profile
//tambahkan pada AppService Provider
Str::macro('readDuration', function (...$text) {
$totalWords = str_word_count(implode(" ", $text));
$minutesToRead = round($totalWords / 200);
return (int)max(1, $minutesToRead);
});
//implementasi pada laravel blade
@adinata-id
adinata-id / ModelResource.php
Created December 27, 2021 02:17 — forked from bezhanSalleh/ModelResource.php
Filament Dynamic UI for Role and Permissions | Toggel + Checkboxes
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Grid::make()
->schema([
Forms\Components\Card::make()
->schema([
Forms\Components\TextInput::make('name')
->required()
:local ip "192.168.208.1"
:local interface "MID VPN INTERFACE NAME"
:if ([/ping $ip count=5] = 0) do {
:log warning "MID TEKNOLOGI VPN is restarting"
/interface disable $interface
:delay 1
/interface enable $interface
}
@adinata-id
adinata-id / gist:26162c656ef72cb7cf8b6927e18a06af
Created December 4, 2021 08:20
Return Sitemap XML File Using Laravel
Route::get('/sitemap.xml', function () {
$content = Storage::disk('digitalocean')->url('sitemap.xml');
return response(file_get_contents($content), 200, [
'Content-Type' => 'application/xml'
]);
});
@adinata-id
adinata-id / gist:fd98a9367dc0ceceb98b7b36ffbacfd6
Created September 24, 2021 03:24
Create Multiple Ping DI Windows
//untuk satu window gunakan script dibawah :
@echo off
ping 8.8.8.8
Echo ...................................
ping www.detik.com
Echo ...................................
ping www.yahoo.com
@adinata-id
adinata-id / gist:e2ce818940b0ccd3c194b985b05434f1
Created September 24, 2021 03:18
Script Backup Config Mikrotik
/system backup save name=Router-ANDA;
/tool e-mail send to="you@youremail.com" subject="Router-ANDA-Backup" body="Backup Router ANDA" file="Router-ANDA.backup" start-tls=yes;
@adinata-id
adinata-id / bwtest.txt
Last active March 19, 2024 17:55
Public Bandwith Test Mikrotik
New Bandwith test Publik (Datacenter JKT)
IP Address : 103.161.184.37
username : mid
password : midtest
@adinata-id
adinata-id / gist:30c38b010df6c0ee3aa05b2d15e823d3
Created July 2, 2021 02:38
Auto Complete Text By Google And Facebook
Google
<input class="gLFyf gsfi" jsaction="paste:puy29d;" maxlength="2048" name="q" type="text" aria-autocomplete="both" aria-haspopup="false" autocapitalize="off" autocomplete="off" autocorrect="off" autofocus="" role="combobox" spellcheck="false" title="Pesquisar" value="" aria-label="Pesquisar" data-ved="0ahUKEwjw0svW6brxAhWdqJUCHXoYDRsQ39UDCAQ">
Facebook
<input type="search" dir="ltr" aria-autocomplete="list" aria-expanded="true" aria-label="Pesquisar no Facebook" role="combobox" placeholder="Pesquisar no Facebook" autocomplete="off" name="global_typeahead" spellcheck="false" aria-invalid="false" value="" class="oajrlxb2 rq0escxv f1sip0of hidtqoto e70eycc3 lzcic4wl hzawbc8m ijkhr0an aaoq3grb sgqwj88q b3i9ofy5 oo9gr5id b1f16np4 hdh3q7d8 dwo3fsh8 qu0x051f esr5mh6w e9989ue4 r7d6kgcz br7hx15l h2jyy9rg n3ddgdk9 owxd89k7 ihxqhq3m jq4qci2q k4urcfbm iu8raji3 qypqp5cg l60d2q6s hv4rvrfc hwnh5xvq ez2duhqw aj8hi1zk r4fl40cc kd8v7px7 m07ooulj mzan44vs" aria-controls="jsc_c_3n">
@adinata-id
adinata-id / gist:56d267e7ab224c996eb973d33b82b9c8
Last active August 5, 2023 09:34
Load Balancing Mikrotik PCC
#loadbalance 2 interface
/ ip address
add address=192.168.10.1/24 network=192.168.10.0 broadcast=192.168.10.255 interface=ether3
add address=192.168.9.9/24 network=192.168.9.0 broadcast=192.168.9.255 interface=ether1
add address=192.168.8.2/24 network=192.168.8.0 broadcast=192.168.8.255 interface=ether2
/ip firewall address-list
Open File -> App\Providers\AppServiceProvider
And change method boot
public function boot()
{
config(['app.locale' => 'id']);
Carbon::setLocale('id');
}
Open File and changes -> config/app.php