Skip to content

Instantly share code, notes, and snippets.

View josefglatz's full-sized avatar
👨‍💻

Josef Glatz josefglatz

👨‍💻
View GitHub Profile
@josefglatz
josefglatz / ConnectNetworkShare.scpt
Last active September 15, 2023 16:05
AppleScript Network Share Connect
-- Handy script for mounting a network share
-- v1.0 2017-01-17, <[email protected]>
-- v1.1.0 2017-01-17, <[email protected]>
set shareName to "Projekte" -- assign share name
set nasIp to "10.0.0.2" -- assign IP of NAS/server
set pingCount to 1
set pingTimeout to 10
tell application "Finder"
@josefglatz
josefglatz / regex
Created November 25, 2016 08:16
Useful TYPO3 regex
# PhpStorm: all comments e.g. in localconf.php
(^)?(//).+
@josefglatz
josefglatz / Table-tt_address-optimal-fieldtype.sql
Created November 24, 2016 14:18
MySQL optimal fieldtype field data type
select * from tt_address PROCEDURE ANALYSE(1,10);
# --
# typo3.tt_address.skype foo 0 27 92 75 3.1215 NULL VARCHAR(27)
# --
@josefglatz
josefglatz / Custom TYPO3 CE
Last active September 29, 2016 11:13
Simple Custom TYPO3 CE
// PageTSConfig
mod.wizards.newContentElement.wizardItems {
homepage {
header = Homepage
show = *
elements {
theme-sujet {
title = Big Sujet
description = Main sujet with slider images
tt_content_defValues {
@josefglatz
josefglatz / SrcsetImage.html
Created September 25, 2016 20:24
Typo3 Fluid sourceset image partial with VHS
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
xmlns:f="http://xsd.helhum.io/ns/typo3/cms-fluid/master/ViewHelpers"
data-namespace-typo3-fluid="true">
<f:section name="SrcsetImage">
<f:if condition="{image}">
<v:variable.set name="imgurl" value="{f:uri.image(image: image,maxWidth: '{maxWidth}')}" />
<v:variable.set name="imgsize" value="{v:media.image.width(src:'{imgurl}')}" />
<v:variable.set name="img480" value="{f:uri.image(image: image,maxWidth:'480')} 480w," />
tt_content.customcontentelement = COA
tt_content.customcontentelement {
10 = FILES
10 {
references {
table = tt_content
uid.data = field:uid
fieldName = image
}
begin = 0
@josefglatz
josefglatz / stdWrap.replacement.replaceMultilineHtmlMarkupRegex.setupts
Created May 3, 2016 13:11
TYPO3 CMS stdWrap example "replacement :: Replace multiline html markup via regex"
page {
stdWrap.replacement {
10 {
search = #<div class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">[\n\r\s]+<img src="/fileadmin/template/img/toggle.png" />[\n\r\s]+</div>#i
useRegExp = 1
replace.stdWrap.cObject = COA
replace.stdWrap.cObject {
// ... replacement stuff
@josefglatz
josefglatz / StripATagsViewHelper.php
Created April 28, 2016 05:34
TYPO3 CMS Fluid ViewHelper "StripATagsViewHelper", "Strip all anchor tags viewhelper"
<?php
namespace O10\Theme\ViewHelpers;
/**
* Removes a tags from the given string
*
* ViewHelper initially implemented to use with TYPO3 CMS 6.2.x
*/
class StripATagsViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
{
@josefglatz
josefglatz / count+groupby-example.sql
Created April 20, 2016 10:43
MySQL Count GroupBy Combo (e.g. TYPO3 Camp T-Shirt overview ;-] )
# Create a database table
# Add necessary fields
# Import csv and map fields
# run if you table is named "Shirts" and the T-Shirt size column is named "Size"
SELECT Size,COUNT(*) FROM Shirts GROUP BY Size;
lib.View.SingleSujet = FILES
lib.View.SingleSujet {
references {
table = tx_news_domain_model_news
uid.data = GP:tx_news_pi1|news
fieldName = fal_media
}
begin = 0
maxItems = 1