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 / sentry.reset.password.php
Created August 30, 2012 07:26
Sentry Bundle Reset Password
<?php
// Forked from: http://paste.laravel.com/4iV
public function get_reset_password()
{
// render the reset password view
return View::make('auth.reset-password');
}
public function post_reset_password()
{
@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 / awesome-php.md
Created September 19, 2012 15:49 — forked from ziadoz/awesome-php.md
Awesome PHP Libraries

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should be using:

@sineld
sineld / laravel-upload-resize.php
Created September 25, 2012 08:11
Laravel File Upload And Resize
<?php
// Resizer and Image Manipulation
// Based on: http://forums.laravel.com/viewtopic.php?id=2648
public function post_edit_logo($id)
{
$rules = array(
'image' => 'image',
);
@sineld
sineld / table.php
Created September 25, 2012 13:08
Laravel Table relationships (how to)
Based on: http://forums.laravel.com/viewtopic.php?id=2650
Question:
Hi friends,
I have just started with laravel (beautiful product) and have a question about table relationships.
I have three tables (projects / articles / images)
@sineld
sineld / optgroup.php
Created October 2, 2012 09:12
Laravel: Using form::select with <optgroup>
<?php
//Source: http://forums.laravel.com/viewtopic.php?id=2807
Route::get('optgroup', function()
{
$eat_options = array(
'animals' => array(
'cats',
'dogs',
'monkeys',
@sineld
sineld / read-file-contents.php
Created October 3, 2012 07:23
Php ile dosya içeriği okuma - Read file contents with php
// Source URL: http://forum.ceviz.net/php/121070-veritabani-bilgileri-include-etmek.html#post711169
File to read (readme.php) contents:
; <?php exit; ?> DO NOT DELETE THIS LINE
dbhost="localhost"
dbport="3306"
dbuser="root"
dbpass=""
dbname="webtrees"
@sineld
sineld / tarihFarki.php
Created October 5, 2012 05:59
Php: tarihFarki
<?php
function tarihFarki($startDate, $endDate)
{
$startDate = strtotime($startDate);
$endDate = strtotime($endDate);
if ($startDate === false || $startDate < 0 || $endDate === false || $endDate < 0 || $startDate > $endDate)
return false;
$years = date('Y', $endDate) - date('Y', $startDate);