Skip to content

Instantly share code, notes, and snippets.

View jalallinux's full-sized avatar
😎
ABC: Always Be Coding

JalalLinuX jalallinux

😎
ABC: Always Be Coding
View GitHub Profile
version: '3'
services:
dbeaver:
container_name: cloudbeaver
image: dbeaver/cloudbeaver:latest
restart: unless-stopped
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
@jalallinux
jalallinux / postgre_change_logs.sql
Last active December 5, 2022 04:01
The PostgreSQL trigger script is recording all events with their changed values.
-- Define audit_logs table
CREATE TABLE IF NOT EXISTS public.audit_logs
(
uuid uuid NOT NULL,
operation character varying(10) COLLATE pg_catalog."default" NOT NULL,
userid text COLLATE pg_catalog."default" NOT NULL,
tablename text COLLATE pg_catalog."default" NOT NULL,
changed json NOT NULL,
stamp timestamp without time zone NOT NULL
);
@jalallinux
jalallinux / Shinobi CCTV.postman_collection.json
Last active October 31, 2022 12:52
Shinobi.video Postman Collection
{
"info": {
"_postman_id": "f49590d5-f725-448d-ba8f-11e895fed806",
"name": "Shinobi CCTV",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "SuperAdmin",
"item": [
@jalallinux
jalallinux / interesting-things.md
Last active October 29, 2022 05:05
🥳 Interesting Things 🎉

Interesting Things

  • Metabase is an open-source business intelligence platform. You can use Metabase to ask questions about your data, or embed Metabase in your app to let your customers explore their data on their own.


  • Sonatype Nexus is a repository manager that organizes, stores and distributes artifacts needed for development. With Nexus, developers can completely control access to, and deployment of, every artifact in an organization from a single location, making it easier to distribute software.

@jalallinux
jalallinux / Dockerfile
Last active October 16, 2022 12:12
Laravel Best Dockerization
FROM jalallinux/laravel-9:php-80
LABEL maintainer="JalalLinuX"
ENV TZ=Asia/Tehran
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY . /app/path
WORKDIR /app/path
@jalallinux
jalallinux / observer.stub
Last active October 8, 2022 12:48
Laravel - Observer Stub
<?php
namespace {{ namespace }};
use {{ namespacedModel }};
class {{ class }}
{
/**
* Handle the {{ model }} "creating" event.
@jalallinux
jalallinux / controller.model.api.stub
Created October 8, 2022 12:47
Laravel - Controller Model API Stub
<?php
namespace {{ namespace }};
use {{ rootNamespace }}Http\Controllers\Controller;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use Illuminate\Http\JsonResponse;
use App\Repository\Contracts\{{ model }}Contract;
/**
@jalallinux
jalallinux / Handler.php
Last active March 5, 2022 10:45
Laravel: Convert validation rules exception to another exception
<?php
namespace App\Exceptions;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Validation\ValidationException;
@jalallinux
jalallinux / WithUuidColumn.php
Last active March 5, 2022 07:52
Laravel: Use uuid column separately
<?php
namespace App\Models\Traits;
use Illuminate\Database\Eloquent\Model;
trait WithUuidColumn
{
protected static function bootWithUuidColumn()
{
@jalallinux
jalallinux / postman-performance-test.js
Last active March 22, 2025 20:30
Postman: Performance Test
pm.test("Successful request", function () {
pm.expect(pm.response.code).to.be.oneOf([200, 201, 202]);
});
pm.test("Response time is less than 217ms.", function () {
pm.expect(pm.response.responseTime).to.be.below(217);
});
pm.test("Response time is less than 317ms", function () {
pm.expect(pm.response.responseTime).to.be.below(317);