Skip to content

Instantly share code, notes, and snippets.

View rajucs's full-sized avatar
🎯
Focusing

Arman Hossain rajucs

🎯
Focusing
View GitHub Profile
@rajucs
rajucs / Add radio button for user custom field in wordpress.txt
Last active July 5, 2018 06:23
Add radio button for user custom field in wordpress
add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );
function my_show_extra_profile_fields( $user ) { ?>
<table>
<tr>
<?php
$gender = get_user_meta( $user->ID, 'gender', true );
?>
@rajucs
rajucs / PHP storm license server.txt
Last active September 12, 2022 09:24
PHP Storm 2018.1.6 license server
http://aardonyx.bid/
@rajucs
rajucs / Warning: The lock file is not up to date with the latest changes in composer.json.txt
Created July 5, 2018 06:22
How to fix in laravel Warning: The lock file is not up to date with the latest changes in composer.json when install the project locally from gitlab
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for doctrine/annotations v1.6.0 -> satisfiable by doctrine/annotations[v1.6.0].
- doctrine/annotations v1.6.0 requires php ^7.1 -> your PHP version (7.0.30) does not satisfy that requirement.
Problem 2
- Installation request for doctrine/inflector v1.3.0 -> satisfiable by doctrine/inflector[v1.3.0].
Laravel 5.4: Specified key was too long error
Laravel 5.4 made a change to the default database character set, and it’s now utf8mb4 which includes support for storing emojis. This only affects new applications and as long as you are running MySQL v5.7.7 and higher you do not need to do anything.
For those running MariaDB or older versions of MySQL you may hit this error when trying to run migrations:
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email))
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
@rajucs
rajucs / SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQ L: alter table `users` add unique `users_email_unique`(`email`))
Created July 15, 2018 05:52
-> php artisan migrate SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQ L: alter table `users` add unique `users_email_unique`(`email`))
Laravel 5.4: Specified key was too long error
Laravel 5.4 made a change to the default database character set, and it’s now utf8mb4 which includes support for storing emojis. This only affects new applications and as long as you are running MySQL v5.7.7 and higher you do not need to do anything.
For those running MariaDB or older versions of MySQL you may hit this error when trying to run migrations:
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email))
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
@rajucs
rajucs / How to run Laravel from root directory
Created July 15, 2018 10:23
How to run Laravel from root directory, not from public | remove public from url
How to run Laravel from root directory, not from public
@rajucs
rajucs / sublime text license key build 3176
Last active July 31, 2018 03:06
sublime text build 3176 license key
To add this license key you need to complete some step ->
add this line in C:\Windows\System32\drivers\etc\hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 sublimetext.com
127.0.0.1 sublimehq.com
127.0.0.1 license.sublimehq.com
127.0.0.1 45.55.255.55
127.0.0.1 45.55.41.223
Uncaught Error: cannot call methods on tooltip prior to initialization; attempted to call method 'disable'
to prevent this error,
just put your jquery-ui.js before bootstrap.min.js
MethodNotAllowedHttpException clearly means the route is not found, means it's missing in the collection OR you declared it differently.
@rajucs
rajucs / How to add sweat alert in laravel
Created July 30, 2018 07:28
How to add sweat alert in laravel 5.4 or >5.4
Installation ->
First, pull in the package through Composer.
composer require uxweb/sweet-alert
If using laravel < 5.5 include the service provider and alias within config/app.php.
'providers' => [
UxWeb\SweetAlert\SweetAlertServiceProvider::class,
];