Skip to content

Instantly share code, notes, and snippets.

View abdasis's full-sized avatar
🚀
Happy with Code

Abd. Asis abdasis

🚀
Happy with Code
View GitHub Profile
@abdasis
abdasis / MailConfigServiceProvider.php
Created August 17, 2024 02:32
Membuat config email dengan data dari database
<?php
namespace App\Providers;
use App\Settings\Smtp;
use Config;
use Illuminate\Support\ServiceProvider;
class MailConfigServiceProvider extends ServiceProvider
{
@abdasis
abdasis / date-input.tsx
Created July 5, 2024 12:41
Form input untuk handle tanggal
import React, { forwardRef, useState } from 'react';
import { format } from 'date-fns';
import { cn } from '@/lib/utils';
import { Button } from '@/components/ui/button';
import { Calendar } from '@/components/ui/calendar';
import { CalendarIcon } from '@radix-ui/react-icons';
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import moment from 'moment/moment';
import { useNavigation } from 'react-day-picker';
@abdasis
abdasis / cek-khodam.jsx
Created June 25, 2024 00:30
Cek Khodam dengan String Matching
// Import modul string similarity (anda bisa gunakan library seperti 'string-similarity')
const stringSimilarity = require('string-similarity');
// Contoh data khodam
const khodamList = [
{
name: "Macan Putih",
keterangan: "sangat kuat dan sangat berwibawa"
}
];
@abdasis
abdasis / Beranda.php
Created May 6, 2023 15:08
Controller untuk download
<?php
namespace App\Http\Livewire;
use App\Services\TitkokAPI\MaatootzAPI;
use Livewire\Component;
class Beranda extends Component
{
public $url;
@abdasis
abdasis / beranda.blade.php
Created May 6, 2023 15:07
Halaman Desain Tiktok Downloader
<div>
<div class="container-fluid bg-gradient">
<div class="row justify-content-center align-items-center banner-beranda">
<div class="col-md-6">
<div class="banner-box py-5">
<h1 class="text-center">Tiktok Downloader Paling Cepat</h1>
<p class="text-center">Tanpa watermark, kualitas HD, dan Tanpa Iklan.</p>
<div class="form-group text-center">
<div class="input-group rounded border">
<input id="video-link-input" wire:model="url" type="text" class="form-control border-0"
@abdasis
abdasis / Upload.blade.php
Created April 30, 2023 00:08
Livewire component PHP
const filesSelector = document.querySelector('#myFiles');
let awalChunk = [];
filesSelector.addEventListener('change', () => {
const fileList = [...filesSelector.files];
fileList.forEach((file, indeks) => {
@this.set('uploads.' + indeks + '.fileName', file.name);
@this.set('uploads.' + indeks + '.fileSize', file.size);
@this.set('uploads.' + indeks + '.progress', 0);
@abdasis
abdasis / table-scroller.js
Last active March 4, 2023 02:37
Snippet Javascript untuk membuat horizontal scroll menggunakan drag dari Mouse
let curXPos = 0,
curDown = false,
scrollLeft = 0;
const dragable = document.querySelector('.table');
dragable.addEventListener('mousemove', function(e) {
if (curDown === true) {
const walk = (curXPos - e.pageX);
scrollLeft = scrollLeft + walk;
@abdasis
abdasis / terima-pembayaran.blade.php
Created November 17, 2022 23:51
Method membuat format rupiah Laravel Livewire
@push('scripts')
<script>
var total_pembayaran = document.getElementById('total_pembayaran');
total_pembayaran.addEventListener('keyup', (event) => {
var value = total_pembayaran.value.replace(/[^\d,]/g, '');
@this.set('total_pembayaran', total_pembayaran);
total_pembayaran.value = rupiah(value)
})
Livewire.onLoad(() => {
@abdasis
abdasis / validation.php
Created November 10, 2022 03:28
Laravel validasi bahasa Indonesia Laravel 9.x
<?php
return [
"accepted" => ":Attribute harus diterima.",
"accepted_if" => ":Attribute harus diterima ketika :other berisi :value.",
"active_url" => ":Attribute bukan URL yang valid.",
"after" => ":Attribute harus berisi tanggal setelah :date.",
"after_or_equal" => ":Attribute harus berisi tanggal setelah atau sama dengan :date.",
"alpha" => ":Attribute hanya boleh berisi huruf.",
"alpha_dash" => ":Attribute hanya boleh berisi huruf, angka, strip, dan garis bawah.",
/** membuat navbar transparan **/
.svq-header-section .navbar-container {
padding-top: 1
rem
;
padding-bottom: 1
rem
;
box-shadow: 0 0 1px rgb(0 0 0 / 8%);
-ms-box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);