Skip to content

Instantly share code, notes, and snippets.

View TorbenL's full-sized avatar

Torben Leuschner TorbenL

View GitHub Profile
@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
@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 / 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;
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAADICAMAAAAnUXUoAAAANlBMVEUZGRn///8ZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRn7pC7QAAAAEXRSTlMAABAgMEBQYHB/j5+vv8/f79hldlkAABjFSURBVHja7Z3bgqQqDEU5KCpilPz/z54HbgHRqurbdM3s/TJTtmCALAVEov6DIOhSClUAQQAEggAIBAEQCAIgEARAIAiAQBAAgSAAAkEABIIgAAJBAASCAAgEARAIAiAQBEAgCIBAEACBIAACQQAEgiAAAkEABIIACAQBEAgCIBAEQCAIgEAQAIEgAAJBEACBIAACQQAEggAIBAEQCAIgEARAIAiAQBAAgSAAAkEQAIEgAAJBAASCAAgEARAIAiAQBEAgCIBAEACBIAiAQBAAgSAAAkEABIIACAS9NSDqbTUYo2/+rO///Oalez3BUxlqY4avLMUXZ9ex8ccA0Y7WH2j3iWh8UP4nDVmZ2bz+57MB31nyD+f9oHSvJ3gqw4mZ7Rc29tdm1830xwBZ7irQ7F9VUs9Mp4OjvLn1DBk6dyK6b/Hmz9qY8cKA25LXtglnY97dYw/u5T0+cyunVwF5lOCpDO3XevSns8utdp3pjwFyW4FfVnGGO4Bs1aU7hiy9y78EyJiu2zHgNqOt90fiqPkDbrs95foARLbaPw4IPQLEfhoQ81FA6BaQhy7XSU4A5FPe8qcAccw8fHvFDczs7tuuY8gXAtIx4Lbkl4DsO/eaTz3MG4C8JyADHfMPVNziN33fdh1DvhCQjgG3Jb8ExCjHd2Rd5g1A3hOQn6y4V9vuKwH5CtvCQfPUKOSDrg9AAMi7A6L4Q7UCQN4JkHlnZhqVUqMjGpUaV2Jm9k53jDLuYGY+rFILEa1KGSJa1Lx5ZuZ9UkqpWWQwOM/srVJq3pj5GNRCtCoVUxxWK2XJM/OeX09EQ7Td47UmOp
@TorbenL
TorbenL / mixins.scss
Created June 2, 2014 09:03
standard sass mixins
@mixin bp($width) {
@media screen and (max-width: $width){
@content;
}
}
@mixin bpmin($width) {
@media screen and (min-width: $width){
@content;
}
@TorbenL
TorbenL / class.my-class.php
Created January 7, 2014 16:16
super simple php view class :-)
<?php
class MyClass extends TlView
{
public function __construct()
{
// optional
$this->setViewPath('/');
// optional
$this->setViewFilename('standard-template');
[gp-post href="https://plus.google.com/114421677831789165567/posts/5SLVJraiZ4P"]
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<div class="g-post" data-href="https://plus.google.com/114421677831789165567/posts/5SLVJraiZ4P"></div>
.transition-all {
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
[fb-post href="https://www.facebook.com/torbenleuschner.de/posts/568421526533431"]