Skip to content

Instantly share code, notes, and snippets.

View BugBuster1701's full-sized avatar
🏠
Working from home

Glen Langer BugBuster1701

🏠
Working from home
  • T-Systems
  • Berlin, Germany
View GitHub Profile
@BugBuster1701
BugBuster1701 / gist:4b7a1fafe59fd65fd656
Created May 13, 2014 09:59
Contao und dynamischer Pfad für die Initialisierung
<?php
/*
* Damit ist es egal ob das Modul von composer normal als ZIP geladen und entpackt wird
* oder per git clone und dynamischen links, wodurch die Verzeichnisebene eine andere wird
*/
/**
* Initialize the system
*/
$dir = __DIR__;
@BugBuster1701
BugBuster1701 / gist:11403025
Created April 29, 2014 15:04
Custom Content Elements
<Paratron> hier ist das plugin: http://rocksolidthemes.com/de/contao/plugins/custom-content-elements
<Paratron> das hier ist zum beispiel eine config file die ich für ein Personenprofil angelegt habe:
https://dl.dropboxusercontent.com/u/16384823/rsce_profil_config.json
[16:57] <Paratron> nicht erschrecken, die hat einfach nur viele eingabefelder
[16:58] <Paratron> so stellt sich das dann im backend dar: https://db.tt/wdA5PkWI
[16:59] <Paratron> und das macht das template aus den angaben im backend: https://db.tt/JMAnySzJ
@BugBuster1701
BugBuster1701 / gist:7571132
Created November 20, 2013 21:11
alternative to file_get_contents when allow_url_fopen is disabled
function url_get_contents ($Url) {
if (!function_exists('curl_init')){
die('CURL is not installed!');
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $Url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
return $output;
https://github.com/contao/core/issues/4622#issuecomment-23447915
@BugBuster1701
BugBuster1701 / gist:7061717
Last active December 26, 2015 00:09
Gags
telnet towel.blinkenlights.nl
Windows: tracert /h 254 obiwan.scrye.net.
Linux/Mac: traceroute -m 254 -q1 obiwan.scrye.net.
http://www.lindesbs.de/contao-hub/start.html
@BugBuster1701
BugBuster1701 / gist:7023513
Created October 17, 2013 11:49
Script von wdp zur Migration von singleSRC und multiSRC von Pfad zur ID in der Tabelle tl_content Dazu müssen die Bilder/Dateien selbst schon gesynct in tl_files vorliegen.
<?php
error_reporting(E_ALL ^ E_NOTICE);
$dbUser = '';
$dbData = '';
$dbPass = '';
$dbHost = '';
/**
* DO NOT RUN THIS SCRIPT TWICE YET!!!
@BugBuster1701
BugBuster1701 / gist:7006084
Created October 16, 2013 11:05
Responsive Hack
<?php
if ($this->addImage):
$widthMid = round($this->arrSize[0] * .8);
$heightMid = round($this->arrSize[1] * .8);
$css = <<<EOF
@media screen and (max-width: 1290px) {
#img{$this->id} {
width: {$widthMid}px;
height: {$heightMid}px;
@BugBuster1701
BugBuster1701 / gist:6320635
Created August 23, 2013 15:31
C3: SQL Cache per hack deaktivieren
https://github.com/contao/core/blob/master/system/modules/core/library/Contao/Database/Statement.php#L266
Zeile remarken/löschen
@BugBuster1701
BugBuster1701 / gist:5646051
Last active December 17, 2015 17:29
composer Links
http://getcomposer.org
https://github.com/composer/composer
https://packagist.org/
http://mkleine.de/blog/2013/08/29/mit-composer-und-github-arbeiten/ (inkl. wie in packagist veröffentlichen)
http://blog-das-oertchen.de/archive/201303/php-composer-und-die-sache-mit-den-abhaengigkeiten
http://www.php.de/php-einsteiger/98949-guide-composer-kickstart-guide.html
http://de.slideshare.net/mayflowergmbh/php-dependency-und-paket-management-mit-composer
http://www.ymc.ch/composer-dependency-management-fur-php
http://blog.mayflower.de/866-Dependency-Management-mit-Composer.html
@BugBuster1701
BugBuster1701 / gist:5577544
Created May 14, 2013 16:55
Hinweise zur Nutzung von DBAFS, bei Anlieferung von Dateien von extern und Sichtbarkeit im Frontend (hier download)
There are three possible solutions:
Do not use the core downloads element, which relies on the DBAFS. Program a custom module instead.
Use the Dbafs::synchronize() method (Contao 3.1) in a daily cron job.
Enhance the report generation script to register the new files in the DBAFS. You can use the Dbafs class (Contao 3.1) for this as well.