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
<details open=""> | |
<summary> | |
<i class="bi-folder text-body me-1"></i> <strong>space</strong> | |
</summary> | |
<ul class="list-py-1 list-unstyled ps-4"> | |
<li> | |
<details open=""> | |
<summary> | |
<i class="bi-folder text-body me-1"></i> <strong>src</strong> | |
</summary> |
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
#!/bin/bash | |
## | |
# Script to delete remote git branches | |
## | |
# Fetch the remote resources | |
git fetch | |
# Loop through all remote merged branches |
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
Learn | |
https://learnxinyminutes.com | |
GitHub Profile Trick | |
https://css-tricks.com/the-github-profile-trick | |
Best Web page speed test | |
https://webpagetest.org | |
https://css-tricks.com/webpagetest-api (API) |
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
Let's Encrypt(Certbot) redirect everything to HTTPS: | |
1. Run the following command | |
certbot --apache -d yourdomain.com -d www.yourdomain.com | |
2. Navigate to your domain Apache2 conf file and scroll to the bottom. You'll see something like this: | |
RewriteEngine on | |
RewriteCond %{SERVER_NAME} =www.yourdomain.com [OR] | |
RewriteCond %{SERVER_NAME} =yourdomain.com | |
RewriteRule ^ %{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] |
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 str1 = 'Hello World'; | |
var str2 = 'World'; | |
var similarity_percentage = Math.round(similarity(str1, str2) * 10000) / 100; | |
function similarity(s1, s2) { | |
var longer = s1; | |
var shorter = s2; | |
if (s1.length < s2.length) { | |
longer = s2; |
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
Laravel Excel automatically calculates the formulas inside Excel and output result: | |
use Maatwebsite\Excel\Concerns\WithCalculatedFormulas; | |
class ExcelImport implements ToCollection, WithCalculatedFormulas | |
Note: | |
Replace "ExcelImport" with your class 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
<?php | |
# Laravel provides a convenient way to encrypt/decrypt a string i.e. encrypt() and decrypt() methods, but the output string is too long. | |
# It also provides a bcrypt() method where the output string is not lengthy but is not URL friendly. | |
# Here's a function to encrypt/decrypt a string, which is also URL friendly and the encrypted string length is way small: | |
/** | |
* Encrypt & decrypt strings. | |
* | |
* Create secret key & iv bu running the following commands |
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
Set MySQL password after fresh installation: | |
After fresh installation do not start, restart or stop mysql service. Do not run any commands which will affect MySQL in anyway. Run the below commands as soon as the installation is finished. If the below commands are not working then reinstall MySQL. | |
1. Login to MySQL | |
mysql -u root | |
2. Set Password | |
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new_password'; |
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` |
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(); |
NewerOlder