Skip to content

Instantly share code, notes, and snippets.

@einpraegsam
einpraegsam / NotAuthorized.php
Last active October 23, 2024 20:07
Individual 403 and 404 handling in TYPO3 9 and 10. Show a 404 page but keep wrong URL. In case of a missing frontend login, redirect to login page and redirect back after login.
<?php
declare(strict_types=1);
namespace Vendor\Sitepackage\PageHandler;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Error\PageErrorHandler\PageErrorHandlerInterface;
use TYPO3\CMS\Core\Http\RedirectResponse;
use TYPO3\CMS\Core\Http\Uri;
use TYPO3\CMS\Core\Site\Entity\Site;
@onizuka17
onizuka17 / index.html
Created September 7, 2018 03:03
Slider and Lightbox :: slider (swiper.js) & Lightbox gallery (photoswipe.js)
<h1>
<a title="swiper.js" href="http://idangero.us/swiper/" target="_blank">Swiper.js (4.3.5)</a>
&
<a title="photoswipe" href="http://photoswipe.com/" target="_blank">Photoswipe.js (4.1.1)</a>
- Mobile Native feel slider gallery
</h1>
<p>Combine two of the most powerfull JS plugins (Endless options / Great docs / Fast / Modern / Mobile freindly) - <a title="swiper.js" href="http://idangero.us/swiper/" target="_blank">SWIPER</a> IS PERFECT FOR THIS IDEA BEACUSE OF ITS unique <code>preventClicks</code> Parameter (Prevent accidental unwanted clicks on links during swiping) - <strong>Works like magic</strong>. Also its really <b>hard</b> to find - Code example of working photoswipe combination with any slider out there(slick, flickity, owl etc.) and in general slider & lightbox - so i hope this example be usefull for you.</p>
<!-- Slider main container -->
<div class="swiper-container">
@rr-it
rr-it / powermail-textarea_multiline-emails.diff
Last active November 24, 2020 14:58
TYPO3 Powermail Issue on multi-line text in html mails
diff -ru a/Classes/Domain/Repository/MailRepository.php b/Classes/Domain/Repository/MailRepository.php
--- a/Classes/Domain/Repository/MailRepository.php 2017-08-22 15:27:42.155674340 +0200
+++ b/Classes/Domain/Repository/MailRepository.php 2017-08-22 14:52:23.296258864 +0200
@@ -381,7 +381,7 @@
* @param bool $htmlSpecialChars
* @return array
*/
- public function getVariablesWithMarkersFromMail(Mail $mail, $htmlSpecialChars = false)
+ public function getVariablesWithMarkersFromMail(Mail $mail, $htmlSpecialChars = false, $nl2br = false)
{
@scmx
scmx / docker-prompt.md
Last active January 19, 2024 21:36
How to get a fancier bash prompt PS1 inside a docker container #docker #ps1 #emoji

How to get a fancier bash prompt PS1 inside a docker container

Today I wanted to make a recording of me running some commands inside a docker-container.

❯ docker-compose run app bash
root@e9bb2af4dc11:/usr/local/go/src/example.com/dev/project#

Needless to say it looked a bit bland with no colors and a long prompt that prevents me from recording a small terminal and show the full commands I'm

@Ovsyanka
Ovsyanka / ruleset.xml
Last active February 20, 2020 11:10 — forked from gsherwood/ruleset.xml
PSR2 with tabs instead of spaces and bracers on the end of lines
<?xml version="1.0"?>
<ruleset name="MyStandard">
<description>
PSR2 with changes:
* tabs instead of spaces (https://gist.github.com/gsherwood/9d22f634c57f990a7c64)
* bracers on end of line instead new line
</description>
<!-- tabs -->
<arg name="tab-width" value="4"/>
@dogancelik
dogancelik / bookmarks.sql
Last active November 24, 2023 06:32
Export Firefox Mobile Bookmarks #Android
/* bookmarks are stored in “/data/data/org.mozilla.firefox/files/mozilla/…….default/browser.db” */
SELECT url, created
FROM bookmarks
WHERE COALESCE(url, '') <> ''
ORDER BY created ASC
@michelalbers
michelalbers / lib.menu.language.ts
Created January 21, 2015 19:14
Language Switcher in TYPO3 with tx_news support
lib.menuLanguage = COA
lib.menuLanguage {
10 = HMENU
10 {
special = language
special.value = 1,2
stdWrap.wrap = <ul class="language-select">|</ul>
1 = TMENU
1 {
# Normal link to language that exists:
@helhum
helhum / PersistentObjectConverter.php
Last active January 24, 2021 14:08
Extbase TypeConverter to fetch hidden records from persistence (Using this will *always* fetch hidden models of the specified type)
<?php
namespace MyVendor\MyExtension\Property\TypeConverters
use TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter
class MyPersistentObjectConverter extends PersistentObjectConverter {
/**
* @var string
*/
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@joyrexus
joyrexus / README.md
Last active November 5, 2024 14:17 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})