This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function gunleriBul($startTime, $endTime) { | |
| $day = 86400; | |
| $format = 'Y-m-d'; | |
| $startTime = strtotime($startTime); | |
| $endTime = strtotime($endTime); | |
| $numDays = round(($endTime - $startTime) / $day) + 1; | |
| $days = array(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $family = array('Sinan', 'Bilge', 'Tuana Şeyma'); | |
| $size = sizeof($family); | |
| $i = 0; | |
| while($size--) | |
| { | |
| echo $family[$i].', '; | |
| $i++; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # Original URL: https://github.com/miohtama/ztanesh/blob/master/zsh-scripts/bin/setup-sync-sublime-over-dropbox.sh | |
| # Set-up Sublime settings + packages sync over Dropbox | |
| # Kullanım: $sh dosya.sh | |
| # Will sync settings + Installed plug-ins | |
| # | |
| # Tested on OSX - should support Linux too as long as | |
| # you set-up correct SOURCE folder | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Source: http://forums.laravel.com/viewtopic.php?id=1272&p=2 | |
| // useful methods to add to twigview/twigfunctions.php | |
| // return if the current IP matches | |
| function twig_fn_is_ip($ip){ | |
| if($ip === $_SERVER['REMOTE_ADDR']){ | |
| return true; | |
| } | |
| return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Source: http://www.everyonecanweb.com/snippet/view/28 | |
| Route::filter('before', function() | |
| { | |
| // Direct user to clouddueling.com/nickname | |
| $nickname = URI::segment( 1 ); | |
| if( !in_array( $nickname, Controller::detect() ) ) | |
| { | |
| $user = User::where_nickname( $nickname )->first(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # Set-up Sublime settings + packages sync over Dropbox | |
| # | |
| # Will sync settings + Installed plug-ins | |
| # | |
| # Tested on OSX - should support Linux too as long as | |
| # you set-up correct SOURCE folder | |
| # | |
| # Copyright 2012 Mikko Ohtamaa http://opensourcehacker.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $cities = [['id'=>'1','no'=>'1','name'=>'Adana'], ['id'=>'2','no'=>'2','name'=>'Adıyaman'], ['id'=>'3','no'=>'3','name'=>'Afyon'], ['id'=>'4','no'=>'4','name'=>'Ağrı'], ['id'=>'68','no'=>'5','name'=>'Aksaray'], ['id'=>'5','no'=>'6','name'=>'Amasya'], ['id'=>'6','no'=>'7','name'=>'Ankara'], ['id'=>'7','no'=>'8','name'=>'Antalya'], ['id'=>'75','no'=>'9','name'=>'Ardahan'], ['id'=>'8','no'=>'10','name'=>'Artvin'], ['id'=>'9','no'=>'11','name'=>'Aydın'], ['id'=>'10','no'=>'12','name'=>'Balıkesir'], ['id'=>'74','no'=>'13','name'=>'Bartın'], ['id'=>'72','no'=>'14','name'=>'Batman'], ['id'=>'69','no'=>'15','name'=>'Bayburt'], ['id'=>'11','no'=>'16','name'=>'Bilecik'], ['id'=>'12','no'=>'17','name'=>'Bingöl'], ['id'=>'13','no'=>'18','name'=>'Bitlis'], ['id'=>'14','no'=>'19','name'=>'Bolu'], ['id'=>'15','no'=>'20','name'=>'Burdur'], ['id'=>'16','no'=>'21','name'=>'Bursa'], ['id'=>'17','no'=>'22','name'=>'Çanakkale'], ['id'=>'18','no'=>'23','name'=>'Çankırı'], ['id'=>'19','no'=>'24','name'=>'Çorum'], ['id'=>'20', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Source: http://forums.laravel.com/viewtopic.php?pid=20704#p20704 | |
| // Here's a handy macro for creating an image tag that links to a gravatar image. | |
| //If these files/folders don't exist, create a 'macros' folder in your application folder, and create an 'html.php' file in the macros folder. | |
| // In application/start.php add this to the end of the file: | |
| require path('app').'macros/html.php'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $message = ['Good Morning', 'Good Afternoon', 'Good Evening', 'Good Night']; | |
| $greetingsTo = function($to) use($message){ | |
| return $message[rand(0,count($message)-1)].' '.$to; | |
| }; | |
| echo $greetingsTo('Tuana Şeyma'); |