Skip to content

Instantly share code, notes, and snippets.

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
@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
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());
[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
$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);
//Update Composer
composer update --no-scripts
//Update Autodump
composer du
composer auto-dump
//Cache
Cache::forget('key');
mv source/{,.}* /destination/folder/here
You can get around this by wrapping your navigation element in a new div - let's call it nav-wrapper
- and set its height to the same as your navigation element.
These are known as placeholder elements.
This new wrapper and your original navigation bar must always be the same height for the 'jump' to disappear.
<div class="nav-wrapper" style="height:80px;"> <-- add this
<div class="your-original-nav" style="height:80px"></div>
</div> <!-- add this
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
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