Skip to content

Instantly share code, notes, and snippets.

View moradi-morteza's full-sized avatar
💭
I may be slow to respond.

Developer moradi-morteza

💭
I may be slow to respond.
  • Tehran,Qom
View GitHub Profile
@moradi-morteza
moradi-morteza / pull_bash.sh
Last active April 21, 2021 10:54
[pull bash laravel ]
#!/bin/bash
SCHOOLS[0]="develop"
SCHOOLS[1]="dinodanesh"
SCHOOLS[2]="ettehad"
SCHOOLS[3]="farhikhteg"
SCHOOLS[4]="kaj"
SCHOOLS[5]="momtazseda"
SCHOOLS[6]="pardis"
SCHOOLS[7]="rahiyansaa"
@moradi-morteza
moradi-morteza / install_asas.sh
Last active March 20, 2021 12:12
[bash larave]
#!/bin/sh
PROJECT_NAME="asas-server"
# run this script inside public_html folder.
# 1- clone asas-server from github [ssh key must exist]
rm -rf ${PROJECT_NAME}
git clone git@github.com:mabnagroup/${PROJECT_NAME}.git
if [ $? -eq 0 ]; then
@moradi-morteza
moradi-morteza / git.md
Last active March 19, 2021 06:54
[git]

sudo apt install git-all sudo apt-get remove git sudo apt-get remove --auto-remove git // with dependencys // If you also want to delete configuration and/or data files of git from Ubuntu Trusty then this will work: sudo apt-get purge git sudo apt-get purge --auto-remove git // with dependencys

git config --global user.name YOUR_USRE_NAME // set username

@moradi-morteza
moradi-morteza / lemp.md
Last active February 7, 2021 15:46
[Install LEMP on Ubunto]
@moradi-morteza
moradi-morteza / server.php
Last active January 5, 2021 14:49
server config
-in nginx.conf(inside /opt/nginx/conf)
client_max_body_size 24000M
systemctl restart nginx
---------------------------------------------------------------
sudo usermod -aG www-data deploybot
sudo chown -R www-data:www-data /var/www/laravel
sudo chown -R www-data:www-data /var/www/laravel/public/uploads
sudo chmod -R 775 /var/www
---------------------------------------------------------------
@moradi-morteza
moradi-morteza / paginate.php
Created December 26, 2020 08:08
[paginate]
@foreach($users as $key => $user)
<tr>
<td>{{ $users->firstItem() + $key }}</td>
<td>{{ $user->name }}</td>
<td>{{ $user->email }}</td>
</tr>
@endforeach
@moradi-morteza
moradi-morteza / email.php
Last active December 26, 2020 07:45
[email] #LaravelT
// important in localhost :
MAIL_USERNAME=bambboapp@gmail.com
MAIL_PASSWORD=112859112859
MAIL_ENCRYPTION=tls
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_FROM_ADDRESS=bambboapp@gmail.com
MAIL_FROM_NAME=bambboapp
@moradi-morteza
moradi-morteza / laravel 6.php
Last active December 14, 2020 15:46
[Laravel Start]
new laravel --auth
//add custom lib ----------------------------------------------------
npm install @fortawesome/fontawesome-free --save // icon library V:5.13
// in resource css app.scss add
@import '~@fortawesome/fontawesome-free/scss/fontawesome';
@import '~@fortawesome/fontawesome-free/scss/regular';
@import '~@fortawesome/fontawesome-free/scss/solid';
@import '~@fortawesome/fontawesome-free/scss/brands';
----------------------------------------------------------------
@moradi-morteza
moradi-morteza / seed.php
Last active November 6, 2020 08:23
[seed] #LaravelT
// without Factory----------------
// 1- command create
php artisan make:seed UserTableSeeder
//2- classes
class DatabaseSeeder extends Seeder{
public funtion run(){
Schema::disableForeignKeyConstraints();
$this->call(UserTableSeeder::class);
@moradi-morteza
moradi-morteza / date_time.php
Created October 27, 2020 13:41
[date and Time]
// date to timestamp
function dateToTimeStamp($date = '2020-10-01 17:38:15',$format ='Y-m-d H:i:s'){
$d = DateTime::createFromFormat($format,$date);
return $d->getTimestamp();
}
function timeStampToDate($timestamp=1601573895,$format ='Y-m-d H:i:s'){
return date($format, $timestamp);
}