Skip to content

Instantly share code, notes, and snippets.

View Aslam97's full-sized avatar
🎯
Focusing

Aslam Aslam97

🎯
Focusing
  • Full-Stack Web Developer
  • Bandung, Jawa Barat, Indonesia
  • 14:11 (UTC +07:00)
  • X @__asuramus
View GitHub Profile
@Aslam97
Aslam97 / react-table-laravel-pagination.md
Created March 28, 2024 12:53
Laravel @TanStack table using shadcn

api response

{
    "data": [
        ...
    ],
    "links": {
        "first": "https://example.com/pagination?page=1",
        "last": "https://example.com/pagination?page=10",

kode ini harus di enchance. agar tidak terjadi case seperti ini lagi pada margin import tambahan

    grade_mapping = {
        "Mega Store": "mega",
        "Basic Store": "basic",
        "Super Store": "super",
    }
@Aslam97
Aslam97 / lunar_page_component.md
Created October 10, 2022 11:19
Create Lunar Page and Component

This follow the lunar structure code.

First create folder call Pages and Components inside App\Http\Livewire it will become something like this.

App\Http\Livewire\Components App\Http\Livewire\Pages

Moving on. we will create new Page call Foo

  1. Create livewire component call FooIndex inside Pages
@Aslam97
Aslam97 / mix_to_vite.md
Last active June 3, 2023 15:26
Guide on migrating from Mix to Vite
@Aslam97
Aslam97 / quill_image_upload_to_server_aws_s2.js
Last active January 21, 2024 07:30
Quill upload image to server aws s3
// Check whether quill content is empty
function isQuillEmpty(quill) {
if ((quill.getContents()['ops'] || []).length !== 1) {
return false
}
return quill.getText().trim().length === 0
}
// Delta to HTML
@Aslam97
Aslam97 / generate-referral-code.php
Created April 25, 2021 20:49
Generate referral code
<?php
use Illuminate\Support\Str;
function generateReferralCode($str) {
// get random number min & max 4 digit
$randomNumber = rand(1000, 9999);
// get the first 4 character and trim whitespace
$strName = trim(substr($str, 0, 4));
// get str length
@Aslam97
Aslam97 / vue_permission_directive.js
Created April 7, 2021 09:39
Vue Permission Directive
const Example = {
data() {
return {
users: [
{
id: 1, name: 'Aslam', permissions: ['view']
},
{
id: 2, name: 'Jonwik', permissions: []
}
@Aslam97
Aslam97 / github_init.md
Created March 18, 2021 07:20
Git init github

##…or create a new repository on the command line

echo "# laravel-bank-bni" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/Aslam97/laravel-bank-bni.git
git push -u origin main
@Aslam97
Aslam97 / routes.js
Created October 29, 2020 18:25
Vue dynamic import
// Lazy-loads view components, but with better UX. A loading view
// will be used if the component takes a while to load, falling
// back to a timeout view in case the page fails to load. You can
// use this component to lazy-load a route with:
//
// component: () => lazyLoadView(import('@views/my-view'))
//
// NOTE: Components loaded with this strategy DO NOT have access
// to in-component guards, such as beforeRouteEnter,
// beforeRouteUpdate, and beforeRouteLeave. You must either use
@Aslam97
Aslam97 / webpack.mix.js
Created October 29, 2020 18:19
Laravel mix 5 webpack.mix.js
const path = require("path");
const mix = require("laravel-mix");
require("laravel-mix-vue-css-modules"); // https://github.com/Aslam97/laravel-mix-vue-css-modules
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const purgeCss = mix.inProduction()
? [
require("@fullhuman/postcss-purgecss")({
content: ["resources/**/*.blade.php", "resources/**/*.vue"],
defaultExtractor(content) {