Skip to content

Instantly share code, notes, and snippets.

View burakerdem's full-sized avatar
🏠
Working from home

Burak Erdem burakerdem

🏠
Working from home
View GitHub Profile
@burakerdem
burakerdem / turkey_cities_counties.sql
Created July 22, 2013 14:04
City and county list in Turkey with lat/lng.
DROP TABLE IF EXISTS `cities`;
CREATE TABLE `cities` (
`id` int(2) NOT NULL,
`title` varchar(255) NOT NULL,
`lat` double(11,8) DEFAULT NULL,
`lng` double(11,8) DEFAULT NULL,
`northeast_lat` double(11,8) DEFAULT NULL,
`northeast_lng` double(11,8) DEFAULT NULL,
`southwest_lat` double(11,8) DEFAULT NULL,
`southwest_lng` double(11,8) DEFAULT NULL,
@burakerdem
burakerdem / cc_test.txt
Created October 4, 2013 09:10
Credit Card test numbers
CARD TYPE NUMBER
--------------------------------------------------
Master Card (16 Digits) 5105105105105100
Master Card (16 Digits) 5555555555554444
Visa (13 Digits) 4222222222222
Visa (16 Digits) 4111111111111111
Visa (16 Digits) 4012888888881881
American Express (15 Digits) 378282246310005
American Express (15 Digits) 371449635398431
Amex Corporate (15 Digits) 378734493671000
@burakerdem
burakerdem / gist:1007450
Created June 4, 2011 01:38
PHP: ucwords() for UTF-8 strings
<?php
if (!function_exists('mb_ucwords'))
{
function mb_ucwords($str)
{
return mb_convert_case($str, MB_CASE_TITLE, "UTF-8");
}
}
@burakerdem
burakerdem / gist:d8195e6e343aa55ff578
Created November 17, 2015 22:06
Installing wget on Mac OS X El Capitan 10.11
curl -O http://ftp.gnu.org/gnu/wget/wget-1.17.tar.gz
tar -xzf wget-1.17.tar.gz
cd wget-1.17
./configure --with-ssl=openssl
./configure --with-ssl=openssl --with-libssl-prefix=/usr/local/ssl
make
sudo make install
wget --help
cd .. && rm -rf wget*
@burakerdem
burakerdem / url_title.php
Created July 10, 2012 21:07
CodeIgniter url_title() Türkçe
url_title('CodeIgniter ile Wordpress Benzeri Adresler Oluşturmak');
@burakerdem
burakerdem / progress.php
Created March 23, 2019 16:55
PHP/cURL download progress monitoring (PHP 7.2).
<?php
file_put_contents('progress.txt', '');
if (is_file('progress.txt')) {
unlink('progress.txt');
}
if (is_file('testfile.iso')) {
unlink('testfile.iso');
}
@burakerdem
burakerdem / ulkeler
Created May 4, 2013 09:30
Türkçe ülkeler listesi, kısaltma ve uluslararası telefon kodları
ABBR CODE COUNTRY
-----------------------
US 1 ABD
VI 1 ABD Virjin Adaları
AF 93 Afganistan
AX 358 Åland Adaları
DE 49 Almanya
AS 1 Amerikan Samoası
AD 376 Andorra
AO 244 Angola
@burakerdem
burakerdem / routes.php
Created January 24, 2013 14:21
Dynamic routing in Laravel
// http://forums.laravel.io/viewtopic.php?id=1943#p12005
Route::get('settings/(account|notifications|profile)', array(
'as' => 'settings',
'uses' => 'account.settings@(:1)'
));
URL::to_route('settings', 'profile');
@burakerdem
burakerdem / filters.php
Created February 25, 2014 12:11
Laravel 4 multilanguage site
App::before(function($request)
{
// default browser language
$language = substr($request->server->get('HTTP_ACCEPT_LANGUAGE'), 0, 2);
// language set from route
if (null !== $request->segment(1)) {
$routeLanguage = $request->segment(1);
if (! in_array($routeLanguage, Config::get('site.languages'))) {