Skip to content

Instantly share code, notes, and snippets.

View ajaegers's full-sized avatar

Arnaud JAEGERS ajaegers

View GitHub Profile
@ajaegers
ajaegers / configuration.php
Created January 22, 2015 15:40
[Fix] Joomla HTTPS detection improved (detects https under haproxy HTTP_X_FORWARDED_PROTO). Fix redirects.
<?php
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on';
class JConfig {
/* default datas */
@ajaegers
ajaegers / wp-config.php
Last active August 29, 2015 14:13
[Fix] Wordpress HTTPS detection improved (detects https under haproxy HTTP_X_FORWARDED_PROTO). Fix redirects.
//
// Best way to fix it even it'll never been fixed in WordPress core
if ($_SERVER['HTTP_PROXY_HTTPS'] == 'https') $_SERVER['HTTPS']='on';
//
// OR
//
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on';
@ajaegers
ajaegers / .htaccess
Last active August 29, 2015 14:13
SEO: Properly remove old urls/domain from Google index
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !/robots.txt [NC]
Rewriterule ^(.*)$ http://yournewsite.com/$1 [L,R=301]
</IfModule>
@ajaegers
ajaegers / js-regex-replace-links-to-markdown
Created June 17, 2014 11:10
Regex Html link to Markdown syntax
/**
* How to vertical align (top | middle | bottom) your html elements
* @usage:
* <div class="valign-box">
* <div class="valign-top"></div>
* <div class="valign-middle"></div>
* <div class="valign-bottom"></div>
* </div>
*/
.valign-box {
@ajaegers
ajaegers / jsbin.trigger-css-pseudo-classes-whith-javascript.html
Last active July 4, 2019 07:34
Apply / trigger dynamically css of pseudo classes with javascript (like in console)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
div {
display: block;
width: 200px;
height: 200px;