Skip to content

Instantly share code, notes, and snippets.

View sineld's full-sized avatar
🏢
Full Stack Developer

Sinan Eldem sineld

🏢
Full Stack Developer
View GitHub Profile
@sineld
sineld / sineld.php
Created February 23, 2012 11:45
Sinan Eldem
<?php
echo 'hayır hayır amca dedi';
?>
@sineld
sineld / SINAN.php
Created February 23, 2012 11:50
Sinan helper class
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Sinan helper class.
*
* $Id: sinan.php 1.0 2012-02-22 20:06:38Z Geert $
*
* @package Sinan
* @author Sinan Eldem
* @copyright (c) 2012 Sinan Eldem
@sineld
sineld / turkish.php
Created March 9, 2012 08:19
Grocery Crud Turkish Language File
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
Grocery Crud Turkish Language File
Translated by Sinan Eldem
www.sinaneldem.com.tr
*/
$lang['list_add'] = 'Ekle';
$lang['list_actions'] = 'İşlemler';
$lang['list_page'] = 'Sayfa';
@sineld
sineld / json-php.php
Created April 28, 2012 20:20
Json and php
<?php
$dizi = array('koca' => array('isim' => 'sinan', 'yas' => 31), 'es' => array('isim' => 'bilge', 'yas' => 22));
echo 'Php: ';
var_dump($dizi).'<br>';
$d = json_encode($dizi);
echo 'Json (encoded): ';
<?php
class Model_Student_Profile extends ORM {
/**
* Model validation rules
*/
public function rules()
{
return array(
@sineld
sineld / DateFormat.php
Created May 21, 2012 08:17 — forked from cviebrock/DateFormat.php
DateFormat class for Laravel (or anyone)
<?php
class DateFormat {
const DATE_SHORT = 'Y-m-d';
const DATE_LONG = 'F j, Y';
const DATETIME_SHORT = 'Y-m-d H:i';
const DATETIME_LONG = 'F j, Y, g:i a';
@sineld
sineld / laravel-mamp-setup.md
Created July 24, 2012 05:56 — forked from ccschmitz/laravel-mamp-setup.md
Laravel MAMP Setup

Here's how I setup Laravel on MAMP:

1. Add a .htaccess file to the root of the application with the following rules:

<IfModule mod_rewrite.c>
	RewriteEngine on

	RewriteRule ^$ public/ [L]
	RewriteRule (.*) public/$1 [L]
@sineld
sineld / helpers.php
Created July 25, 2012 07:18
My dd replace
<?php
/**
* Dump the given value and kill the script or continue.
*
* <code>
* // Dump the $data variable and kill the script
* d($data);
*
* // Dump the $data variable and continue the script
* d($data,1);
@sineld
sineld / laravel.php
Created August 28, 2012 05:18
Multiple Databases
// http://forums.laravel.com/viewtopic.php?pid=6386#p6386
You can specify different connections in application/config/database.php. The keys for the connections array can be anything, they do not need to be "sqlite", "mysql", etc.
// application/config/database.php
'default' => 'fred',
'connections' => array(
'fred' => array(
'driver' => 'mysql',
'host' => 'localhost',
@sineld
sineld / gist:3523439
Created August 30, 2012 06:45 — forked from msurguy/gist:3515621
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt