Skip to content

Instantly share code, notes, and snippets.

@ludwigmair
ludwigmair / install.sh
Created September 11, 2016 07:01 — forked from helhum/install.sh
Unattended TYPO3 7LTS installation (including introduction package)
composer create-project typo3/cms-base-distribution='^7.6.0' my-test-typo3 --no-interaction
cd my-test-typo3/
composer require helhum/typo3-console
# This will only work with PHP < 7 as realurl need PHP 5.x
composer require typo3-ter/introduction
cp web/typo3conf/ext/typo3_console/Scripts/typo3cms .
cp web/typo3conf/ext/bootstrap_package/Configuration/Apache/.htaccess web/
chmod +x typo3cms
./typo3cms install:setup --non-interactive --database-user-name="root" --database-user-password="root" --database-host-name="localhost" --database-port="3306" --database-name="t3_my_test" --admin-user-name="admin" --admin-password="password" --site-name="Auto Install"
./typo3cms database:updateschema '*.*'
@ludwigmair
ludwigmair / Favicon.html
Created September 11, 2016 06:56
Typo3 Fluid Partial to render Favicon Set (fluid / 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="Favicon">
{v:variable.set(name:'iconurl', value:'EXT:amtemplate/Resources/Public/Icons/Device/Icon.png')}
{f:uri.image(src:'{iconurl}', width: '57', height: '57') -> v:format.substring(start: 1) -> v:variable.set(name:'icon57')}
{f:uri.image(src:'{iconurl}', width: '114', height: '114') -> v:format.substring(start: 1) -> v:variable.set(name:'icon114')}
{f:uri.image(src:'{iconurl}', width: '72', height: '72') -> v:format.substring(start: 1) -> v:variable.set(name:'icon72')}
@ludwigmair
ludwigmair / SrcsetImage.html
Created September 11, 2016 06:56
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," />
@ludwigmair
ludwigmair / UsingAjaxUrl.html
Created September 11, 2016 06:54 — forked from helhum/UsingAjaxUrl.html
Using TS rendering
{namespace t=Helhum\TyposcriptRendering\ViewHelpers}
<button class="ajax-button" data-ajaxUri="{t:uri.ajaxAction(action: 'foo', controller: 'bar') -> f:format.htmlentities()}">
Click Me
</button>
<script type="text/javascript">
jQuery.ajax(
jQuery(".ajax-button").data("ajaxUri")
).done(

Requirements for deployment

  • ssh (generate key and put on server)
  • rsync must be available on both machines (deployment host and target host)
  • PHP cli binary must be available on both machines (deployment host and target host)
  • composer must be available on deployment host

Needed info for each target system:

  • deploy directory
@ludwigmair
ludwigmair / gitlab_typo3_setup.md
Created June 18, 2016 20:46 — forked from smichaelsen/gitlab_typo3_setup.md
Setting up a Build Server for TYPO3 projects on Gitlab.com

Setting up a Build Server for TYPO3 projects on Gitlab.com

Background

We're a small team of only two people, but we're tackling more and more rather big TYPO3 projects. Over time we introduced package management for PHP (composer) and JS (bower) and depended on frontend building with Grunt. With rising complexity and importance of our projects we felt the demand for an efficient and safe way to deploy our websites on different servers.

We helped our selves with small self written deploy scripts that performed building on the target server, but you can't run node (for Grunt) or sass in every environment, and if building goes wrong the website was likely to be broken on the live server - so we needed a Build Server.

But solutions we looked at turned out to be quite time consuming (setting up and managing self hosted Gitlab and Gitlab-CI or a Jenkins server and runners) or costly.

Free Hosting on Gitlab.com

ajax = PAGE
ajax {
# You don't need to change this typeNum
typeNum = 1249058000
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:application/json
xhtml_cleaning = 0
admPanel = 0
}
<?php
// >= 5.4
$date1 = new DateTime('2013-02-05');
$date2 = new DateTime('2013-03-05');
$interval = $date1->diff($date2);
// Suppose you only want to display the days
printf("difference %d days <br>",$interval->days);

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
@ludwigmair
ludwigmair / gist:4163444
Created November 28, 2012 19:23 — forked from thehydroimpulse/gist:2872907
A Laravel task generator. Models, Migrations and Controllers.
<?php
/**
* @copyright 2012 TheHydroImpulse, Daniel Fagnan
* @version 0.1
* @todo Add an overwite ability. Among other things.
* @note Use this as you wish. Extend it, Mash it. Enjoy it.
*/