Skip to content

Instantly share code, notes, and snippets.

View onurdegerli's full-sized avatar

Onur Değerli onurdegerli

  • Backend Developer
  • Malmö/Sweden
View GitHub Profile
@berkayunal
berkayunal / Kredi Kartı BIN Listesi - CSV
Created January 11, 2012 17:16
Kredi Kartı BIN Listesi
bin,banka_kodu,banka_adi,type,sub_type,virtual,prepaid
413226,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,PLATINUM
444676,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,CLASSIC
444677,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,GOLD
444678,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,PLATINUM
453955,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, CLASSIC
453956,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, GOLD
454671,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, CLASSIC
454672,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, CLASSIC
454673,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, BUSINESS
@mkolb
mkolb / var_dump-log.php
Last active January 3, 2023 14:53
var_dump into error log
<?php
ob_start();
var_dump($this);
error_log(ob_get_clean());
?>
anonymous
anonymous / gist:2912227
Created June 11, 2012 19:44
php slugify string
<?php
function slugify($str) {
$search = array('Ș', 'Ț', 'ş', 'ţ', 'Ş', 'Ţ', 'ș', 'ț', 'î', 'â', 'ă', 'Î', 'Â', 'Ă', 'ë', 'Ë');
$replace = array('s', 't', 's', 't', 's', 't', 's', 't', 'i', 'a', 'a', 'i', 'a', 'a', 'e', 'E');
$str = str_ireplace($search, $replace, strtolower(trim($str)));
$str = preg_replace('/[^\w\d\-\ ]/', '', $str);
$str = str_replace(' ', '-', $str);
return preg_replace('/\-{2,}', '-', $str);
}
@sgmurphy
sgmurphy / url_slug.php
Created July 12, 2012 15:52
URL Slugs in PHP (with UTF-8 and Transliteration Support)
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@nikic
nikic / password_hashing_api.md
Created September 12, 2012 15:04
The new Secure Password Hashing API in PHP 5.5

The new Secure Password Hashing API in PHP 5.5

The [RFC for a new simple to use password hashing API][rfc] has just been accepted for PHP 5.5. As the RFC itself is rather technical and most of the sample codes are something you should not use, I want to give a very quick overview of the new API:

Why do we need a new API?

Everybody knows that you should be hashing their passwords using bcrypt, but still a surprising number of developers uses insecure md5 or sha1 hashes (just look at the recent password leaks). One of the reasons for this is that the crypt() API is ridiculously hard to use and very prone to programming mistakes.

@tzengyuxio
tzengyuxio / gist:4284108
Created December 14, 2012 09:44
Fetch IMDb Top 250 into CSV file.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2
import HTMLParser
import csv
import datetime
import codecs, cStringIO # for UnicodeWriter
response = urllib2.urlopen('http://www.imdb.com/chart/top')
@charliepage88
charliepage88 / ActivityLogEntity.php
Last active December 20, 2015 07:59
Service entry for a Activity Log listener
<?php
namespace Acme\DefaultBundle\Entity;
use DateTime;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="acme_activity_log")
@shahariaazam
shahariaazam / Slim_RoutesTest.php
Last active August 26, 2016 06:49
Slim Test class
<?php
require_once __DIR__ . '/../vendor/autoload.php';
use Slim\Environment;
class RoutesTest extends PHPUnit_Framework_TestCase
{
@paracycle
paracycle / bin_numbers.json
Created February 17, 2014 13:57
Kredi Kartlari Bin Numaralari
[
{"binNumber": "400684", "bankName": "ING Bank A.Ş.", "cardBrand": "Bonus", "bankCode": "099"},
{"binNumber": "401622", "bankName": "YAPI ve KREDİ BANKASI A.Ş.", "cardBrand": "World", "bankCode": "067"},
{"binNumber": "401738", "bankName": "GARANTİ BANKASI A.Ş.", "cardBrand": "Bonus", "bankCode": "062"},
{"binNumber": "402275", "bankName": "ASYA KATILIM BANKASI A.Ş.", "cardBrand": "Asya", "bankCode": "208"},
{"binNumber": "402276", "bankName": "ASYA KATILIM BANKASI A.Ş.", "cardBrand": "Asya", "bankCode": "208"},
{"binNumber": "402277", "bankName": "FİNANSBANK A.Ş.", "cardBrand": "CardFinans", "bankCode": "111"},
{"binNumber": "402278", "bankName": "FİNANSBANK A.Ş.", "cardBrand": "CardFinans", "bankCode": "111"},
{"binNumber": "402280", "bankName": "ASYA KATILIM BANKASI A.Ş.", "cardBrand": "Asya", "bankCode": "208"},
{"binNumber": "402458", "bankName": "TÜRK EKONOMİ BANKASI TEB A.Ş.", "cardBrand": "Bonus", "bankCode": "032"},