Skip to content

Instantly share code, notes, and snippets.

(function( vjs ) {
var videojsEventBroadcastPlugin = function( options ) {
var player = this,
postEventToWindow = function( eventString ) {
var messageData = {
'name': 'zonTriggeredEventTracking',
'sender': 'videojs',
'event': eventString
};
@thomaspuppe
thomaspuppe / .htaccess
Created January 4, 2013 16:45
Redirect of a certain path in .htaccess
# Redirect auf Sitemap (extern, Weiterleitung)
RewriteRule sitemap.xml$ /index.php?eID=dd_googlesitemap [L,Redirect=permanent]
# Redirect auf Sitemap (intern, Auslieferung)
RewriteRule ^sitemap\.xml$ index.php?eID=dd_googlesitemap [L]
@thomaspuppe
thomaspuppe / gist:4000626
Created November 2, 2012 11:49
Track Navigation Timing data from the Browser in Google Analytics
var NAMESPACE = NAMESPACE || {};
NAMESPACE.gaSpeedTrackingJsLoadStart = (new Date()).getTime();
/* All JS ... */
/* Encapsulate "use strict" to this part of the code, while others can still be unstrict. */
(function () {
"use strict";
/* Track JS Parsing time (start was set at the Beginning of the JS) */
@thomaspuppe
thomaspuppe / nginx.conf
Created May 17, 2018 16:11
NginX log_format without IP and shit
##
# Logging Settings in /etc/nginx/nginx.conf
##
log_format custom '$remote_user\t$time_local\t$request_time\t$host\t$request\t'
'$status\t$body_bytes_sent\t$http_referer\t$http_user_agent';
access_log /var/log/nginx/access.log custom;
error_log /var/log/nginx/error.log;
@thomaspuppe
thomaspuppe / zon-menu.txt
Last active July 10, 2017 08:02
ZEIT Speiseplan. This serves as data source for our SlackBot
Tage;Essen1;Nachtisch1;Essen2;Nachtisch2;Essen3
05.10.2015;Lasagne mit Rinderhack und Gemüse Tomaten-Soße Gurkensalat;Erdbeerquark;Pakoras gebackenes Gemüse mit verschiedenen Dips ;Granatapfelcreme;Orientalischer Salat mit Ingwer, Chili, Wakame-Algen, Sushi-Rolls, Wasabi-Dip Soja-Soße, Kroepoek
06.10.2015;Rheinischer Sauerbraten* vom Rind, Rosinensoße, Rotkohl, Kartoffelklöße;Schokoladencreme mit Birnenkompott;Paprikaschoten mit Tofu-Gemüse-Füllung Möhrensoße gebackene Kartoffelwürfel;Quarkklöße mit Pflaumenröster;Herbstlicher Salat mit Chicoree, Papaya, Soja-Limetten-Dressing und gebratener Hähnchenbrust, Baguette
07.10.2015;Linseneintopf mit Kochwurst;Spanischer Mandelkuchen;Kartoffel-Sellerie-Puffer mit Apfelschmand, Rote Bete-Salat;Banane und Kiwi;Blumenkohl-Broccoli-Salat mit Tomaten, Kürbiskernen, Kerbel-Vinaigrette, Zwiebelkuchen und Sour Cream
08.10.2015;Hechtklöße, Blattspinat, Safransoße*, Pariser Kartoffeln;Mandarinen-Vanille-Creme;Auberginenschnitzel in einer Parmesan-Eihülle, Kräuterquark, Pellk
@thomaspuppe
thomaspuppe / gist:5378650
Last active February 3, 2016 12:38
git Commands

##Fetch the status from origin and ignore all local changes

git fetch --all
git reset --hard origin/master

##Change the last commit Message

git commit --amend -m "New commit message"
@thomaspuppe
thomaspuppe / url-parser.js
Created October 24, 2013 12:51
Native JS URL Zerpflückung
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@thomaspuppe
thomaspuppe / gist:4593700
Last active December 11, 2015 11:28
Extract Month and Year from a datetime/timestamp coloumn
### With timestamp/integer coloumn (1354711936)
SELECT
FROM_UNIXTIME(crdate, '%Y') AS year,
FROM_UNIXTIME(crdate, '%M') AS month,
COUNT(uid) AS number
FROM `tx_campeforms_domain_model_contact`
WHERE interest LIKE "%Techniker%"
AND email NOT LIKE "%test.de%"
AND email NOT LIKE "%ondigo.de%"
@thomaspuppe
thomaspuppe / Bugs
Last active December 11, 2015 06:08
Dumme Fehler. Bitte nur einmal machen.
Cache! In allen Ebenen, samt Inhalt und Header.
=================================================
MySQL Tabellen anlegen: TYPE=InnoDB => ENGINE=InnoDB
=================================================
SITUATION: Formular. Eine Zeile soll via JS ausgeblendet werden, wenn das Feld nicht benötigt wird. Suche per parents('.selector').
FEHLER: Nachdem sich die HTML-Struktur änderte, gab es weiter oben im DOM weitere '.selector' , sodass plötzlich praktisch die ganze Seite ausgeblendet wurde.
@thomaspuppe
thomaspuppe / php.ini
Created December 19, 2012 11:40
Error Logging bei Mittwald-Projekten
# /etc/php/php.ini
log_errors = On
error_log = /tmp/php-error.log