Skip to content

Instantly share code, notes, and snippets.

View omerucel's full-sized avatar
🎯
Focusing

Ömer ÜCEL omerucel

🎯
Focusing
View GitHub Profile
@omerucel
omerucel / Security.php
Created January 27, 2011 17:15 — forked from f/Security.php
<?php
class Security {
/**
* if(Security::checkInjection($value)) {
* error_log('Possible SQL/XSS injection attack detected with the request '.$value);
* }
*
* @param $value
* @return bool
@omerucel
omerucel / Security.php
Created January 27, 2011 17:16 — forked from f/Security.php
<?php
class Security {
/**
* if(Security::checkInjection($value)) {
* error_log('Possible SQL/XSS injection attack detected with the request '.$value);
* }
*
* @param $value
* @return bool
<?php
header('Content-type:text/plain; charset=utf-8;');
class ModelAbstract
{
public function __call($name, $arguments)
{
$prefix = substr($name, 0, 3);
$column_name = strtolower(str_replace(' ', '_', preg_replace('/(?!^)[A-Z]{2,}(?=[A-Z][a-z])|[A-Z][a-z]/', ' $0', substr($name, 3))));
@omerucel
omerucel / Modularity.php
Created July 19, 2011 17:27
Zend Framework ile gelişmiş modül sistemi
<?php
/**
Bağlantılar:
http://url/ -> application/controllers/IndexController.php
http://url/api/ -> application/api/controllers/IndexController.php
http://url/api/v1/ -> application/api/v1/controllers/IndexController.php
http://url/api/v1/user/ -> application/api/v1/user/controllers/IndexController.php
@omerucel
omerucel / gist:1620104
Created January 16, 2012 10:07
test node.js
var nMemcached = require( '../' ),
memcached;
// connect to our memcached server on host 10.211.55.5, port 11211
memcached = new nMemcached( "10.211.55.5:11211" );
var device = Device.createDevice(); // Device objesini döner.
userAgent = "HTTP bla bla";
var query = device.createQuery(userAgent); // Yeni bir query oluşturur.
@omerucel
omerucel / test.js
Created May 6, 2012 20:22
Yeniden kullanılabilirlik.
var util = require('util');
var async = require('async');
var EventEmitter = require('events').EventEmitter;
// İşlem denizi dersek yeridir.
var Ocean = {
__start : function(params){
return function(callback){
callback(null, {
params : params
@omerucel
omerucel / senkron.js
Created May 30, 2012 18:29
seri işlemler
function Senkron(functions , resultCallback)
{
var index = -1;
var size = functions.length;
var callback = function(err){
if (err)
return resultCallback(err);
if (++index == size)
@omerucel
omerucel / run_mongo.sh
Created June 30, 2012 19:52
run mongodb on mac
#!/bin/sh
/Applications/mongodb-osx-x86_64-2.0.6/bin/mongod --logpath /tmp/mongod.log --dbpath /Applications/mongodb-osx-x86_64-2.0.6/data/ &
@omerucel
omerucel / schema.sql
Created July 19, 2012 18:48
sample shop schema for blog post
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `shop` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
USE `shop` ;
-- -----------------------------------------------------
-- Table `shop`.`musteri`
-- -----------------------------------------------------
@omerucel
omerucel / build.properties
Created July 19, 2012 19:17
samle build.properties for blog post
propel.project = Shop
propel.database = mysql
propel.database.url = mysql:host=localhost;dbname=shop;user=root;password=root
propel.database.user = root
propel.database.password = root
propel.mysql.tableType = InnoDB
propel.classPrefix = Entity