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 | |
| list($hours, $mins) = explode(':', $_POST['time']); | |
| if ($_POST['ampm'] == 'am' AND $hours == 12) | |
| $hours = 0; | |
| elseif ($_POST['ampm'] == 'pm' AND $hours != 12) | |
| $hours += 12; | |
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
| # most basic approach | |
| find system -type f -exec sed -i -e "s/defined('SYSPATH') OR die('No direct access allowed.');//" '{}' \; | |
| # case insensitive | |
| find system -type f -exec sed -i -e "s/defined('SYSPATH') [oO][rR] die('No direct access allowed.');//" '{}' \; | |
| # case insensitive with any die message | |
| find system -type f -exec sed -i -e "s/defined('SYSPATH') [oO][rR] die('[^']\{0,\}');//" '{}' \; | |
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 | |
| $curl = Curl::factory(array('options' => array(CURLOPT_FAILONERROR => FALSE, CURLOPT_URL => 'http://sam.clark.name'))); | |
| var_dump($curl); |
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 defined('SYSPATH') or die('No direct script access.'); | |
| class chrono_Core { | |
| /** | |
| * Outputs a textual representation of | |
| * how long ago something happened | |
| * | |
| * @param int time_stamp | |
| * @return string |
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
| # default server | |
| server { | |
| listen 80; | |
| server_name dev.kohana.framework; | |
| root /mnt/hgfs/Projects/kohana; | |
| access_log /var/log/nginx/dev.kohana.framework.access.log; | |
| error_log /var/log/nginx/dev.kohana.framework.error.log; | |
| location / { |
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 | |
| /** | |
| * Sets the view filename. | |
| * | |
| * @throws View_Exception | |
| * @param string filename | |
| * @return View | |
| */ | |
| public function set_filename($file) | |
| { |
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 | |
| $statuses = ORM::factory('status')->find_all()->as_array(); | |
| $multi_array = array(); | |
| foreach ($statuses as $key => $value) | |
| { | |
| $multi_array[$key] = $value->as_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 | |
| Route::set('default', '(<controller>)((/<id>)/<action>)') | |
| ->defaults(array( | |
| 'controller' => 'auth', | |
| 'action' => 'index', | |
| )); |
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 | |
| Route::set('feed', 'feed<format>', array('format' => '\.\w+')) | |
| ->defaults(array( | |
| 'controller' => 'feed', | |
| )); | |
| Route::set('article', 'article(s)/<article>(<format>)', array('format' => '\.\w+')) | |
| ->defaults(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 | |
| /** | |
| * View node that mirrors node, providing a MySQL view to the | |
| * nodes and related tables. | |
| * | |
| * This has been implemented to allow node searching from the | |
| * main context screen | |
| */ | |
| class node_view extends tsMetaNode { | |
| protected $table = 'view_nodes'; |