Skip to content

Instantly share code, notes, and snippets.

@ludwigmair
ludwigmair / gist:4017957
Created November 5, 2012 15:56 — forked from kitsunet/gist:1845639
TYPO3: page teaser
lib.myContent = COA
lib.myContent {
10 < styles.content.get
10.select.pidInList = INSERT_YOUR_PAGE_ID_HERE
10.stdWrap.stripHtml = 1
10.stdWrap.crop = 100 | ... | 1
20 = TEXT
20.value = READ MORE
20.typolink.parameter = INSERT_YOUR_PAGE_ID_HERE
@ludwigmair
ludwigmair / ext_tables
Created November 6, 2012 21:30 — forked from kitsunet/ext_tables
multi plugin extbase
Tx_Extbase_Utility_Extension::configurePlugin(
$_EXTKEY,
'Frontend',
array(
'Post' => 'list, archivelist, latestlist, show',
'Comment' => 'create',
),
// non-cacheable actions
array(
@ludwigmair
ludwigmair / snippet.xml
Created November 10, 2012 04:50 — forked from JeffreyWay/snippet.xml
Laravel Resource - Sublime Text 2 Snippet
<snippet>
<content><![CDATA[
// ${1} Resource
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index'));
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show'));
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new'));
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit'));
Route::post('${1}s', '${1}s@create');
Route::put('${1}s/(:any)', '${1}s@update');
Route::delete('${1}s/(:any)', '${1}s@destroy');
@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.
*/

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
<?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);
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
}
@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

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 / 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(