Skip to content

Instantly share code, notes, and snippets.

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

Pascale Beier PascaleBeier

🏠
Working from home
View GitHub Profile
@PascaleBeier
PascaleBeier / typo3-bootstrap-nav-without-dropdown.ts
Created November 27, 2015 08:23
TYPO3 - Bootstrap 4 Navigation without Dropdown
rcnav = HMENU
rcnav.wrap (
<nav class="navbar rc-nav">
<button class="navbar-toggler hidden-md-up" data-target="#rc-nav" data-toggle="collapse" type="button">&#9776; Menü</button>
<div class="collapse navbar-toggleable-sm" id="rc-nav">
<ul class="nav navbar-nav container">|</ul>
</div>
</nav>
)
rcnav.entryLevel = 0
@PascaleBeier
PascaleBeier / typo3-bootstrap-dropdown.t3
Last active December 31, 2019 08:44
TYPO3 - Bootstrap 4 navigation with dropdown
page.10.marks {
# MENU
rcnav = HMENU
rcnav.wrap (
<nav class="navbar rc-nav">
<button class="navbar-toggler hidden-md-up" data-target="#rc-nav" data-toggle="collapse" type="button">&#9776; Menü</button>
<div class="collapse navbar-toggleable-sm" id="rc-nav">
<ul class="nav navbar-nav container">|</ul>
</div>
<?= wp_count_posts()->publish ?>
<?php
if ( is_home() ) { ?>
<meta name="description" content="In meinem Blog gibt es schon <?= wp_count_posts()->publish ?> Beiträge.">
<?php }
@PascaleBeier
PascaleBeier / convert.php
Created January 12, 2017 12:56
Strip HTML Attributes from File
#!/usr/bin/env php
<?php
$openedFile = file_get_contents(__DIR__.'/'.$argv[1], 'r');
$convertedString = preg_replace('/\s(color|size|class|id|style)="[^"]+"/', '', $openedFile);
$newFile = fopen(__DIR__.'/'.$argv[2], 'w');
fwrite($newFile, $convertedString);
@PascaleBeier
PascaleBeier / functions.php
Last active March 12, 2017 17:28
meta-description-spengler
function add_custom_meta_description() {
global $post;
$current_post = $post->ID;
$excerpt = get_the_excerpt( $current_post );
$cf_description = get_post_meta( $current_post, "description", true );
$output = 0;
if ( ! empty( $cf_description ) ) {
$output = $cf_description;
@PascaleBeier
PascaleBeier / Caddyfile
Created April 25, 2018 20:08
TYPO3 Caddyfile
pascalebeier.test:80
tls off
on startup C:\tools\php72\php-cgi.exe -b 6545 &
fastcgi / 127.0.0.1:6545 php
rewrite {
if {path} not_match ^\/typo3
to {path} {path}/ /index.php?{query}
}