Skip to content

Instantly share code, notes, and snippets.

View unzeitigm's full-sized avatar

Marek Unzeitig unzeitigm

View GitHub Profile
@unzeitigm
unzeitigm / countries.php
Created September 13, 2017 10:11 — forked from josephilipraja/countries.php
List of Countries with Country code & Telephone (Dial) Code as a PHP Array. Bonus: PHP function to list all Countries as HTML Select Tag Options with their 2 character Country code as values
<?php
$countryArray = array(
'AD'=>array('name'=>'ANDORRA','code'=>'376'),
'AE'=>array('name'=>'UNITED ARAB EMIRATES','code'=>'971'),
'AF'=>array('name'=>'AFGHANISTAN','code'=>'93'),
'AG'=>array('name'=>'ANTIGUA AND BARBUDA','code'=>'1268'),
'AI'=>array('name'=>'ANGUILLA','code'=>'1264'),
'AL'=>array('name'=>'ALBANIA','code'=>'355'),
'AM'=>array('name'=>'ARMENIA','code'=>'374'),
'AN'=>array('name'=>'NETHERLANDS ANTILLES','code'=>'599'),
@unzeitigm
unzeitigm / .htaccess
Last active March 16, 2018 12:23
Website Maintenance Mode
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/maintenance\.html$ [NC]
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif|css|js|tff|woff) [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}/maintenance.html [R=307,L]
@unzeitigm
unzeitigm / nette-ajax-extensions.js
Last active June 6, 2018 09:17
Nette Ajax extensions to disable a button during ajax request
(function ($) {
let Spinner = new window.Spinner();
$.nette.ext('trigger-spinner', {
before: function (jqXHR, settings) {
if (!this.validRequest(settings)) {
return;
}