Skip to content

Instantly share code, notes, and snippets.

View TorbenL's full-sized avatar

Torben Leuschner TorbenL

View GitHub Profile
@TorbenL
TorbenL / functions.php
Created October 2, 2014 12:02
crazy lazy the_post_thumbnail() wrapper (quick & dirty)
<?php
function get_the_lazy_post_thumbnail($post_id = 0, $size = '', $attr = array())
{
if(!intval($post_id))
$post_id = get_the_ID();
$thumb = get_the_post_thumbnail($post_id, $size, $attr);
preg_match('~ src="(.*)" ~isU', $thumb, $result);
if(count($result) < 2) return $thumb;
@TorbenL
TorbenL / .htaccess
Created May 5, 2015 08:17
Browser-Caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/html "access plus 1 second"
ExpiresByType text/css "access plus 2 weeks"
ExpiresByType text/javascript "access plus 2 weeks"
ExpiresByType image/jpg "access plus 3 weeks"
ExpiresByType image/png "access plus 3 weeks"
# ...
</IfModule>
@TorbenL
TorbenL / .htaccess
Created May 5, 2015 08:19
Komprimierung von statischen Ressourcen
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/javascript
  # ...
</IfModule>
<IfModule mod_gzip.c>
  mod_gzip_on       Yes
  mod_gzip_dechunk  Yes
<html>
<head>
<style>/* critical */</style>
<script>/* critical */</script>
</head>
<body>
...
<link rel="stylesheet" href="/css/noncritical.css" type="text/css">
<script src="/js/noncritical.js" async></script>
</body>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/html "access plus 1 second"
ExpiresByType text/css "access plus 2 weeks"
ExpiresByType text/javascript "access plus 2 weeks"
ExpiresByType image/jpg "access plus 3 weeks"
ExpiresByType image/png "access plus 3 weeks"
# …
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
# ...
</IfModule>
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
@include 'inc/header';
@include 'inc/content';
@include 'inc/footer';
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.async = 1; /* Diese Zeile wurde hinzugefügt */
js.src = "//connect.facebook.net/de_DE/sdk.js#xfbml=1&version=v2.30847";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
.afd {
color: brown;
position: absolute;
left: 0;
right: 100%;
.members {
.brain {
width: 0;
@TorbenL
TorbenL / gist:36ba70c104ecab312967a2581a5cf110
Created March 8, 2017 05:42
Verifying that "torbenleuschner.id" is my Blockstack ID. https://onename.com/torbenleuschner
Verifying that "torbenleuschner.id" is my Blockstack ID. https://onename.com/torbenleuschner