Skip to content

Instantly share code, notes, and snippets.

View nadyshalaby's full-sized avatar
🏠
Working from home

Nady Shalaby nadyshalaby

🏠
Working from home
View GitHub Profile
@nadyshalaby
nadyshalaby / Laravel-Virtual-Host-Apache2.conf
Last active August 8, 2024 21:38
How to setup apache2 virtual host for laravel project
# -----------------( Terminal ) -------------------
cd /path/to/project/directory
sudo usermod -aG www-data $(whoami) # use 'webapp' instead of 'www-data' if you are using AWS
sudo chown -R $(whoami):www-data .
sudo find . -type f -exec chmod 0664 {} \;
sudo find . -type d -exec chmod 0775 {} \;
sudo chmod -R g+s .
sudo vi /etc/apache2/sites-available/example.local.conf
sudo a2ensite example.local.conf
@nadyshalaby
nadyshalaby / ec2-ftp-tutorial.md
Created March 17, 2019 18:51 — forked from tylermakin/ec2-ftp-tutorial.md
Tutorial for configuring FTP access to an EC2 server
@nadyshalaby
nadyshalaby / AppServiceProvider.php
Last active February 1, 2019 17:03
Coding Laravel Blade Directive to minify embedded JS & CSS code e.g. @minify(js) , @endminify using minification package ``` matthiasmullie/minify ```
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
@nadyshalaby
nadyshalaby / VueJs-Image-Upload.md
Last active August 23, 2017 22:34
Uploading images through Laravel & VueJs, it's mush simpler and quicker than the normal way of handling the file uploads using vanilla js or jquery lib. also provide file preview.

Here's my code for uploading images through VueJs, it's mush simpler and quicker. also provide file preview.

VueJS Code


<template lang="html">
    <form @submit.prevent="submitAvatar">
        <img :src="image" alt="" />
        <input type="file" id="avatar" @change="updateAvatar" name="...">
@nadyshalaby
nadyshalaby / index.html
Created August 11, 2017 13:30
Vue V-Model On Custom Component // source https://jsbin.com/wocuwir
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.4.2/vue.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Vue V-Model On Custom Component</title>
</head>
<body>