Skip to content

Instantly share code, notes, and snippets.

@tan3
tan3 / .htaccess
Last active November 10, 2015 14:44
htaccess: redirect www to non-www
# redirect www to non-www
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1$1 [R=301,L]
</IfModule>
@tan3
tan3 / page.ts
Created April 3, 2014 07:47
TYPO3: page.ts
#----------------------------------------------------------------------
#
# Main template
#
#----------------------------------------------------------------------
page = PAGE
page {
@tan3
tan3 / lib.nav.ts
Created April 3, 2014 07:50
TYPO3: mainnavigation
lib.nav = COA
lib.nav {
10 = HMENU
10 {
entryLevel = 0
#special = directory
#special.value = 10
1 = TMENU
1 {
@tan3
tan3 / tsconfig.ts
Created April 3, 2014 07:52
TYPO3: tsconfig
# -----------------------------------------------------------------
# Sprachen + Spalten
# -----------------------------------------------------------------
mod.SHARED {
defaultLanguageFlag=de
defaultLanguageLabel=Deutsch
}
# -----------------------------------------------------------------
# Rechte für Benutzergruppe 'global'
# -----------------------------------------------------------------
@tan3
tan3 / gist:9950190
Created April 3, 2014 07:57
TYPO3: include typoscript
<INCLUDE_TYPOSCRIPT: source="FILE:fileadmin/templates/typoscript/ts_setup.ts">
<INCLUDE_TYPOSCRIPT: source="DIR:fileadmin/templates/typoscript">
@tan3
tan3 / conditions.ts
Created April 3, 2014 08:01
TYPO3: conditions
#
# browserweiche
#
[browser = msie] AND [version = <8]
page.includeCSS.iehacks = fileadmin/templates/css/patches/iehacks.css
[global]
#
@tan3
tan3 / .htaccess
Created April 8, 2014 07:36
htaccess: block comment spam by denying access to no-referrer requests
# block comment spam by denying access to no-referrer requests
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .myform\.php* [OR]
RewriteCond %{REQUEST_URI} .myotherform\.php*
RewriteCond %{HTTP_REFERER} !.*mysite.de.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
@tan3
tan3 / slick_init.js
Created July 1, 2014 08:05
Javascript: Slick Slider
// wait so that interchange can change the images
setTimeout(function(){
$('#slick').slick({
autoplay: true,
pauseOnHover: true,
speed: 400,
autoplaySpeed: 5000,
touchThreshold: 7,
dots: true,
onAfterChange: function(el, i) {
@tan3
tan3 / validate_emails.rb
Created July 4, 2014 09:28
Ruby: Validate email from csv
require 'csv'
VALID_EMAIL_REGEX = /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/i
def valid_email?(email)
email =~ VALID_EMAIL_REGEX
end
# hier das textfile einlesen (liegt parallel zum script)
csv_text = File.expand_path("../liste.csv", __FILE__)
@tan3
tan3 / map.js
Last active November 25, 2015 20:29
Javascript: Custom GoogleMaps
jQuery(function($) {
var script = document.createElement('script');
script.src = "https://maps.googleapis.com/maps/api/js?v=3.exp&callback=initialize";
document.body.appendChild(script);
});
function initialize() {
var map;