Skip to content

Instantly share code, notes, and snippets.

View tbaddade's full-sized avatar

Thomas Blum tbaddade

  • @yakamara Media GmbH & Co. KG
  • Dresden, Germany
View GitHub Profile
@staabm
staabm / navigation_iterator.php
Last active July 30, 2020 14:07
redaxo navigation iterator
<?php
/**
* Klasse zum Erstellen von Navigationen, v0.1.
*
* benötigt PHP7!
*
* @package redaxo\structure
*/
@gharlan
gharlan / Modul mit Wrapper.php
Last active August 1, 2016 19:42
Module mit Wrapper
<?php
if (rex::isBackend()) {
// Ausgabe im Backend ohne Wrapper
echo 'item';
return;
}
// Aktueller Slice
$slice = '<li>item</li>';
<?php
if (!function_exists('pr')) {
function pr()
{
array_map(function ($x) {
echo '<pre>'; print_r($x); echo '</pre>';
}, func_get_args()); die;
}
@tbaddade
tbaddade / ctypes_sort_r4.php
Last active July 30, 2020 14:03
REDAXO - Ctypes sortieren
<?php
/*
REDAXO 4.5 - Ctypes sortieren
Sortierung erfolgt mit vorangestellter Zahl beim Ctypenamen im Template.
Bspl:
01 - Inhalt
02 - rechte Spalte
@tbaddade
tbaddade / slices_sort.php
Last active July 30, 2020 14:09
REDAXO :: sortieren der Slices eines Artikels
<?php
// -------------------------------- Einstellungen
$article_id = 2; // Artikel Id
$clang = false; // Sprachen Id --------- false = aktuelle Sprache
$ctype = 0; // Ctype Id ------------ 0 = alle Ctypes
$slices_amount = 2; // Anzahl der Slices --- 0 = alle Slices
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: