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 / translate.blade.php
Created February 10, 2021 13:05
Membuat tinyMCE dengan file manager di laravel
<script src="https://cdn.tiny.cloud/1/3kubek8r1p1mz4kvit7hc1z2mxd8wgg551cbeu82qkmenprf/tinymce/5/tinymce.min.js"
referrerpolicy="origin"></script>
<script>
tinymce.init({
selector: "textarea",
height : "480",
plugins: "nonbreaking",
nonbreaking_force_tab: true,
toolbar: "nonbreaking",
relative_urls: false,
@abdasis
abdasis / Terbilang.php
Created February 10, 2021 13:22
Helper untuk membuat angka terbilang di Laravel
<?php
class Terbilang
{
function penyebut($nilai) {
$nilai = abs($nilai);
$huruf = array("", "satu", "dua", "tiga", "empat", "lima", "enam", "tujuh", "delapan", "sembilan", "sepuluh", "sebelas");
$temp = "";
if ($nilai < 12) {
@abdasis
abdasis / python-pillow-image-change-background.py
Created November 13, 2021 03:25 — forked from namieluss/python-pillow-image-change-background.py
Replace a Color (RGB) from an Image using Python Pillow
from PIL import Image
img = Image.open("test_image.jpg")
img = img.convert("RGB")
datas = img.getdata()
new_image_data = []
for item in datas:
# change all white (also shades of whites) pixels to yellow
@abdasis
abdasis / kms
Created November 15, 2021 07:28 — forked from Twolk/kms
KMS server Windows
Online kms host address:
--------
kms.digiboy.ir
54.223.212.31
kms.cnlic.com
kms.chinancce.com
kms.ddns.net
franklv.ddns.net
k.zpale.com
m.zpale.com
@abdasis
abdasis / inertia-toast.js
Last active February 12, 2022 01:34
Inertia alert with toast
function handleSubmit(event) {
event.preventDefault();
Inertia.post(route('siswa.simpan'), values, {
onSuccess: () => {
toast.success("Data berhasil disimpan");
},
onError: (error) => {
toast.error(error);
}
});
@abdasis
abdasis / style.css
Created March 1, 2022 08:11
Soft scrollbar for google chrome
::-webkit-scrollbar-thumb {
background-color: #727272;
border-radius: 10px;
}
::-webkit-scrollbar {
height: 10px;
width: 8px;
border: 1px solid #ededed;
border-radius: 10px;
/** 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);
@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.",
@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 / 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;