Skip to content

Instantly share code, notes, and snippets.

View hojaonline's full-sized avatar
🏠
Working from home

Hoja Mustaffa Abdul Latheef hojaonline

🏠
Working from home
View GitHub Profile
@hojaonline
hojaonline / Hooks.php
Created February 4, 2021 19:21
DataHandlerHooks
<?php
// Some of the hooks might be expired
/* Write following in ext_localconf.php */
/*======================================*/
$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['extkey'] = 'Vendor\\Extension\\Hook\\TCEmainHook';
$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['extkey'] = 'Vendor\\Extension\\Hook\\TCEmainHook';
/* Create hook class /Classes/Hook/TCEmainHook.php, Choose appropriate function from below list */
/*==============================================================================================*/
@hojaonline
hojaonline / select.xml
Created June 13, 2019 13:44
flexform select field
<label>Selectbox with fixed value field</label>
<config>
<type>select</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">choice 1</numIndex>
<numIndex index="1">value 1</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">choice 2</numIndex>
@hojaonline
hojaonline / git-tag-delete-local-and-remote.sh
Created January 24, 2019 07:41 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@hojaonline
hojaonline / Readme.md
Created December 18, 2018 06:35
Docker Permission Issue in Ubuntu

Problem: You are trying to run a docker container or do the docker tutorial, but you only get an error message like this:

docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.26/containers/create: dial unix /var/run/docker.sock: connect: permission denied. See 'docker run --help'. Solution: The error message tells you that your current user can’t access the docker engine, because you’re lacking permissions to access the unix socket to communicate with the engine.

As a temporary solution, you can use sudo to run the failed command as root. However it is recommended to fix the issue by adding the current user to the docker group:

Register your hook class in local configuration (ext_localconf.php):

` $GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][''] = 'NXS\NxsReferenzen\Hook\TCEmainHook';

$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][''] = 'NXS\NxsReferenzen\Hook\TCEmainHook';`

Ensure your hook class has namespace declaration: `

Guidelines for ext_localconf.php and ext_tables.php
Description
Each extension has two easy ways to extend TYPO3 Core, as the TYPO3 Bootstrap loads all active extensions and include the following files of all extensions, depending on the loading order of the extensions' dependencies located in ext_emconf.php:
1. ext_localconf.php This file is included at every request of TYPO3 (Frontend, Backend, CLI) at a very early stage, just after the global configuration is loaded and the Package Manager knows which extensions are active.
2. ext_tables.php This file is only included when
a TYPO3 Backend or CLI request is happening
@hojaonline
hojaonline / import-tar-gz.sh
Created May 11, 2018 22:19 — forked from infusion/import-tar-gz.sh
Import a tar.gz file to MySQL
tar xzOf dump.sql.tar.gz | mysql -u $user -p $database
@hojaonline
hojaonline / config.ts
Last active May 4, 2018 10:49
Setting BaseUrl in TYPOSCRIPT
[globalString = ENV:HTTP_HOST = www.example.de]
baseURL = http://www.example.de/
domain = www.example.de
absRefPrefix = /
[global]
[globalString = ENV:HTTP_HOST = www.example.de] && [globalString = ENV:HTTPS=on]
baseURL = https://www.example.de/
domain = www.example.de
absRefPrefix = /
[global]
@hojaonline
hojaonline / Git PUSH.md
Created April 10, 2018 07:38
Push from local branch to another remote branch (Create new Branch in Remote if not exits)

git push origin local-name:remote-name

@hojaonline
hojaonline / AddRemotePackage.md
Last active April 6, 2018 09:32
add a new package wich is not at packagist, it's a local or non-public repository

You can run the following from the project root to add a repository to the project's composer.json

composer config repositories.repo-name vcs https://github.com/my/repo

and then add the package with

composer require package-name:dev-branchname