Skip to content

Instantly share code, notes, and snippets.

Fotis Evangelou fevangelou

Block or report user

Report or block fevangelou

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fevangelou
fevangelou / check_frontpage.php
Created Aug 30, 2018
Frontpage check in Joomla
View check_frontpage.php
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
// Frontpage Check
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault()) {
$isFrontpage = true;
@fevangelou
fevangelou / get_plugin_params.php
Last active Aug 30, 2018
How to access Joomla plugin parameters anywhere in Joomla
View get_plugin_params.php
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
// === How to access Joomla plugin parameters anywhere in Joomla ===
// Get plugin with name 'plugin_name' of type 'plugin_type' (e.g. "content")
$plugin = JPluginHelper::getPlugin('plugin_type', 'plugin_name');
@fevangelou
fevangelou / memcached_installer_for_cpanel.sh
Last active Apr 24, 2019
Memcached (service & related PHP modules) installation on cPanel/WHM servers
View memcached_installer_for_cpanel.sh
#!/bin/bash
# Memcached (service & related PHP modules) installation on cPanel/WHM servers
#
# by Fotis Evangelou (Engintron)
#
# Updated: May 2018
#
# USAGE:
# Upload this file at the root (/) folder of your cPanel/WHM server (on CentOS 7)
View annoying.js
/**
* Annoying.js - How to be an asshole to your users
*
* DO NOT EVER, EVER USE THIS.
*
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com)
* Visit https://gist.github.com/767982 for more information and changelogs.
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors
*
View generate.php
<?php
echo "Downloading...\n";
copy("http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip","/tmp/GeoIPCountryCSV.zip");
$f=fopen('zip:///tmp/GeoIPCountryCSV.zip#GeoIPCountryWhois.csv','r');
echo "Generating";
$data=NULL;
View CSS Only Playground.markdown

CSS Only Playground

Sidenav, Carousel, Accordion, Modal and Tooltips without the need of JavaScript (progressively enhanceable).

A Pen by ekrof on CodePen.

License.

@fevangelou
fevangelou / gleym.com.txt
Created Apr 22, 2016
Email reminders via @gleym.com
View gleym.com.txt
Send an email to 1d@gleym.com to receive a reminder in one day, you'll get an echo of your original email.
Legend: d=day, h=hour, w=week, m=month
Examples:
2d@gleym.com=2 days
1h@gleym.com=1 hour
4d1h@gleym.com=4 days and 1hour
72h@gleym.com=72 hours
@fevangelou
fevangelou / timezone.php
Created Apr 9, 2016 — forked from Xeoncross/timezone.php
The perfect TimeZone selectbox list for PHP 5.3+
View timezone.php
<?php
$regions = array(
'Africa' => DateTimeZone::AFRICA,
'America' => DateTimeZone::AMERICA,
'Antarctica' => DateTimeZone::ANTARCTICA,
'Aisa' => DateTimeZone::ASIA,
'Atlantic' => DateTimeZone::ATLANTIC,
'Europe' => DateTimeZone::EUROPE,
'Indian' => DateTimeZone::INDIAN,
'Pacific' => DateTimeZone::PACIFIC
@fevangelou
fevangelou / mysql-convert-charset.sh
Created Mar 31, 2016 — forked from samuelpismel/mysql-convert-charset.sh
Shell script to change and convert mysql databases charset and collate.
View mysql-convert-charset.sh
#!/bin/bash
database='database'
user='user'
pass='pass'
charset='utf8mb4'
collate='utf8mb4_unicode_ci'
echo "Changing charset of database: $database"
@fevangelou
fevangelou / redirect_to_https.js
Last active Aug 10, 2018
Force redirect page to HTTPS except when on a localhost/dev environment
View redirect_to_https.js
<!-- Force redirect to HTTPS -->
<script>if(!(window.location.host.startsWith("127.0.0.1") || window.location.host.startsWith("localhost")) && (window.location.protocol!="https:")) window.location.protocol="https:";</script>
You can’t perform that action at this time.