Skip to content

Instantly share code, notes, and snippets.

View AhmedHelalAhmed's full-sized avatar
📱
Learning and developing

Ahmed Helal AhmedHelalAhmed

📱
Learning and developing
View GitHub Profile
@AhmedHelalAhmed
AhmedHelalAhmed / promises.js
Last active January 2, 2021 19:09
JS chain promises
//======> output: 1 2 3 4
// synchronous - ملتزم بالترتيب
// JavaScript is always synchronous
function step1() {
return new Promise((resolve, reject) => {
console.log("1");
resolve(1);
});
}
@AhmedHelalAhmed
AhmedHelalAhmed / README-Template.md
Created July 25, 2020 17:30 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@AhmedHelalAhmed
AhmedHelalAhmed / AppServiceProvider.php
Created June 12, 2020 21:52 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
try {
$user = User::findOrFail($request->input('user_id'));
} catch (ModelNotFoundException $exception) {
return back()->withError($exception->getMessage())->withInput();
}
$user = User::find($user_id);
if (!$user) {
throw new ModelNotFoundException('User not found by ID ' . $user_id);
<button
type="button"
class="btn btn-primary btn-simple btn-xs"
data-toggle="modal"
data-target="#equipmentModal">
<i class="material-icons">edit</i>
<div class="ripple-container"></div>
</button>
<div
@AhmedHelalAhmed
AhmedHelalAhmed / product_style
Created April 14, 2020 00:01 — forked from atomjar/product_style
Stylesheet for Vue Mastery's Intro to Vue course
body {
font-family: tahoma;
color:#282828;
margin: 0px;
}
.nav-bar {
background: linear-gradient(-90deg, #84CF6A, #16C0B0);
height: 60px;
margin-bottom: 15px;
@AhmedHelalAhmed
AhmedHelalAhmed / README.md
Created April 9, 2020 03:49 — forked from letanure/README.md
VueJS Best Practices Guide

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

setInterval(
function(){
if(document.querySelector('.ytp-ad-text.ytp-ad-skip-button-text'))
{
document.querySelector('.ytp-ad-text.ytp-ad-skip-button-text').click();
}
}, 3000);
@AhmedHelalAhmed
AhmedHelalAhmed / Copyright.html
Created March 25, 2020 23:31
Copyright in html
@AhmedHelalAhmed
AhmedHelalAhmed / helpers.php
Created March 13, 2020 19:15
example for helpers
if (!function_exists('user')) {
/**
* Get the authenticated user.
*
* @return \App\Models\Auth\User
*/
function user()
{
// Get user from api/web
if (request()->is('api/*')) {