$ brew install moreutils
$ brew install git bash-completion
$ vi $HOME/.bash_profile
# Workaround for broken rel attribute of lightbox links in TYPO3 8.7 | |
# See https://forge.typo3.org/issues/72779 | |
lib.contentElement.variables.10 = LOAD_REGISTER | |
lib.contentElement.variables.10.content_uid = TEXT | |
lib.contentElement.variables.10.content_uid.field = uid | |
lib.contentElement.settings.media.popup.linkParams.ATagParams.dataWrap = class="{$styles.content.textmedia.linkWrap.lightboxCssClass}" rel="{$styles.content.textmedia.linkWrap.lightboxRelAttribute}[{register:content_uid}]" | |
lib.contentElement.stdWrap.append = RESTORE_REGISTER |
sudo apt-get install xbindkeys | |
echo ' | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrev' >> ~/.xbindkeysrc | |
# When upgrading to Ubuntu 20.04 the keys didn't work at first, so Chrome had to be configured to let go of those keys: https://askubuntu.com/a/1239618/214134 |
# Pull the remote branch of the same name by default | |
git config --global pull.branch current | |
# Push the local branch to remote with the same name by default | |
git config --global push.branch current | |
# Use vim as default editor | |
git config --global core.editor "vim" | |
# Show indicator in git prompt whenever the status isn't clean | |
GIT_PS1_SHOWDIRTYSTATE=true |
# Help based on https://gist.github.com/prwhite/8168133 thanks to @nowox and @prwhite | |
# And add help text after each target name starting with '\#\#' | |
# A category can be added with @category | |
HELP_FUN = \ | |
%help; \ | |
while(<>) { push @{$$help{$$2 // 'options'}}, [$$1, $$3] if /^([\w-]+)\s*:.*\#\#(?:@([\w-]+))?\s(.*)$$/ }; \ | |
print "\nusage: make [target ...]\n\n"; \ | |
for (keys %help) { \ | |
print "$$_:\n"; \ |
<?php | |
namespace Vendor\Extension\View\Record; | |
class ListJson extends \TYPO3\CMS\Extbase\Mvc\View\JsonView { | |
private static $uriBuilder = null; | |
public function typolink($page, $uid = null) { | |
if ($page) { | |
if (self::$uriBuilder === null) { |
// ext_tables.sql | |
CREATE TABLE tx_xxxxxxx_domain_model_record ( | |
... | |
type int(11) unsigned DEFAULT '0', | |
... | |
); | |
// TCA | |
'type' => [ | |
'exclude' => false, |
-- Wanna export a joined result? | |
SELECT a.id, a.name, b.name | |
FROM tableA a | |
JOIN tableB b ON a.id = b.rel_id | |
WHERE a.deleted=0 and b.deleted=0 | |
ORDER BY a.name, b.nane | |
INTO OUTFILE '/var/lib/mysql-files/xxxx.csv' | |
FIELDS TERMINATED BY ',' | |
ENCLOSED BY '"' | |
LINES TERMINATED BY '\n'; |
-- Determine MySQL table size | |
SELECT | |
TABLE_NAME, table_rows, data_length, index_length, | |
round(((data_length + index_length) / 1024 / 1024),2) 'Size in MB' | |
FROM information_schema.TABLES | |
WHERE TABLE_TYPE='BASE TABLE' AND table_schema = 'typo3' | |
ORDER BY data_length ASC; | |
-- Is MySQL configured to use separate files per table? | |
SELECT @@innodb_file_per_table; |
-- Find out what charset and collation the DB has: | |
SELECT SCHEMA_NAME 'database', default_character_set_name 'charset', DEFAULT_COLLATION_NAME 'collation' | |
FROM information_schema.SCHEMATA; | |
-- Find out what charset and collation the tables have: | |
SELECT T.table_name, CCSA.character_set_name, CCSA.collation_name FROM information_schema.`TABLES` T, | |
information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA | |
WHERE CCSA.collation_name = T.table_collation | |
-- Change charset and collation of DB: |