Skip to content

Instantly share code, notes, and snippets.

// Seach WP posts per page
add_filter('searchwp_posts_per_page', function($posts_per_page, $engine, $terms, $page) {
return 20;
}, 99, 99);
@hilja
hilja / Dockerfile
Created January 18, 2017 09:39
Docker setup
FROM php:7-fpm
ENV DEBIAN_FRONTEND=noninteractive
RUN pecl install xdebug-2.5.0 && docker-php-ext-enable xdebug
RUN apt-get update && \
apt-get install -y nginx vim psmisc mysql-server php5-mysql
RUN docker-php-ext-install mysqli pdo pdo_mysql
@hilja
hilja / SassMeister-input-HTML.html
Last active August 29, 2015 14:16
Generated by SassMeister.com.
<div class="col-1">1</div>
<div class="col-2">2</div><div class="col-12">12</div>
<div class="col-3">3</div><div class="col-11">11</div>
<div class="col-4">4</div><div class="col-10">10</div>
<div class="col-5">5</div><div class="col-9">9</div>
<div class="col-6">6</div><div class="col-8">8</div>
<div class="col-7">7</div><div class="col-7">7</div>
<div class="col-8">8</div><div class="col-6">6</div>
<div class="col-9">9</div><div class="col-5">5</div>
<div class="col-10">10</div><div class="col-4">4</div>
@hilja
hilja / SassMeister-input-HTML.haml
Created March 7, 2015 17:40
Generated by SassMeister.com.
- (1..12).each do |i|
%div{:class => "item-"#{i}}
@hilja
hilja / SassMeister-input.scss
Last active August 29, 2015 14:14
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
$primary-colors: (
"red": (rbga(255, 0, 0, .5), rbg(255, 0, 0)),
"green": (rbga(255, 0, 0, .5), rbg(0, 255, 0)),
"blue": (rbga(255, 0, 0, .5), rbg(0, 0, 255))
);
@hilja
hilja / SassMeister-input.scss
Last active August 22, 2016 21:22
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
$primary-colors: (
"red": "#ff0000",
"green": "#00ff00",
"blue": "#0000ff"
);
@hilja
hilja / SassMeister-input.scss
Last active August 29, 2015 14:14
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
//--------------------------------------//
// Media queries
//--------------------------------------//
$breakpoints: (
"s": (min-width, 48em),
@hilja
hilja / SassMeister-input-HTML.html
Last active January 12, 2019 11:00
Generated by SassMeister.com.
<h1>Horses with backgorunds!</h1>
<div class="horses--horse"></div>
<div class="horses--pony"></div>
<div class="horses--maxi-pony"></div>
<div class="horses--mini-horse"></div>
@hilja
hilja / SassMeister-input-HTML.html
Last active August 29, 2015 14:13
Generated by SassMeister.com.
<h2>nth()</h2>
<code>$hrs: pony, horse, mini-horse, maxi-pony;</code>
<div class="horses-nth-1"></div>
<div class="horses-nth-2"></div>
<div class="clear"></div>
<h2>Loop</h2>
@hilja
hilja / nginx-server-block.sh
Last active August 29, 2015 13:59
Shell script to make NGinx server blocks.
#!/usr/bin/env bash
#
# Nginx - new server block
# Functions
ok() { echo -e '\e[32m'$1'\e[m'; } # Green
die() { echo -e '\e[1;31m'$1'\e[m'; exit 1; }
# Variables
NGINX_AVAILABLE_VHOSTS='/etc/nginx/sites-available'