Skip to content

Instantly share code, notes, and snippets.

<?php
namespace My\Package\Service;
use TYPO3\Flow\Annotations as Flow;
/**
* @Flow\Scope("singleton")
*/
class EmailService {
@kroell
kroell / Wordpress Bootstrap Nav
Created July 15, 2015 21:08
Wordpress Bootstrap Nav
<nav class="navbar navbar-default" role="navigation" style="margin-bottom: 0;">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@kroell
kroell / NewsController.php
Last active December 7, 2015 14:09
Extbase additional Header Metatags
/**
* Add dynmic metatags to response header in Extbase
*
* @param News $news
* @return void
*/
protected function addMetaDataToHeader(News $news){
$this->response->addAdditionalHeaderData('<meta property="og:title" content="'. htmlspecialchars($news->getTitle()).'"/>');
$this->response->addAdditionalHeaderData('<meta name="description" content="'. htmlspecialchars($news->getTeaserText()) .'">');
$this->response->addAdditionalHeaderData('<meta name="author" content="'.$author.'">');
@kroell
kroell / Caches.yaml
Created June 22, 2018 09:28 — forked from aertmann/Caches.yaml
Use Redis or Memcached cache backends for optimizing certain caches that has tags which become slow with lots of content in Neos – Included in https://speakerdeck.com/aertmann/tasty-recipes-for-every-day-neos
# Redis (has to be configured to different databases on shared hosting)
TYPO3_TypoScript_Content:
backend: TYPO3\Flow\Cache\Backend\RedisBackend
backendOptions:
defaultLifetime: 0
Flow_Mvc_Routing_Resolve:
backend: TYPO3\Flow\Cache\Backend\RedisBackend
backendOptions:
defaultLifetime: 0
@kroell
kroell / sphp.sh
Last active January 25, 2022 09:30
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
# Original => https://gist.github.com/rhukster/f4c04f1bf59e0b74e335ee5d186a98e2
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
brew_array=("5.5","5.6","7.0","7.1","7.2", "7.3", "7.4", "8.0")
php_array=("php@5.5" "php@5.6" "php@7.0" "php@7.1" "php@7.2" "php@7.3" "php@7.4" "php@8.0")
valet_support_php_version_array=("php@5.5" "php@5.6" "php@7.0" "php@7.1" "php@7.2" "php@7.3" "php@7.4" "php@8.0")
php_installed_array=()
@kroell
kroell / generate-ssh-key.sh
Created January 14, 2021 10:55 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@kroell
kroell / tailwind-v1.config.js
Created January 30, 2023 18:28 — forked from thinkverse/tailwind-v1.config.js
Useful TailwindCSS config that saves paddings and margins upon build
// https://v1.tailwindcss.com/docs/controlling-file-size#purge-css-options
module.exports = {
future: {
removeDeprecatedGapUtilities: true,
purgeLayersByDefault: true,
},
purge: {
content: ['./public/**/*.html'],
options: {
whitelistPatterns: [