Skip to content

Instantly share code, notes, and snippets.

View adililhan's full-sized avatar

adililhan

View GitHub Profile
@adililhan
adililhan / gist:1962454
Created March 2, 2012 23:43
Döviz bilgileri
#!/usr/bin/env python
#-*-coding: utf-8-*-s
__author__ = "Adil Ilhan"
import requests
import re
class VeriCek(object):
def __init__(self):
@adililhan
adililhan / gist:3159594
Created July 22, 2012 13:05
ompldr.org'a dosya yükler ve yüklenen dosyayı bilgisayardan siler.
#!/usr/bin/env ruby
#
# Copyright 2007-2009 David Shakaryan <[email protected]>
# Copyright 2007-2009 Brenden Matthews <[email protected]>
# Copyright 2010 Murilo Soares Pereira <[email protected]>
#
# Distributed under the terms of the GNU General Public License v3
#
# Special thanks to Christoph for a patch.
@adililhan
adililhan / search.php
Created September 3, 2012 21:25
PHP ile Database’in Tamamında Arama Yapmak
class DBSearch {
function __construct($keyword){
$this->keyword = $keyword;
}
function DBConnect(){
$this->db = new PDO("mysql:dbname=test;host=localhost", "root", "");
return $this;
}
@adililhan
adililhan / awesome-php.md
Created September 20, 2012 07:47 — forked from sineld/awesome-php.md
Awesome PHP Libraries
@adililhan
adililhan / Polimorfizm.java
Created October 9, 2012 18:41
Java'da polimorfizm örneği
interface Telefon{
public String TelefonEt(String TelNo);
}
class CepTelefonu implements Telefon {
private boolean kontorVarMi = true;
private boolean operatorUygunMu = false;
@Override
@adililhan
adililhan / Polimorfizm.php
Created October 9, 2012 21:21
PHP'de polimorfizm örneği
<?php
interface Telefon{
function TelefonEt($TelNo);
}
class CepTelefonu implements Telefon{
private $kontorVarMi = true;
private $operatorUygunMu = false;
@adililhan
adililhan / compressor.sh
Created October 12, 2012 22:44
Simple CSS Compressor
#!/bin/bash
# Author: Adil İlhan
files=`find . -name "*.css"`;
for i in $files
do
rmcss=`ls -d $i | sed s/\.css//g`
`cp $i $rmcss".uncompressed.css"`
`sed 's/^\/.*//g;s/^\*.*//g;/ \*/d;s/^[A-Z].*//g' $i > tmp && mv tmp $i`
@adililhan
adililhan / named_capturing.php
Created November 17, 2012 19:12
RegEx'de Named Capturing Groups Örneği
<?php
$str = "ayva araba masa kitap defter 12 4378564 aslan";
preg_match_all('/(?P<rakamlar>[0-9]+)/', $str, $matches);
print_r ($matches);
@adililhan
adililhan / Late_Static_Binding.php
Created November 22, 2012 21:27
Late Static Binding Örneği
<?php
class X {
public static function Z(){
return "X çağırıldı\n";
}
public function getSelfZ(){
echo self::Z(); // X sinifindaki deger doner
}
@adililhan
adililhan / ClosureTest.php
Created June 13, 2013 19:45
PHP'de sınıf içinde bulunan closure fonksiyondan üye metota erişmeyi sağlayan kod.
<?php
class ClosureTest {
public $getInfo;
public function __construct() {
$that = $this; // Yerel degisken olusturuldu (local variable)
$this->getInfo = function() use($that) {