Skip to content

Instantly share code, notes, and snippets.

alhoseany alhoseany

Block or report user

Report or block alhoseany

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
View PHP Countries Array
<?php
$countries = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Island
@alhoseany
alhoseany / gist:d11b9bab4642a5db022b
Last active Aug 29, 2015
get time difference in milliseconds
View gist:d11b9bab4642a5db022b
function find_time_diff($t1, $t2, $ms=false) {
$time1_pcs = explode(":", $t1);
$time1_pcs2 = explode(".", $time1_pcs[2]);
$time2_pcs = explode(":", $t2);
$time2_pcs2 = explode(".", $time2_pcs[2]);
$time1_all_ms = ($time1_pcs[0] * 60 * 60 * 1000) + ($time1_pcs[1] * 60 * 1000) + ($time1_pcs2[0] * 1000) + $time1_pcs2[1];
$time2_all_ms = ($time2_pcs[0] * 60 * 60 * 1000) + ($time2_pcs[1] * 60 * 1000) + ($time2_pcs2[0] * 1000) + $time2_pcs2[1];
$time1_all_ms_dif = $time2_all_ms - $time1_all_ms;
@alhoseany
alhoseany / index.html
Last active Sep 5, 2016 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
View index.html
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@alhoseany
alhoseany / functions.php
Last active Apr 13, 2016
Redirect Buddypress profile edit screen to custom wordpress page
View functions.php
add_action('xprofile_screen_edit_profile', 'redirect_to_account_setup');
function redirect_to_account_setup(){
wp_redirect( get_permalink( get_page_by_path( 'account-setup' ) ) );
}
@alhoseany
alhoseany / arabic-country-dropdown-list.html
Last active Jun 3, 2016 — forked from AmrMekkawy/arabic-country-dropdown-list.html
Arabic countries HTML "select" element (dropdown list)
View arabic-country-dropdown-list.html
<!-- Country List in Arabic | source: https://github.com/umpirsky/country-list -- >
<select name="country">
<option value="AW">آروبا</option>
<option value="AZ">أذربيجان</option>
<option value="AM">أرمينيا</option>
<option value="ES">أسبانيا</option>
<option value="AU">أستراليا</option>
<option value="AF">أفغانستان</option>
<option value="AL">ألبانيا</option>
<option value="DE">ألمانيا</option>
View admin-logo.php
<?php
// CUSTOM ADMIN LOGIN HEADER LOGO
function my_custom_login_logo() {
echo '<style type="text/css"> h1 a { background-image:url('.get_bloginfo('template_directory').'/images/democratic-post-logo-google.jpg) !important; } </style>';
}
add_action('login_head', 'my_custom_login_logo');
// Die URL des Logos auf die eigene Website zeigen lassen
function gp_change_login_page_url($login_header_url) {
@alhoseany
alhoseany / functions.php
Created Apr 28, 2018
Example of Use cases for Actions
View functions.php
<?php
/**
* code #1 - removes excess Wordpress header tags from default themes.
*/
function clean_wp_header() {
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'rel_canonical');
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'feed_links',2);
@alhoseany
alhoseany / functions.php
Created Apr 28, 2018
Example of Use cases for Filters
View functions.php
<?php
/**
* code #1 - update the post excerpt character length
* @param integer
* @return integer
*/
function my_excerpt_length($length)
{
return 65;
View gist:9f3a521f376a50120c2b754a74f5aaa3
Run this command to install MG-CLI:
sudo apt-get update && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb
to start miner (4 cores for BCN) use this command:
minergate-cli -user <YOUR@EMAIL.KAPPA> -bcn 4
Feel free to send some of your earnings to me:
BTC (Don't attempt to send other coins to this address!): 17f77AYHsQbdsB1Q6BbqPahJ8ZrjFLYH2j
View control.css
.removeInput {
position: absolute;
right: 15px;
z-index: 999;
background-color: white;
display: block;
border-radius: 10px;
font-size: 10px;
line-height: 20px;
width: 20px;
You can’t perform that action at this time.