Skip to content

Instantly share code, notes, and snippets.

View ajaysharavat's full-sized avatar
🎯
Focusing

Ajay Sharavat ajaysharavat

🎯
Focusing
View GitHub Profile
@ajaysharavat
ajaysharavat / php-event-listener-example.php
Created August 23, 2019 06:54 — forked from im4aLL/php-event-listener-example.php
PHP event listener simple example
<?php
class Event {
private static $events = [];
public static function listen($name, $callback) {
self::$events[$name][] = $callback;
}
public static function trigger($name, $argument = null) {
foreach (self::$events[$name] as $event => $callback) {
@ajaysharavat
ajaysharavat / html_for_international_calling coes.htm
Created September 22, 2017 07:49 — forked from andyj/html_for_international_calling coes.htm
HTML <select> international calling codes for each country
<!-- country codes (ISO 3166) and Dial codes. -->
<select name="countryCode" id="">
<option data-countryCode="GB" value="44" Selected>UK (+44)</option>
<option data-countryCode="US" value="1">USA (+1)</option>
<optgroup label="Other countries">
<option data-countryCode="DZ" value="213">Algeria (+213)</option>
<option data-countryCode="AD" value="376">Andorra (+376)</option>
<option data-countryCode="AO" value="244">Angola (+244)</option>
<option data-countryCode="AI" value="1264">Anguilla (+1264)</option>
<option data-countryCode="AG" value="1268">Antigua &amp; Barbuda (+1268)</option>