Skip to content

Instantly share code, notes, and snippets.

Volker Otto l4ci

View GitHub Profile
View JS Boilerplate.js
* Example Boilerplate Module
* Add boilerplateModule.init() to main.js to initiate it.
var boilerplateModule = (function(){
var config = {
'default': true,
View seo: robots.txt
User-agent: *
View php: go live after date.php
$date = strtotime("15.11.2017 05:00");
$now = time();
if ($date > $now) {
die("Silence is golden!");
View php: dd() function.php
function dd(){
array_map(function($x) { var_dump($x); }, func_get_args()); die;
View Browser Caching + gzip Compression.txt
## Browser Caching + Deflate Compression
<IfModule mod_deflate.c>
<FilesMatch "\.(js|jpg|jpeg|gif|png|ico|svg|css)$">
ExpiresActive on
ExpiresDefault "access plus 1 month"
SetOutputFilter DEFLATE
# Deflate Compression
View jQuery: CountUp.js
// <div class="counter" data-count="150">0</div>
$('.counter').each(function() {
var $this = $(this),
countTo = $this.attr('data-count');
$({ countNum: $this.text()}).animate({
countNum: countTo
View js: Select onchange go to url.html
<select onchange="if (this.value) window.location.href=this.value">
<option value="">Pick one:</option>
<option value="/foo">Foo</option>
<option value="/bar">Bar</option>
View html: jQuery with Fallback.html
<script src=""></script>
<script>window.jQuery || document.write('<script src="/js/libs/jquery.min.js">\x3C/script>')</script>
View html: Asynchrones Google Analytics with OptOut.html
<!-- Google Analytics: change UA-XXXXX-Y to be your site's ID. -->
var gaProperty = 'UA-XXXXX-Y';{ga.q.push(arguments)};ga.q=[];ga.l=+new Date;
ga('create', gaProperty,'auto');
var disableStr = 'ga-disable-' + gaProperty;
View html: Browsehappy.html
<!--[if lt IE 8]>
<div class="info-box" id="browsehappy">
<div class="info-box__headline">Unsicherer Browser!</div>
Sie benutzen einen <strong>veralteten und unsicheren</strong> Webbrowser. Wir empfehlen, den <a href="">Browser zu aktualisieren</a> oder einen anderen, aktuellen Browser zu verwenden.
You can’t perform that action at this time.