Skip to content

Instantly share code, notes, and snippets.

View defrindr's full-sized avatar
👋
Hi there

Defri Indra Mahardika defrindr

👋
Hi there
View GitHub Profile
@defrindr
defrindr / ListTranslations.php
Created July 31, 2025 14:24
Impor data from excel in Laravel Filament
<?php
namespace App\Filament\Resources\TranslationResource\Pages;
use App\Filament\Resources\TranslationResource;
use App\Imports\TranslationsImport;
use Filament\Actions;
use Filament\Actions\Action;
use Filament\Forms\Components\FileUpload;
use Filament\Notifications\Notification;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Simple Diff Tool</title>
<style>
body { font-family: sans-serif; margin: 20px; }
textarea { width: 45%; height: 150px; }
#result { margin-top: 20px; white-space: pre-wrap; font-family: monospace; }
services:
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: example
ports:
- 5431:5432
adminer:
<?php
// Cek jika form sudah disubmit
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$target_dir = "uploads/"; // Direktori untuk menyimpan file yang di-upload
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
// Cek apakah file sudah ada
if (file_exists($target_file)) {
echo "Maaf, file sudah ada.<br>";
@defrindr
defrindr / BaseSchemaFetcher.php
Created March 17, 2025 23:47
Factory Method Design Pattern
<?php
namespace Modules\Vdb\Components\Vdb;
use Core\Exceptions\BadRequestHttpException;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\DB;
class BaseSchemaFetcher implements ISchemaFetcher
{
package utils
import (
"regexp"
"strings"
"github.com/go-playground/validator/v10"
)
// Convert field names from CamelCase to snake_case
import requests
import json
url = "https://adminbedcs.demoweb.fun/api/admin/"
payload = json.dumps({
"email": "[email protected]",
"password": "password",
"adminUsername": "adminsri",
"firstName": "admin",
{{url}}/report/upline_transaction/data?upline_id=124&limit=1&pageNo=2
{{url}}/report/upline_transaction/data_detail?upline_id=124&month=1&year=2025&pageNo=1&limit=1
package com.wenkesj.voice;
import android.Manifest;
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.os.Handler;
import android.speech.RecognitionListener;
@defrindr
defrindr / ToolController.php
Created December 4, 2024 07:13
controllers/api/ToolController.php
<?php
// controllers/api/ToolController.php
namespace app\controllers\api;
/**
* This is the class for REST controller "ELogController".
*/
use app\components\Maximo;
use app\models\CbmVibrasiImage;