Skip to content

Instantly share code, notes, and snippets.

View gentritabazi's full-sized avatar
🎯
Focusing

Gentrit Abazi gentritabazi

🎯
Focusing
View GitHub Profile
@gentritabazi
gentritabazi / Logger.js
Created April 23, 2024 09:40
Logger.js
// Define the interface for different logging strategies
class LoggerStrategy {
log(message) {}
}
class ConsoleLogger extends LoggerStrategy {
log(message) {
// Code logic to log message
}
}
<?php
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
class Handler extends ExceptionHandler
{
@gentritabazi
gentritabazi / DB.php
Created February 26, 2021 23:36
PHP MySQL Connect to database.
<?php
$dbHost = '127.0.0.1';
$dbPort = '3308';
$dbName = 'name';
$dbUser = 'user';
$dbPassword = 'password';
try {
new pdo(
@gentritabazi
gentritabazi / vue-format-date-mixin.js
Created January 27, 2021 09:57
Vue format date Mixin
import moment from 'moment';
export default {
methods: {
formatDate: function (date, dateFormat) {
return moment(date).format(dateFormat);
}
}
}
@gentritabazi
gentritabazi / google-login.html
Last active January 25, 2021 10:47
GOOGLE LOGIN HTML
<html lang="en">
<head>
<meta name="google-signin-scope" content="profile email">
<meta name="google-signin-client_id" content="{client_id}">
<script src="https://apis.google.com/js/platform.js" async defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.2/axios.min.js"></script>
</head>
<body>
<div class="g-signin2" data-onsuccess="onSignIn" data-theme="dark"></div>
@gentritabazi
gentritabazi / Logger.php
Created January 12, 2021 09:03
Logger Middleware Laravel
<?php
namespace Infrastructure\Http\Middlewares;
use Closure;
use DB;
use Illuminate\Http\Request;
use Log;
class Logger
@gentritabazi
gentritabazi / autoexec.cfg
Last active February 16, 2021 15:37
CSGO AUTOEXEC
// Autoexec file
// Download file
// Copy file to {SteamPath}\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg
// Open CSGO and run in console: exec autoexec
// General
sensitivity "2.0"
// Rates
<?php
function deleteCommentsFromFolder($dir)
{
$di = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS);
$it = new RecursiveIteratorIterator($di);
$fileArr = [];
foreach ($it as $file) {
if (pathinfo($file, PATHINFO_EXTENSION) == 'php') {
name: SSH Laravel Deploy
on:
push:
branches: [ master ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
<?php
namespace Infrastructure\Http\Middlewares;
use Closure;
class SwaggerProtect
{
/**
* Handle an incoming request.