Skip to content

Instantly share code, notes, and snippets.

View vijayrami's full-sized avatar
🎯
Magento2

Vijay Rami vijayrami

🎯
Magento2
View GitHub Profile
@vijayrami
vijayrami / How To disable cache in Typo3 extension
Created December 3, 2015 14:11
How To disable cache in Typo3 extension
Add below code in your Extension controller file.
$GLOBALS['TSFE']->set_no_cache();
@vijayrami
vijayrami / How To Add Javascript File From Typo3 Extension
Created December 3, 2015 14:22
How To Add Javascript File From Typo3 Extension
Add Below line in your typo3 extension controller file.
$GLOBALS['TSFE']->getPageRenderer()->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('extension_key') . 'Resources/Public/javascript/yourjsfile.js',$compress = FALSE, $forceOnTop = FALSE, $allWrap = '');
-- Change Extension key and your JS file path.
@vijayrami
vijayrami / How To display error message in typo3
Created December 3, 2015 14:38
How To display error message in typo3
in typo3conf/LocalConfiguration.php file search for 'displayErrors'.
and set 'displayErrors' => 1,
Its done.
Now Error message will display at frontend.
@vijayrami
vijayrami / vendor_city_state.php
Last active April 8, 2016 06:18
Wordpress Get User Query
$country_m = $_REQUEST['country'];
$statu_m = $_REQUEST['state'];
$city_m = $_REQUEST['city'];
$query_args = array(
'role' => 'vendor',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'country',
@vijayrami
vijayrami / Linux_Commands.md
Last active May 26, 2021 04:47
Linux Command Useful tips for developers

Search text inside folder

grep -Hrn 'texttosearch' /opt/lampp/htdocs/projectfolder/directory

grep -R --exclude-dir={css,js,img,lang} 'texttosearch' /opt/lampp/htdocs/projectfolder/directory

upload large .sql file from terminal

mysql -u root -ppassword databasename < myfile.sql

For Windows

@vijayrami
vijayrami / laravelbasics.txt
Last active May 16, 2020 11:28
Laravel Basic Stuff
go to htdocs directory and run:
composer create-project --prefer-dist laravel/laravel laravel
php artisan serve
Go to
App\Providers\AppServiceProvider
add below line at the begining.
use Illuminate\Support\Facades\Schema;
and in function boot add:
composer require "santigarcor/laratrust"
Then in your config/app.php add the following to the providers array:
Laratrust\LaratrustServiceProvider::class,
add the following to the aliases array:
'Laratrust' => Laratrust\LaratrustFacade::class,
Run the next command to publish all the configuration files:
php artisan vendor:publish --tag="laratrust"
this will generate config\laratrust.php and \config\laratrust_seeder.php
@vijayrami
vijayrami / LoginController.php
Created April 13, 2020 14:08
Redirect to custom URL after logout on Laravel
<?php
.....
use Illuminate\Http\Request;
class LoginController extends Controller
{
.....
/**
* Logout trait
@vijayrami
vijayrami / CsvImportRequest.php
Created April 14, 2020 18:09
Create Custom request to apply validation
create file in App/Http/Requests/CsvImportRequest.php
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class CsvImportRequest extends FormRequest
{
/**
@vijayrami
vijayrami / magento_installation.txt
Last active April 25, 2020 08:48
Install Magento 1.9 (With Sample Data)
## Magento 1 + SampleData
gunzip magento-sample-data-1.9.2.4-2016-10-11-07-38-13.tar.gz
tar xf magento-sample-data-1.9.2.4-2016-10-11-07-38-13.tar
sudo apt-get update && \
sudo apt-get install -y git wget unzip
git clone https://github.com/OpenMage/magento-mirror.git ./ ;