Skip to content

Instantly share code, notes, and snippets.

@eabay
eabay / validate-tr-license-plate.coffee
Last active April 14, 2023 15:15
Türkiye plaka kodu için regular expression
validate = (val) ->
# boşluk karakterlerini kaldıralım
v = val.replace(/\s+/g, '').toUpperCase()
# http://tr.wikipedia.org/wiki/Türkiye_il_plaka_kodları adresindeki bilgi kullanılmıştır.
regex = /// ^
(0[1-9]|[1-7][0-9]|8[01]) # İl kodu
(
([A-Z])(\d{4,5}) # "99 X 9999", "99 X 99999"
| ([A-Z]{2})(\d{3,4}) # "99 XX 999", "99 XX 9999"
@eabay
eabay / gist:743267
Created December 16, 2010 10:32
Hwm_Geolocation bileşeni örneği
<?php
// HWM Framework Zend Autoloader'ını kullandığı için öncelikle
// Autoloader'a Hwm namespace'inin varlığını bildirmeliyiz.
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance()->registerNamespace('Hwm');
// Varsayılan servis MaxMind olduğu için servis sağlayıcı
// olarak Geobytes'ı kullanacağımızı da belirtmemiz gerekiyor.
try {
<?php
class WordPress_Settings
{
/**
*
* @var array
*/
protected $_registry;
<?php
// ------------------------------------------------------------------
// Add all your sections, fields and settings during admin_init
// ------------------------------------------------------------------
//
function eg_settings_api_init() {
// Add the section to reading settings so we can add our fields to it
add_settings_section('eg_setting_section', 'Example settings section in reading', 'eg_setting_section_callback_function', 'reading');