Skip to content

Instantly share code, notes, and snippets.

var file = 'path/to/a/file',
stats = fs.statSync(file);
var bufferSize = 4 * 1024 * 1024;
options = {
from: 0,
to: bufferSize,
bufferSize: bufferSize
diff --git a/classes/kohana/view.php b/classes/kohana/view.php
index 17b6fb5..7bffe36 100644
--- a/classes/kohana/view.php
+++ b/classes/kohana/view.php
@@ -130,6 +130,13 @@ class Kohana_View {
{
$this->set_filename($file);
}
+ else
+ {
$directory = rtrim($directory, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
if ($paths === NULL)
{
$paths = Kohana::paths();
}
$found = array();
foreach ($paths as $path)
DB::select()
->join('table', 'type')
->on('column1', 'operator', 'column2');
DB::select(array('*', 'rank' => DB::expr('ts_rank_cd(fulltext_tsvector, to_tsquery(\'kohana or something\')))')))
->from('page')
->where(DB::expr('to_tsquery(\'kohana or something\')::tsquery'), '@@', DB::expr('fulltext_tsvector::tsvector'));
/**
* Returns a list containing items in need of deleteing, and item's in need of adding.
*
* list($adding, $deleting) = arr::diff($source, $current);
*
* @param array The new array.
* @param array The existing array.
* @returns array
*/
public static function diff(array $source, array $current)
public static function merge(array $array1, array $_)
{
$result = array();
foreach (func_get_args() as $array)
{
$i = 0;
foreach ($array as $key => $value)
{
<?php
if (isset($_POST['account']) AND ! empty($_POST['account']))
{
header('Content-Type: application/xml; charset=ISO-8859-1');
print_r load('http://twitter.com/users/show/'.$_POST['account'].'xml');
}
else
{
print 'Invalid input data.';
// Get a recursive array of every model
$models = new RecursiveArrayIterator(Kohana::list_files('classes/model'));
// Loop through each model recursively
foreach (new RecursiveIteratorIterator($models) as $model => $path)
{
// Clean up the model name, and make it relative to the model folder
$model = trim(str_replace(array('classes/model', EXT), '', $model), DIRECTORY_SEPARATOR);
// Replace the directory seperators with underscores
public static function memory($bytes, $places = 2)
{
static $suffexes = array(
'B', 'KB', 'MB', 'GB', 'TB', 'PB'
);
$i = 0;
while ($bytes > 10)
{