Skip to content

Instantly share code, notes, and snippets.

$(window).scroll(function() {
var height = $(window).scrollTop();
if(height > some_number) {
// do something
}
});
@alrnz
alrnz / .htaccess
Created September 21, 2016 16:16 — forked from brichards/.htaccess
Tell Apache to serve missing images from a remote server. Props http://stackoverflow.com/questions/5130410/modrewrite-to-another-server-if-file-image-is-not-found
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.*\.(js|css|png|jpe?g|gif|ico)) http://example.com/$1 [NC,L]
</IfModule>
@alrnz
alrnz / .htaccess
Last active August 10, 2016 15:42
Redirect http to https without checking HTTPS != on
# ----------------------------------------------------------------------
# | Forcing `https://` |
# ----------------------------------------------------------------------
# Redirect from the `http://` to the `https://` version of the URL.
# On my Server the %{HTTPS} !=on does not work and always redirects
# (infinite redirect loop with the "Too many redirects"-error)
<IfModule mod_rewrite.c>
RewriteEngine On
@alrnz
alrnz / TextlinkViewHelper.php
Created April 26, 2016 14:21
TextlinkViewHelper
<?php
namespace Sunzinet\SzNewsroom\ViewHelpers;
/**
* This file is part of the TYPO3 CMS project.
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
@alrnz
alrnz / TwitterTextViewHelper.php
Created April 26, 2016 14:21
TwitterTextViewHelper
<?php
namespace Sunzinet\SzNewsroom\ViewHelpers;
/**
* This file is part of the TYPO3 CMS project.
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
@alrnz
alrnz / rte.ts
Created April 15, 2016 15:12
Add special custom format to TYPO3 RTE
RTE.default.userElements {
10 = Hoch und Tief
10 {
1 = Hochgestellt
1.description = Potenz hochgestellt
1.mode = wrap
1.content = <sup>|<sup>
2 = Index
@alrnz
alrnz / rte.css
Last active April 15, 2016 14:47
Add classes to RTE for span/div/p
.product{
color: #00964f;
}
div.product{
color: #00964f;
}
span.product{
color: #00964f;
}
p.product{
@alrnz
alrnz / rte.ts
Last active May 8, 2019 08:56
[RTE Bootstrap Buttons] Add Bootstrap Button classes to RTE links #TYPO3-62 #TypoScript
# Bootstrap Buttons to RTE
RTE.default.buttons {
link.properties.class.allowedClasses := addToList(btn btn-default, btn btn-primary)
}
@alrnz
alrnz / flexform.xml
Last active September 11, 2019 10:57
TypoLink in flexform for TYPO3 7.6 #TYPO3
<settings.link>
<TCEforms>
<exclude>1</exclude>
<label>
Link to Page or a File or a Content-Element
</label>
<config>
<type>input</type>
<size>30</size>
<eval>trim</eval>
@alrnz
alrnz / FluidTemplate.html
Last active May 8, 2019 08:54
TYPO3 Fluid flexible counter/iterator (count not every step) #TYPO3 #Fluid
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
xmlns:flux="http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers"
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers">
<div>
{namespace v=FluidTYPO3\Vhs\ViewHelpers}
<v:variable.set name="i" value="0" />
<f:for each="{array}" as="elem" iteration="iterator">
val: {i} <br>