Skip to content

Instantly share code, notes, and snippets.

View chiotis's full-sized avatar

Christos Chiotis chiotis

View GitHub Profile
(function() {
function main() {
if (!window.WPLeafletMapPlugin) {
console.log("no plugin found!");
return;
}
// iterate any of these: `maps`, `markers`, `markergroups`, `lines`, `circles`, `geojsons`
var maps = window.WPLeafletMapPlugin.maps;
@chiotis
chiotis / .htaccess
Last active April 15, 2021 11:38
Basic htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
# Follow symbolic links.
Options +FollowSymLinks
# Stop hotlinking.
RewriteCond %{HTTP_REFERER} !^$
@chiotis
chiotis / .htaccess
Created November 14, 2019 10:10
htaccess redirect for mobile website version
RewriteEngine on
RewriteBase /
# Check if this is the noredirect query string
RewriteCond %{QUERY_STRING} (^|&)m=0(&|$)
# Set a cookie, and skip the next rule
RewriteRule ^ - [CO=mredir:0:www.website.com]
# Check if this looks like a mobile device
# (You could add another [OR] to the second one and add in what you
# had to check, but I believe most mobile devices should send at
@chiotis
chiotis / mreset.css
Created October 6, 2019 10:31
A Modern CSS Reset
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default padding */
ul[class],
ol[class] {
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
@chiotis
chiotis / htaccess for wordpress
Last active May 11, 2020 18:49
htaccess for classicpress and wordpress
# 7G FIREWALL v1.2 20190727
# @ https://perishablepress.com/7g-firewall/
# 7G:[CORE]
ServerSignature Off
Options -Indexes
RewriteEngine On
RewriteBase /
# 7G:[QUERY STRING]
@chiotis
chiotis / style.css
Last active January 22, 2019 10:24
CSS Scrollbars
html::-webkit-scrollbar {
width: 30px;
height: 30px;
}
html::-webkit-scrollbar-track {
background: linear-gradient(to right,#201c29,#201c29 1px,#100e17 1px,#100e17);
}
html::-webkit-scrollbar-thumb {
@chiotis
chiotis / SMTP functionality in wp-config
Last active January 27, 2019 18:20 — forked from butlerblog/wp_config.php
Configure WordPress wp_mail function to send through SMTP server http://b.utler.co/Y3
<?php
/*
* Set the following constants in wp-config.php
* These should be added somewhere BEFORE the
* constant ABSPATH is defined.
*/
define( 'SMTP_USER', 'user@example.com' ); // Username to use for SMTP authentication
define( 'SMTP_PASS', 'smtp password' ); // Password to use for SMTP authentication
@chiotis
chiotis / gist:6d71340dc52def46801a6957d24f1d8e
Created August 8, 2017 10:10
Open External Links in New Window
<script type='text/javascript'>
//<![CDATA[
//Open External Links in New Window
jQuery(document).ready(function(){
jQuery("#content a[href^=http], #content a[href^=https]").each(function(){
if (this.href.indexOf(location.hostname) == -1) {
jQuery(this).attr({ "target":"_blank" })
@chiotis
chiotis / flexbox-app-layout.markdown
Created December 27, 2016 09:41
Flexbox app layout