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
$('body').find('.draggable').draggable({ | |
stack: ".draggable", | |
helper: 'clone', | |
start: function(event, ui) { | |
$(this).draggable('instance').offset.click = { | |
left: Math.floor(ui.helper.width() / 2), | |
top: Math.floor(ui.helper.height() / 2) | |
}; | |
ui.helper.css('cursor', 'move'); |
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
$token = app('auth.password.broker')->createToken(auth()->user()); | |
OR | |
$token = app('auth.password.broker')->createToken($user); | |
$user must implement App\User |
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
var str = "Hello World!"; | |
var base64_str = window.btoa(str); | |
// or | |
var base64_str = btoa(str); |
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
$('body').find('.draggable').draggable({ | |
revert: true, | |
revertDuration: 0, | |
stack: ".draggable", | |
helper: 'clone', | |
start: function(event, ui) { | |
$(ui.helper).removeAttr('width'); | |
$(ui.helper).removeAttr('height'); | |
var ele_width = $('body').find('.square').width(); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<body> | |
<form name="user-form" id="user-form" enctype="multipart/form-data"> | |
<input type="file" name="image_file"> | |
<input type="text" name="name"> | |
<img src="" id="image_file"> | |
<button type="button" title="Save" id="save-user">Save</button> | |
</form> | |
<script type="text/javascript"> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>User Form</title> | |
</head> | |
<body> | |
<input type="hidden" name="user_id" value="1"> | |
<form name="user-form" id="user-form" enctype="multipart/form-data"> | |
<input type="file" name="image_file"> | |
<input type="text" name="name"> |
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
// GET request | |
$request = Request::create(config('app.url') . '/your-url-here', 'GET'); | |
$response = Route::dispatch($request); | |
return $response; | |
// POST request | |
$params = array( | |
'product_code' => 'GYU16R', | |
'qty' => '1', | |
'price' => 660, |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Fancybox</title> | |
<style type="text/css"> | |
/* Fancybox */ | |
.fancyimg { | |
border-radius: 5px; | |
cursor: pointer; | |
transition: 0.3s; |
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
<IfModule mod_rewrite.c> | |
<IfModule mod_negotiation.c> | |
Options -MultiViews | |
</IfModule> | |
# Enable Compression | |
<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE application/javascript | |
AddOutputFilterByType DEFLATE application/rss+xml | |
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject |
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
## Interactive Mode | |
sudo update-alternatives --config php | |
sudo update-alternatives --config phar | |
sudo update-alternatives --config phar.phar | |
## Manual Mode | |
Apache (Webserver): | |
sudo a2dismod php7.4 -> PHP version which is currently enabled `php -v` |