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
@jalallinux
jalallinux / Otp.php
Last active January 14, 2024 09:03
OTP class
<?php
namespace App\Contracts;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Support\Carbon;
use Illuminate\Support\Str;
class Otp implements Arrayable, Jsonable
@jalallinux
jalallinux / CanFailMiddleware.php
Created September 13, 2023 08:45
CanFail middleware to handle Database Transaction on whole request
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Symfony\Component\HttpFoundation\Response;
class CanFailMiddleware
@jalallinux
jalallinux / freevmess-worker.md
Last active February 21, 2023 06:54
📣 Create a free vmess server with the help of Cloudflare worker

1. Create Cloudflare Worker with this code:

addEventListener("fetch", event => {
  var url = new URL(event.request.url)
  var newUrl = new URL("https://" + url.pathname.replace(/^\/|\/$/g, ''))
  var request = new Request(newUrl, event.request)
  event.respondWith(fetch(request))
})
@jalallinux
jalallinux / AmazonApi.php
Last active February 1, 2023 08:48
Fetch Amazon product details
<?php
namespace JalalLinuX\AmazonApi;
use Illuminate\Http\Client\PendingRequest;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;
class AmazonApi
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.