Skip to content

Instantly share code, notes, and snippets.

Avatar
📱
Learning and developing

Ahmed Helal AhmedHelalAhmed

📱
Learning and developing
View GitHub Profile
View refactored.js
function createUser(email, password) {
validateInput(email, password);
saveUser(email, password);
}
function isNotValid(email, password) {
return emailNotValid(email) || passwordNotValid(password);
}
View fb-likes-issue.js
// ==UserScript==
// @name Unlike Facebook Pages
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Unlike all Facebook pages
// @author Ahmed Helal Ahmed
// @match https://duckduckgo.com/?q=new+script+unlike+pages+facebook&ia=web
// @icon https://www.google.com/s2/favicons?sz=64&domain=duckduckgo.com
// @grant none
// ==/UserScript==
@AhmedHelalAhmed
AhmedHelalAhmed / index.md
Created Feb 11, 2022 — forked from meigwilym/index.md
Notes on stitcher.io's Laravel beyond CRUD
View index.md

Laravel beyond CRUD

stitcher.io

A blog series for PHP developers working on larger-than-average Laravel projects

Written for projects with a development lifespan of six to twelve months, with a team of three to six developers working on them simultaneously.

Chapter 1: Domain oriented Laravel

View LogAfterRequest.php
namespace App\Http\Middleware;
use Illuminate\Support\Facades\Log;
class LogAfterRequest {
public function handle($request, \Closure $next)
{
return $next($request);
}
@AhmedHelalAhmed
AhmedHelalAhmed / README.md
Last active Nov 1, 2021
log notification
View README.md
  • Make new file in /usr/local/bin with name log add its content from the file with name log
  • Add execution ability to it by: sudo chmod +x log
  • Add the song file with name new_log.mp3 in /usr/local/bin
  • Open terminal in for example laravel project(example-app): log /var/www/html/example-app/storage/logs/laravel.log
View websites for application.txt
codewars.com
hackerrank.com
topcoder.com
coderbyte.com
hackerearth.com
leetcode.com
codechef.com
edabit.com
codeforces.com
View Basic unit-of-work for Laravel
Simple contract or interface, call as you wish:
interface UnitOfWork
{
public function begin();
public function commit();
public function rollback();
}
View test_docker.txt
<?php
use App\Jobs\LogToFile;
use Illuminate\Support\Facades\Redis;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
View .env
APP_NAME="log time status app"
APP_ENV=local
APP_KEY=base64:vwuZxLP3hiI4YbBHZ2pIKOrqdWfmcq3XNFdFqkM4lBs=
APP_DEBUG=true
APP_URL=http://testing.local
LOG_CHANNEL=stack
LOG_LEVEL=debug
DB_CONNECTION=mysql
View gist:f26a59a8e3de55b9e9b3ce207f10e912
version: '3.5'
laravel-app:
build:
context: '.'
args:
uid: ${UID}
container_name: log-time-status-app
environment:
- APACHE_RUN_USER=#${UID}
- APACHE_RUN_GROUP=#${UID}