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 / lemp.md
Last active February 7, 2021 15:46
[Install LEMP on Ubunto]
@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 / 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);
}
@moradi-morteza
moradi-morteza / sluggable.php
Last active July 31, 2020 08:29
[Slug-Persian]
// add this line in config\sluggable.php after enable :
//php artisan vendor:publish --provider="Cviebrock\EloquentSluggable\ServiceProvider
//********* Becarfule error cluster : https://github.com/cviebrock/eloquent-sluggable/issues/427
'method' => function($string, $separator = '-') {
$_transliteration = array(
'/ä|æ|ǽ/' => 'ae',
'/ö|œ/' => 'oe',
'/ü/' => 'ue',
'/Ä/' => 'Ae',
@moradi-morteza
moradi-morteza / android.java
Last active July 29, 2020 13:27
[android]
https://medium.com/over-engineering/hands-on-with-material-components-for-android-dialogs-75c6d726f83a
https://material.io/develop/android/components/text-fields
The basic method of showing a dialog is like so:-----------------------
// Note: A second constructor exists to pass in a theme res ID
MaterialAlertDialogBuilder(context)
// Add customization options here
.show()
Title and supporting text-------------------
// to avoid modal outside click hide add :
data-toggle="modal" data-backdrop="static" data-keyboard="false" // to button
<button data-target="#myModal" data-toggle="modal" data-backdrop="static" data-keyboard="false">Click Me</button>
@moradi-morteza
moradi-morteza / date.md
Last active July 29, 2020 06:45
[php date]

Y : year with 4 digits.

y : year with 2 digits.


M : month with 3 charachter of name.

m : month with 2 digits.

sudo ufw status
sudo systemctl start nginx
sudo systemctl restart nginx
sudo systemctl reload nginx
sudo systemctl enable nginx
sudo nginx -t
sudo nginx -t && sudo service nginx reload