Skip to content

Instantly share code, notes, and snippets.

View gist:bdacd363d575cbd963b010923aa1fb44
# Do not edit this file
# It will be overwritten each time nginx-rc upgrade
# Editing this file manually might break RunCloud System
# If you think there is a bug, contact us at bug@runcloud.io
worker_processes auto;
worker_rlimit_nofile 65535;
user runcloud-www runcloud-www;
pid /run/nginx-rc.pid;
pcre_jit on;
@leurdo
leurdo / gist:1ac870c84f51124e08cf54686630405d
Created May 15, 2019
/etc/nginx-rc/rocket-nginx/default.conf
View gist:1ac870c84f51124e08cf54686630405d
###################################################################################################
# Rocket-Nginx
#
# Rocket-Nginx is a NGINX configuration to speedup your WordPress
# website with the cache plugin WP-Rocket (http://wp-rocket.me)
#
# Author: Maxime Jobin
# URL: https://github.com/maximejobin/rocket-nginx
#
# Tested with WP-Rocket version: 3.0.5.1
@leurdo
leurdo / gist:c81f10472cfdd403cf608068b0f054d7
Last active Sep 9, 2018
wiki post type and taxonomy registration, gives permalink structure http://site.ru/wiki/category/subcategory/post
View gist:c81f10472cfdd403cf608068b0f054d7
<?php
// don't load directly
if (!defined('ABSPATH')) die('-1');
class CreditznatokAddwiki
{
private static $_instance;
static function getInstance()
View gist:8693534c6375c93418e5135330fc72b8
function move_term_to_top( $orderby, $query_vars, $taxonomies ) {
if ( 'my_taxonomy' === reset( $taxonomies ) ) {
$orderby = "(CASE WHEN t.name = 'My Top Term' THEN 1 ELSE t.name END)";
}
return $orderby;
}
add_filter( 'get_terms_orderby', 'move_term_to_top', 10, 3 );
@leurdo
leurdo / gist:92e89a3247b2cdf06f5e80e8af6eea7e
Created Feb 27, 2017
Как разрешить загрузку svg в вордпресс 4.7.1
View gist:92e89a3247b2cdf06f5e80e8af6eea7e
/**
*
* SVG upload fix for wp 4.7.1
*
* @link https://wordpress.org/support/topic/wp-4-7-1-kills-svg/page/4/
*
*/
add_filter('wp_check_filetype_and_ext', 'ignore_upload_ext', 10, 4);
function ignore_upload_ext($checked, $file, $filename, $mimes)
{
View gist:09dcb8488019cd57e4aa91eafd234c24
add_filter('wp_check_filetype_and_ext', 'ignore_upload_ext', 10, 4);
function ignore_upload_ext($checked, $file, $filename, $mimes){
//we only need to worry if WP failed the first pass
if(!$checked['type']){
//rebuild the type info
$wp_filetype = wp_check_filetype( $filename, $mimes );
$ext = $wp_filetype['ext'];
$type = $wp_filetype['type'];
$proper_filename = $filename;
@leurdo
leurdo / gist:9ac640e275a22ab0f9f8738704cc3727
Created Aug 11, 2016
Задание на подготовку к курсу PHP
View gist:9ac640e275a22ab0f9f8738704cc3727
<!DOCTYPE html>
<html lang="ru-RU">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width">
<title>Вводное ДЗ по курсу PHP</title>
</head>
<body>
<?php
You can’t perform that action at this time.