Skip to content

Instantly share code, notes, and snippets.

View InvisibleKind's full-sized avatar

Viktor Livakivskyi InvisibleKind

  • Leonberg, Germany
View GitHub Profile
@InvisibleKind
InvisibleKind / ec2-startup.sh
Created March 20, 2017 16:01 — forked from ReedD/ec2-startup.sh
User data for EC2 to set up Docker and Compose (Fig) for ec2-user
#!/bin/sh
export PATH=/usr/local/bin:$PATH;
yum update
yum install docker -y
service docker start
# Docker login notes:
# - For no email, just put one blank space.
# - Also the private repo protocol and version are needed for docker
# to properly setup the .dockercfg file to work with compose
@InvisibleKind
InvisibleKind / drop.sql
Last active April 1, 2016 16:54
Drop all db tables
SET SESSION group_concat_max_len = 1000000;
SELECT GROUP_CONCAT(r1.query SEPARATOR "\n") AS copy_and_paste FROM (SELECT concat("DROP TABLE IF EXISTS ", table_name, ";") AS query FROM information_schema.tables WHERE table_schema = "my-db-name") AS r1;
@InvisibleKind
InvisibleKind / composer.json
Created March 9, 2016 12:52
Custom zip-archive as composer package dependency
{
"type": "package",
"package": {
"name": "typo3-ter/fal_securedownload",
"type": "typo3-cms-extension",
"version": "1.0.0",
"dist": {
"url": "https://typo3.org/extensions/repository/download/fal_securedownload/1.0.0/zip/",
"type": "zip"
@InvisibleKind
InvisibleKind / regexp_ide_arrays
Last active August 29, 2015 14:08
Regexp for replacing array() with [] in #YOUR_IDE_NAME#
search: array\(([^\(\)]++)\)
replace with: [$1]
@InvisibleKind
InvisibleKind / child_update.sql
Created April 23, 2014 10:05
Update childs with value from parent field in TYPO3
update tx_smiproducts_domain_model_device as child
inner join tx_smiproducts_domain_model_device as parent
on child.l10n_parent=parent.uid
set child.starttime=parent.starttime
@InvisibleKind
InvisibleKind / locallang_changed.sh
Created January 24, 2014 15:46
Select only XLIFF and XML files, changed from last release
git diff --name-only HEAD v.1.1.0 | grep '.xlf\|.xml'
@InvisibleKind
InvisibleKind / remove_backup.sh
Created January 22, 2014 12:33
Remove backup files
find ./ -name '*~' | xargs rm
@InvisibleKind
InvisibleKind / anonymizer.sql
Created January 15, 2014 10:39
TYPO3 email (username) anonymizer on dev system
UPDATE `fe_users` SET username = CONCAT(md5(rand()), '@example.com'), email = username
@InvisibleKind
InvisibleKind / DataHandlerHooks.php
Last active December 16, 2016 16:08
ExtBase localization of child records
<?php
namespace Vendor\Product\Hooks;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Database\DatabaseConnection;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class DataHandlerHooks {
/**
@InvisibleKind
InvisibleKind / ContentController.php
Created December 11, 2013 18:52
Assign current cObject to Fluid
$this->view->assign('record', $this->configurationManager->getContentObject()->data);