Skip to content

Instantly share code, notes, and snippets.

View josefglatz's full-sized avatar
👨‍💻

Josef Glatz josefglatz

👨‍💻
View GitHub Profile
@josefglatz
josefglatz / setup.ts
Created December 6, 2012 08:30
easy linebreaks within lib.stdheader.10.1
######
# Modify stdHeader (infinite linebreaks with a "|")
######
lib.stdheader.10.1.replacement {
10 {
search = |
replace = <br />
}
}
@josefglatz
josefglatz / Vagrantfile
Created March 17, 2013 13:21
Vagrantfile for Vagrant 1.1.0 + VMware Fusion Pro (Ubuntu Precise 64 Box)
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define :web do |web|
# Every Vagrant virtual environment requires a box to build off of.
web.vm.box = "precise64"
@josefglatz
josefglatz / TYPO3CMS TypoScript Keyvisual
Last active December 17, 2015 05:38
Task: have all images from pages media field listed in TypoScript, for example to use in a slideshow. (Compatible only with >= TYPO3 6-0)
## list images from pages:media in TypoScript using FAL and crop it automatically
lib.View.Keyvisual = FILES
lib.View.Keyvisual {
references {
data = levelmedia:-1, slide
}
renderObj = COA
renderObj {
10 = IMAGE
####--------------------------------------
#
# Remove JS and CSS EXT:powermail (v1.6.9)
#
####--------------------------------------
#----------------------------
# CONSTANTS
@josefglatz
josefglatz / Another Wrap for first CE in colPos 0
Last active December 20, 2015 23:18
TYPO3 CMS ext:css_styled_content lib.stdheader beginn with <h2> && <h1> for first CE in colPos 0
######
# Ändern der stdHeader (damit er nicht bei h1 beginnt)
######
lib {
stdheader {
10 {
stdWrap.wrap >
1.dataWrap = <h2>|</h2>
## set's first
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/su root -c echo '*' >> /etc/exports
@josefglatz
josefglatz / gist:9960496
Last active October 29, 2015 09:37
Testing new TYPO3 CMS 6.2 stdWrap replacement option "useOptionSplitReplace"
plugin.tx_imagecycle_pi3.nivo.normal.captionWrap {
stdWrap {
replacement {
// replaces first pipe to <h2> (opening tag)
// replaces second pipe to </h2> (closing tag)
10 {
search = #[|]#i
replace = <h2> || </h2>
useOptionSplitReplace = 1
useRegExp = 1
on alfred_script(q)
-- Idea from https://coderwall.com/p/fyfp0w
-- automatic connect/disconnect (added 2014-08-25)
-- disable wifi on connect (added 2014-09-01)
-- Some required settings to get this connect script working
-- Set target bluetooth device
-- Set label of item to "click"
set DeviceToConnect to "jousch.com"
set ConnectLabel to "Mit Netzwerk verbinden"
@josefglatz
josefglatz / updateFileRelationsWithoutMmRelatio-SNIPPET.php
Last active August 29, 2015 14:04
ext:news v1.3.1 to v2.3.1: Update related files to mm relations (if you are using MM relation)
<?php
protected function updateFileRelations() {
$title = "Update related files";
$countNewsWithFileRelation = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', 'tx_news_domain_model_news', 'deleted=0 AND related_files != ""');
$countFilesWithParent = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', 'tx_news_domain_model_file', 'deleted=0 AND parent != 0');
if ($countFilesWithParent === 0 && $countNewsWithFileRelation > 0) {
$newsCount = 0;
// select news with related files
$newsQuery = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,related_files', 'tx_news_domain_model_news', 'deleted=0 AND related_files !=""');
while ($newsRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($newsQuery)) {
@josefglatz
josefglatz / fn.exists.js
Created August 5, 2014 23:09
jQuery tiny "exists" plugin
/*
* if exists method - a tiny jquery plugin <3
* by Josef Florian Glatz <jousch@gmail.com>
*
*/
$.fn.exists = function(callback) {
var args = [].slice.call(arguments, 1);
if (this.length) {
callback.call(this, args);