Skip to content

Instantly share code, notes, and snippets.

location ~ .(scripts|styles|images|views)/(.*)/(.*)$ {
try_files $uri $uri/ /../frontend/app/$1/$2/$3;
}
location ~ .(scripts|styles|images|views)/(.*)$ {
try_files $uri $uri/ /../frontend/app/$1/$2;
}
location ~ .(bower_components)/(.*)/(.*)$ {
#php_flag display_startup_errors on
#php_flag display_errors on
#php_flag html_errors on
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
@regenrek
regenrek / gist:e79dea9e000457b409e9dd3f7df4e33c
Created August 12, 2016 13:27
Wordpress Easy Inline Image Resize
# install https://github.com/regenrek/WP-Aqua-Resizer Wordpress plugin
$att_id = get_post_thumbnail_id(get_the_ID());
$image = aq_resize(wp_get_attachment_url( $att_id ), 400, 400,true, false); ?>
<img src="<?php echo $image[0]; ?>" alt="img" />
@regenrek
regenrek / BitbucketServerApi.php
Last active July 28, 2017 13:05
BitbucketServerApi
<?php
/**
* This is an extension Class which works with Bitbucket Server.
* See here https://github.com/YahnisElsts/plugin-update-checker/issues/119#issuecomment-318436920
*/
if ( !class_exists('BitbucketServerApi', false) ):
class BitbucketServerApi extends Puc_v4p2_Vcs_Api {
{
"type": "package",
"package": {
"name": "macherjek/white-label-branding",
"version": "4.1.6.75841",
"type": "wordpress-plugin",
"dist": {
"type": "zip",
"url": ""
}
echo "DB_HOST='db'
DB_NAME='$MYSQL_DATABASE'
DB_PASSWORD='$MYSQL_PASSWORD'
DB_USER='$MYSQL_USER'
DISABLE_WP_CRON='True'
WP_ENV='development'
WP_HOME='http://${VIRTUAL_HOST}'
WP_SITEURL='http://${VIRTUAL_HOST}/wp'
ACF_PRO_KEY='${ACF_PRO_KEY}" > .env
<?php
// bootstrap.php
private function _includes(){
global $ae_template;
require_once AE_PRO_PATH.'includes/themes/Ae_Theme_Base.php';
if(file_exists(AE_PRO_PATH.'includes/themes/'.$ae_template.'/Ae_Theme.php')){
require_once AE_PRO_PATH.'includes/themes/'.$ae_template.'/Ae_Theme.php';
}else{
add_action( 'after_setup_theme', function() {
@regenrek
regenrek / edit_custom_Backend_walker.php
Created May 17, 2018 12:06
Additional 'Single Page Link' Field for Wordpress Menu Items
<?php
/**
* /!\ This is a copy of Walker_Nav_Menu_Edit class in core
*
* Create HTML list of nav menu input items.
*
* @package WordPress
* @since 3.0.0
* @uses Walker_Nav_Menu
*/
<?php
/**
* Class Name: wp_bootstrap_navwalker
* GitHub URI: https://github.com/twittem/wp-bootstrap-navwalker
* Description: A custom WordPress nav walker class to implement the Bootstrap 3 navigation style in a custom theme using the WordPress built in menu manager.
* Version: 2.0.4
* Author: Edward McIntyre - @twittem
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
<template>
<figure :class="[objectFit !== '' ? 'is-' + objectFit : '']">
<picture v-if="imageFetchMode === 'srcset'">
<source :data-srcset="image.webp" type="image/webp" />
<source :data-srcset="image.opt" type="image/jpg" />
<img
:src="image.placeholder"
class="lazyload blur"
:data-src="image.opt"
/>