This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen [::]:443; | |
server_name plex.mydomain.com; | |
rewrite https://$host$request_uri? permanent; | |
error_log /var/log/nginx/openmediavault-plex_error.log error; | |
access_log /var/log/nginx/openmediavault-plex_access.log combined; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server_name nas.yourdomain.com 192.168.xxx.xxx; | |
location /sabnzbd { | |
proxy_pass https://localhost:9080/sabnzbd; | |
} | |
location /sonarr { | |
proxy_pass http://localhost:8989/sonarr; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Social Share Buttons template for Wordpress | |
* By Daan van den Bergh | |
*/ | |
$postUrl = 'http' . ( isset( $_SERVER['HTTPS'] ) ? 's' : '' ) . '://' . "{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; ?> | |
<section class="sharing-box content-margin content-background clearfix"> | |
<h5 class="sharing-box-name">Don't be selfish. Share the knowledge!</h5> | |
<div class="share-button-wrapper"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$text = 'your text'; // or $yourtext; | |
$maxPos = 50; // Max. number of characters | |
if (strlen($text) > $maxPos) | |
{ | |
$lastPos = ($maxPos - 3) - strlen($text); | |
$text = substr($text, 0, strrpos($text, ' ', $lastPos)) . '...'; | |
} | |
echo $text; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Disable WP Emoji's | |
function disable_emojis() { | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); | |
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get Price of all Items in Cart including VAT/Tax | |
Mage::helper('checkout')->formatPrice(Mage::getSingleton('checkout/cart')->getQuote()->getGrandTotal() | |
// Get Total Price excluding/without VAT/Tax | |
Mage::helper('checkout')->formatPrice(Mage::getSingleton('checkout/cart')->getQuote()->getSubtotal() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prerequisites for Python 2.7.x | |
apt-get update | |
apt-get install build-essential checkinstall | |
apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev | |
# Download and extract Python 2.7.13 | |
cd /usr/src | |
curl -O https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz | |
tar xvfz Python-2.7.13.tgz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Daan\CustomModule\Model; // Or Controller, or Plugin, or anything actually. | |
use Magento\Framework\Pricing\PriceCurrencyInterface as CurrencyInterface; | |
class Custom { | |
protected $currencyInterface; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Script to update any js-file | |
// Credits go to: Matthew Horne | |
// Remote file to download | |
$remoteFile = 'https://www.google-analytics.com/analytics.js'; | |
$localFile = '/path/to/your/webroot/analytics.js'; | |
// Check if directory exists, otherwise create it. | |
$uploadDir = '/path/to/your/webroot/'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
# Exception for Google Verification | |
RewriteCond %{REQUEST_URI} !^/google-verification-file.html | |
# Exception Let's Encrypt Challenge | |
RewriteCond %{REQUEST_URI} !^/.well-known/ | |
# 301 Redirect to New Domain incl. Request URI | |
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L] |
OlderNewer