Skip to content

Instantly share code, notes, and snippets.

View lgraubner's full-sized avatar

Lars Graubner lgraubner

View GitHub Profile
@lgraubner
lgraubner / .htaccess
Last active August 29, 2015 14:20
Komprimierung und Caching von Ressourcen mittels .htaccess
<IfModule mod_expires.c>
ExpiresActive on
# default
ExpiresDefault "access plus 1 month"
ExpiresByType text/css "access plus 1 year"
# Data interchange
ExpiresByType application/atom+xml "access plus 1 hour"
@lgraubner
lgraubner / .htaccess
Created May 11, 2015 14:29
Komprimierung und Caching von Ressourcen mittels .htaccess (Typo3 Version)
<IfModule mod_expires.c>
ExpiresActive on
# default
ExpiresDefault "access plus 1 month"
ExpiresByType text/css "access plus 1 year"
# Data interchange
ExpiresByType application/atom+xml "access plus 1 hour"
@lgraubner
lgraubner / map.js
Created September 3, 2015 13:48
Decent Google Map v3 styles
var styles = [{stylers:[{saturation:-28},{lightness:17},{hue:"#ffd500"},{gamma:1.09}]},{featureType:"water",stylers:[{hue:"#00ccff"},{saturation:-5}]},{featureType:"poi.park",stylers:[{hue:"#55ff00"}]},{elementType:"labels",stylers:[{saturation:-77}]},{featureType:"road.highway",stylers:[{lightness:100}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{lightness:-49}]},{},{featureType:"poi.school",stylers:[{saturation:-59}]},{stylers:[{saturation:-17}]}];
@lgraubner
lgraubner / reset_spotlight_searchindex.sh
Last active September 6, 2015 18:51
Reset mac spotlight search index in terminal
sudo mdutil -E
@lgraubner
lgraubner / index.html
Created September 11, 2015 08:12
Link for back button from detail page to search result page including fallback
<a href="/search.html" onclick="if(history.length > 1){ history.back(); return false; }">Back to search results</a>
@lgraubner
lgraubner / shadow.css
Created September 14, 2015 14:03
Apply inset box shadow on one side only
.top-box {
box-shadow: inset 0 7px 9px -7px rgba(0,0,0,0.4);
}
.left-box {
box-shadow: inset 7px 0 9px -7px rgba(0,0,0,0.4);
}
.right-box {
box-shadow: inset -7px 0 9px -7px rgba(0,0,0,0.4);
@lgraubner
lgraubner / index.html
Created September 15, 2015 09:04
Minimal favicon markup
<head>
<link rel="icon" type="image/png" href="favicon.png" sizes="32x32">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
</head>
@lgraubner
lgraubner / alsa-base.conf
Last active September 17, 2016 08:01
Enable Raspberry Pi USB soundcard in /etc/modprobe.d/alsa-base.conf
# This sets the index value of the cards but doesn't reorder.
options snd_usb_audio index=0
options snd_bcm2835 index=1
# Does the reordering.
options snd slots=snd_usb_audio,snd_bcm2835
@lgraubner
lgraubner / config.txt
Last active October 7, 2015 14:32
Rotate Raspberry Pi screen
# path: /boot/config.txt
display_rotate=2
@lgraubner
lgraubner / permissions.sh
Created October 1, 2015 10:51
Sets correct file and folder permissions for webservers.
find . -type d -print0 | xargs -0 chmod 755 && find . -type f -print0 | xargs -0 chmod 644