Skip to content

Instantly share code, notes, and snippets.

@urre
urre / gist:3341230
Created August 13, 2012 14:29
Delete WP-SEO columns
<?php
function my_columns_filter( $columns ) {
unset($columns['wpseo-focuskw']);
unset($columns['wpseo-metadesc']);
unset($columns['wpseo-score']);
unset($columns['wpseo-title']);
return $columns;
}
body {
background: white;
}
#info-bar {
display: none;
}
#header {
opacity: .2;
@urre
urre / gist:3388091
Created August 18, 2012 16:18
Custom CSS for Gmail
#gbqlw img {
display: none;
}
#gbq .gbgt-hvr:hover,
#gbqlw,
#gbqlw:hover
#gbqlw:active
,#gbqlw:focus {
height: 100px;
@urre
urre / nginx.conf
Created October 30, 2012 19:20
Nginx configuration
# Generic startup file.
user www-data;
worker_processes 6;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
# Keeps the logs free of messages about not being able to bind().
#daemon off;
@urre
urre / restrictions.conf
Created October 30, 2012 19:20
Nginx restrictions
# Global restrictions configuration file.
# Designed to be included in any server {} block.
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
@urre
urre / fastcgi_params
Created October 30, 2012 19:21
FastCGI params
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
@urre
urre / nyttinstrument.se
Last active March 17, 2016 12:23
Site configuration
# Redirect everything to the main site.
server {
server_name mywebsite.se *.mywebsite.se;
root /var/www/nyttinstrument.se;
if ($http_host != "mywebsite.se") {
rewrite ^ http://mywebsite.se$request_uri permanent;
}
#include global/wordpress-w3-total-cache.conf;
@urre
urre / wordpress-w3-total-cache.conf
Created October 30, 2012 19:21
Nginx W3 Total Cache config
# BEGIN W3TC Browser Cache
gzip on;
gzip_types text/css application/x-javascript text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
location ~ \.(css|js)$ {
expires 31536000s;
add_header Pragma "public";
add_header Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate";
add_header X-Powered-By "W3 Total Cache/0.9.2.3";
}
location ~ \.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml)$ {
@urre
urre / php5-fpm.conf
Created October 30, 2012 19:29
PHP5-FPM configuration
# Pass all .php files onto a php-fpm/php-fcgi server.
location ~ \.(css|js|jp(e)?g|gif|png|swf|ico)$ {
expires 1y;
}
# unless the request is for a valid file, send to bootstrap
if (!-e $request_filename)
{
rewrite ^(.+)$ /index.php?q=$1 last;
@urre
urre / nginx.conf
Created October 31, 2012 22:30
W3 Total cache site rewrites
# BEGIN W3TC Page Cache cache
location ~ /wp-content/w3tc/pgcache.*html$ {
add_header Vary Cookie;
}
# END W3TC Page Cache cache
# BEGIN W3TC Page Cache core
rewrite ^(.*\/)?w3tc_rewrite_test$ $1?w3tc_rewrite_test=1 last;
set $w3tc_rewrite 1;
if ($request_method = POST) {
set $w3tc_rewrite 0;