Skip to content

Instantly share code, notes, and snippets.

View Mindgames's full-sized avatar
:octocat:

Mathias Åsberg Mindgames

:octocat:
View GitHub Profile
@Mindgames
Mindgames / Helpers.less
Created July 19, 2015 21:22
Less Helpers
// Vertical align div
.vc {
display: table;
width: 100%;
height: 100%;
> div {
display: table-cell;
vertical-align: middle;
}
}
// Display Fragment
url.com?_escaped_fragment_=
@Mindgames
Mindgames / gist:2eed79a6f41031bdb8ec
Last active August 29, 2015 14:26
Wordpress GTH
// wp-config
// Common wp-config settings
define('WP_SITEURL', 'http://url');
define('WP_HOME', 'http://url');
define('RELOCATE', false);
define('DB_HOST', 'localhost');
define('WP_MEMORY_LIMIT', '256M');
define('WP_ALLOW_REPAIR', TRUE);
define('WP_DEBUG', true);
@Mindgames
Mindgames / php.ini
Created August 2, 2015 17:03
Default Ubuntu php.ini
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@Mindgames
Mindgames / gist:388bab65ddcbbe6411a1
Last active September 7, 2015 15:27
Wordpress Conditional Tags
<?php
if ( is_front_page() && is_home() ) {
// Default homepage
} elseif ( is_front_page() ) {
// static homepage
} elseif ( is_home() ) {
// blog page
} else {
//everything else
@Mindgames
Mindgames / gist:1e766375b0be997c72e6
Last active March 4, 2018 01:16
Disable W3 Total cache on pages / template | W3 Total cache / Wordpress
// Use following to disable w3 total cache functions
// Page cache
define('DONOTCACHEPAGE', true);
// DB cache
define('DONOTCACHEDB', true);
// Minify
define('DONOTMINIFY', true);
// CDN
define('DONOTCDN', true);
@Mindgames
Mindgames / XMLschema.xml
Last active November 12, 2015 12:06
XML Schema
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2015 (x64) (http://www.altova.com) by Martin Hammarson (Itero) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" attributeFormDefault="unqualified" vc:minVersion="1.1">
<xs:element name="LogisticsRequest">
<xs:annotation>
<xs:documentation>Logistic Request to Selector</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Request" maxOccurs="unbounded">
@Mindgames
Mindgames / docker_test_haproxy.cfg
Last active January 1, 2016 20:14
Example haproxy.cfg file for a Docker test installation of WordPress containers [http://cloudstore.interoute.com/main/knowledge-centre/blog/coreos-docker-vdc-part3]
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
user haproxy
group haproxy
defaults
log global
mode http
option httplog
@Mindgames
Mindgames / DockerGTH
Last active January 16, 2016 00:01
Docker GTH
# Stop all running containers
docker stop $(docker ps -a -q)
# Remove all running containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@Mindgames
Mindgames / Facebookmeta.txt
Created February 1, 2016 19:59
Facebook meta tags
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="video.movie" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />