Skip to content

Instantly share code, notes, and snippets.

@tfeuerst
tfeuerst / gist:7319413
Last active December 27, 2015 11:29 — forked from maddy2101/gist:5668835
Modified Version for V6.1
SQL:
images int(11) unsigned DEFAULT '0',
=======================================================
TCA
....
'images' => array(
'exclude' => 0,
'label' => 'images',
# 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('images'),
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
tt_content.gridelements_pi1 {
# Display Headline above each grid element
//10 = < lib.stdheader
10 = CASE
10 {
key.field = tx_gridelements_backend_layout
default =< lib.stdheader
# Hide header on Tab ELEMENT
7 = TEXT

Multiple sys_category fields in one table

When your table has more than 1 field with relations to sys_category you will run into problems because the MM relation table sys_category_record_mm will only store which table a category belongs to - but not the specific field.

You need to extend sys_category_record_mm like this:

Add the following to your extension's ext_tables.sql:

CREATE TABLE sys_category_record_mm (
# bootstrap.yml
---
- hosts: newservers
vars:
- ubuntu_release: raring
- logwatch_email: <your email addy>
# crypted passwords, generated on a Linux box using:
# echo 'import crypt,getpass; print crypt.crypt(getpass.getpass(), "$6$YOURSALT")' | python -
- root_password: ''

Requirements for deployment

  • ssh (generate key and put on server)
  • make sure rsync is available on both servers

Needed info for each target system:

  • deploy directory
  • repository URL
  • database name
@tfeuerst
tfeuerst / 4ffd0b928327fe8b8edcadb94bedc2dc.html
Created November 22, 2017 07:33 — forked from pricejn2/4ffd0b928327fe8b8edcadb94bedc2dc.html
responsive ad unit with revive ad server
<div id="revive-responsive-top" style="display: block; text-align: center;">
<script type="text/javascript">
adUnit = document.getElementById("revive-responsive-top");
adWidth = adUnit.offsetWidth;
if ( adWidth >= 728 ) {
/* Leaderboard 728x90 */
adUnit.innerHTML = '<ins data-revive-zoneid="3" data-revive-id="4689b54ec658f530f3250f4124e7f1ea"></ins>';
} else {
@tfeuerst
tfeuerst / default.conf
Created November 22, 2017 07:33 — forked from cbmd/default.conf
nginx config - dynamic virtual hosts
server {
index index.php;
set $basepath "/var/www";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "^(.[^.]*)\.dev$") {
set $domain $1;
set $rootpath "${domain}";
@tfeuerst
tfeuerst / wget--crawl.sh
Created November 19, 2019 13:08 — forked from steveosoule/wget--crawl.sh
Wget - Options & Sample Crawler
#!/bin/sh
# wget --mirror --adjust-extension --page-requisites --execute robots=off --wait=30 --rand om-wait --convert-links --user-agent=Mozilla http://www.example.com
### V1
# wget \
# --recursive \
# --no-clobber \
# --page-requisites \
# --html-extension \
@tfeuerst
tfeuerst / background.js
Created May 19, 2020 10:06 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@tfeuerst
tfeuerst / warm_varnish
Created December 10, 2020 09:45 — forked from jaseclamp/warm_varnish
Warm Varnish Cache
#!/bin/bash
# this script will
# a. crawl the designated site X levels deep to generate a urls list
# b. completely purge all urls on the desisgnated varnish servers for the designated url
# c. clear cache on nginx / mod pagespeed for the designated app servers
# d. individually warm all the listed urls on each designated varnish server
# e. rewarm them in case pagespeed sent a purge request
# define some variables