Skip to content

Instantly share code, notes, and snippets.

View muhittin's full-sized avatar

Muhittin Özer muhittin

View GitHub Profile
@muhittin
muhittin / permalink.php
Created June 15, 2011 08:25
Permalink Function
@muhittin
muhittin / codeigniter_htaccess
Created June 15, 2011 08:37
Codeigniter htaccess
RewriteEngine On
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php/$1
@muhittin
muhittin / turkceekler.php
Created August 7, 2011 20:55
Türkçe Ekler
<?php
/*ismin nikneymin sonuna gereken eki ekler */
function isimeki($ad, $ektipi= "in")
{
$sertsessizler = array("ç", "f", "h", "k", "p","s", "ş", "t");
/// türkçe sesli ve sert sessiz karakterler
$buyuk = array("A", "I", "E", "İ", "U","O", "Ü", "Ö", "Ç", "F", "H", "K", "P","S", "Ş", "T");
$kucuk = array("a", "ı", "e", "i", "u","o", "ü", "ö", "ç", "f", "h", "k", "p","s", "ş", "t");
@muhittin
muhittin / .htaccess
Created August 11, 2011 14:55
htaccess ile js ve css'lerin cache'lenmesini engellemek
<FilesMatch ".(js|css)$">
Header set Cache-Control "max-age=0, public"
Header set Expires "Thu, 15 Jan 2000 20:00:00 GMT"
</FilesMatch>
@muhittin
muhittin / distance.php
Created November 29, 2011 11:54
uzaklık hesaplama
<?php
/*::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
/*:: :*/
/*:: This routine calculates the distance between two points (given the :*/
/*:: latitude/longitude of those points). It is being used to calculate :*/
/*:: the distance between two locations using GeoDataSource(TM) Products :*/
/*:: :*/
/*:: Definitions: :*/
/*:: South latitudes are negative, east longitudes are positive :*/
@muhittin
muhittin / isminhalleri.php
Created November 29, 2011 11:56
türkçe ekler
function isimeki($ad, $ektipi= "in")
{
$sertsessizler = array("ç", "f", "h", "k", "p","s", "ş", "t");
/// türkçe sesli ve sert sessiz karakterler
$buyuk = array("A", "I", "E", "İ", "U","O", "Ü", "Ö", "Ç", "F", "H", "K", "P","S", "Ş", "T");
$kucuk = array("a", "ı", "e", "i", "u","o", "ü", "ö", "ç", "f", "h", "k", "p","s", "ş", "t");
$kucultulmus = str_replace($buyuk, $kucuk, $ad);
$isim=trim($kucultulmus);
@muhittin
muhittin / isimler.sql
Created December 1, 2011 21:33 — forked from ismailbaskin/turkce_isimler.sql
isim sözlüğü
CREATE TABLE `isimler` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`ad` varchar(255) COLLATE utf8_bin NOT NULL,
`cinsiyet` varchar(50) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ad` (`ad`),
KEY `cinsiyet` (`cinsiyet`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
@muhittin
muhittin / distance.php
Created January 9, 2012 11:44
uzaklık hesaplama
<?php
/*::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
/*:: :*/
/*:: This routine calculates the distance between two points (given the :*/
/*:: latitude/longitude of those points). It is being used to calculate :*/
/*:: the distance between two locations using GeoDataSource(TM) Products :*/
/*:: :*/
/*:: Definitions: :*/
/*:: South latitudes are negative, east longitudes are positive :*/
@muhittin
muhittin / cardverification.php
Created January 9, 2012 11:45
Credit Card Verification VIA LUHN
/* Credit Card Verification VIA LUHN by serpico
function card_verification($ccn){
$ccn = str_replace (' ', '', str_replace ('-', '', trim($ccn)));
if(strlen($ccn) != 16 && !is_numeric($ccn)){
return false;
}
$checksum = 0; // running checksum total
$j = 1;
for ($i = strlen($ccn) - 1; $i >= 0; $i--) {
// Extract the next digit and multiply by 1 or 2 on alternative digits.
@muhittin
muhittin / placeholder_ie.js
Created August 8, 2012 11:08
placeholder attribute for IE Javascript Hack
$(document).ready(function(){
$("input[placeholder], textarea[placeholder]").each(function(i, e){
if($(e).val() == "")
{
$(e).val($(e).attr("placeholder"));
}
$(e).blur(function(){
if($(this).val()=="")
$(this).val($(e).attr("placeholder"));
}).focus(function(){