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 / macros.php
Created February 5, 2014 09:47 — forked from mnshankar/macros
<?php
/*********************************************************************************************
* Example usage (In view)
* <div class="welcome">
<?php echo Form::open(array('route'=>'process','class'=>'form-horizontal'))?>
<?php echo Form::textField('first_name')?>
<?php echo Form::textField('last_name')?>
<?php echo Form::emailField('email')?>
<?php echo Form::passwordField('password')?>
<?php echo Form::selectField('select_one', array('1'=>'abc', '2'=>'def'))?>
<?php
/**
* File: SimpleImage.php
* Author: Simon Jarvis
* Modified by: Miguel Fermín
* Based in: http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
<?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 / 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
@sineld
sineld / README.markdown
Created September 6, 2012 14:25 — forked from msurguy/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@sineld
sineld / gist:3672253
Created September 8, 2012 06:02
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Windows)

General

Ctrl+KB toggle side bar
Ctrl+Shift+P command prompt
Ctrl+` python console
Ctrl+N new file

Editing

@sineld
sineld / snippet.xml
Created September 13, 2012 20:30 — forked from JeffreyWay/snippet.xml
Laravel Resource - Sublime Text 2 Snippet
<snippet>
<content><![CDATA[
// ${1} Resource
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index'));
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show'));
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new'));
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit'));
Route::post('${1}s', '${1}s@create');
Route::put('${1}s/(:any)', '${1}s@update');
Route::delete('${1}s/(:any)', '${1}s@destroy');
@sineld
sineld / contact.php
Created December 4, 2012 07:07 — forked from clouddueling/fulltextsearch.php
Fulltext search with Laravel
public static function read_search($terms, $limit = 10)
{
$contact_results = DB::query("
select *
from contacts
where `account_user_id`=?
and `deleted`='0'
and `marketing`='0'
and `mass_merge`='0'
and match (`first`, `last`) against (?)