Skip to content

Instantly share code, notes, and snippets.

<?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 / index.html
Last active September 5, 2016 21:48 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!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 / arabic-country-dropdown-list.html
Last active June 3, 2016 22:29 — forked from AmrMekkawy/arabic-country-dropdown-list.html
Arabic countries HTML "select" element (dropdown list)
<!-- 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>
@alhoseany
alhoseany / functions.php
Last active April 13, 2016 20:46
Redirect Buddypress profile edit screen to custom wordpress page
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 / gist:d11b9bab4642a5db022b
Last active August 29, 2015 14:07
get time difference in milliseconds
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;
<?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