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 / 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>
@fevangelou
fevangelou / random-id.js
Created Feb 16, 2016 — forked from alexey-bass/random-id.js
Generate read-error-free hash. Similar letters absent (like 0 and O).
View random-id.js
function randomString(length, chars) {
var result = '';
for (var i = length; i > 0; --i) {
result += chars[Math.round(Math.random() * (chars.length - 1))];
}
return result;
}
var dictionary = '';
dictionary+= 'ABCDEFGHKLMNPQRTWXYZ'; // IJOSUV
View version_compare.js
/**
* Simply compares two string version values.
*
* Example:
* versionCompare('1.1', '1.2') => -1
* versionCompare('1.1', '1.1') => 0
* versionCompare('1.2', '1.1') => 1
* versionCompare('2.23.3', '2.22.3') => 1
*
* Returns:
You can’t perform that action at this time.