This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git fetch --all | |
git reset --hard origin/master | |
git pull origin master | |
git config core.filemode false | |
// Save Username And Password | |
git config --global credential.helper store | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b) | |
For /f "tokens=1-2 delims=/:" %%a in ("%TIME%") do (set mytime=%%a%%b) | |
SET backupdir=C:\xampp\htdocs\backup | |
SET mysqluername=root | |
SET mysqlpassword=password | |
SET database=dbname | |
C:\xampp\mysql\bin\mysqldump.exe -u%mysqluername% -p%mysqlpassword% %database% > %backupdir%\%database%_%mydate%_%mytime%.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function updateFromArray(array $attributes) | |
{ | |
$this->id = array_get($attributes, 'id', $this->id); | |
$this->qty = array_get($attributes, 'qty', $this->qty); | |
$this->name = array_get($attributes, 'name', $this->name); | |
$this->price = array_get($attributes, 'price', $this->price); | |
$this->priceTax = $this->price + $this->tax; | |
$this->options = new CartItemOptions(array_get($attributes, 'options', $this->options)); | |
//$this->rowId = $this->generateRowId($this->id, $this->options->all()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mysqld] | |
key_buffer_size = 10000M | |
key-buffer-size = 32M | |
max_allowed_packet = 2048M | |
max-allowed-packet = 64M | |
max-connect-errors = 100000000 | |
thread_stack = 4048K | |
#thread_cache_size = 600 | |
#myisam_recover_options = BACKUP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$classes = array_filter(get_declared_classes(), function ($class) { | |
$isController = substr($class, -10) == 'Controller'; | |
$isNotPlainController = $isController && substr($class, -11) != '\Controller'; | |
return $isNotPlainController; | |
}); | |
//Optional: to clear controller name from its namespace | |
$controllers=array_map(function ($controller){ | |
return last(explode('\\',$controller)); | |
},$classes); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Update Composer | |
composer update --no-scripts | |
//Update Autodump | |
composer du | |
composer auto-dump | |
//Cache | |
Cache::forget('key'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mv source/{,.}* /destination/folder/here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum install lvm2 | |
//Add new Physical drive | |
fdisk -l | |
//detect Physicls like /dev/vdb or /dev/sdb and create new Physical Volume(PV) | |
pvcreate /dev/sda /dev/sdb | |
pvdisplay | |
//Create New Volume Group(VG) | |
vgcreate vg_server /dev/sda /dev/sdb | |
vgdisplay vg_server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rsync -avz -e "ssh -p <port-number>" </local-path> root@<server-name>:/<remote-folder> | |
rsync -avz -e "ssh" ./ root@<server-name>:/<remote-folder> | |
rsync -avz --exclude={'club','images','assets','upload'} -e "ssh" ./ root@<server-name>:/<remote-folder> | |
wget -m --user=username --password=password ftp://ip.of.old.host | |
OlderNewer