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
// script for endless scrolling using jQuery | |
// demo: http://www.jstoolbox.com/demo/endless/ | |
var engine = { | |
posts : [], | |
target : null, | |
busy : false, | |
count : 5, | |
render : function(obj){ |
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 $this->table()->setCaption('Список записей') | |
->setAttributes(array('class' => 'mytable', 'id' => 'postsList')) | |
->setFooter('<a href="/admin/blog/create">Создать новую запись</a>') | |
->setColumns(array('title' => 'Название','post_author' => 'Автор','edit_options' => '')) | |
->setCellContent('<a href="/admin/blog/edit?id={id}">Редактировать</a>', 'edit_options') | |
->setEmptyRowContent('Пока нет ни одной записи') | |
->setRows($this->posts); ?> | |
<?= $this->table() ?> |
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
function calculate_median($arr) { | |
$count = count($arr); //total numbers in array | |
$middleval = floor(($count-1)/2); // find the middle value, or the lowest middle value | |
if($count % 2) { // odd number, middle is the median | |
$median = $arr[$middleval]; | |
} else { // even number, calculate avg of 2 medians | |
$low = $arr[$middleval]; | |
$high = $arr[$middleval+1]; | |
$median = (($low+$high)/2); | |
} |
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
Function.prototype.inherits = function(fnParent) { | |
this.prototype.super = fnParent; | |
for (var s in fnParent.prototype) { | |
this.prototype[s] = fnParent.prototype[s]; | |
} | |
return this; | |
} | |
parentClass = function (args) { | |
this._name = ''; |
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
/*! | |
* Ext JS Library 3.3.1 | |
* Copyright(c) 2006-2010 Sencha Inc. | |
* [email protected] | |
* http://www.sencha.com/license | |
*/ | |
/** | |
* @class Ext.ux.tree.TreeGridNodeUI | |
* @extends Ext.tree.TreeNodeUI | |
*/ |
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 | |
/** | |
* Table View Helper | |
*/ | |
class App_View_Helper_Table extends Zend_View_Helper_Placeholder_Container_Standalone | |
{ | |
/** | |
* @var string registry key | |
*/ |
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 | |
namespace My\Application\Container; | |
use Doctrine\Common\Annotations\AnnotationReader, | |
Doctrine\MongoDB\Connection, | |
Doctrine\ODM\MongoDB\Configuration, | |
Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver, | |
Doctrine\ODM\MongoDB\DocumentManager; | |
/** |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>Открывающаяся панель на MooTools</title> | |
<script type="text/javascript" src="mootools.min.js"></script> | |
<script type="text/javascript"> | |
window.addEvent('domready', function(){ | |
var mySlide = new Fx.Slide('section'); | |
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
/** | |
* Generate random integer from 0 to limit. | |
*/ | |
function rnd(limit) { | |
return (Math.random()*limit)|0; | |
} | |
/** | |
* Generate random float value in range. | |
*/ |
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
function moveCursorToEnd(el) { | |
if (typeof el.selectionStart == "number") { | |
el.selectionStart = el.selectionEnd = el.value.length; | |
} else if (typeof el.createTextRange != "undefined") { | |
el.focus(); | |
var range = el.createTextRange(); | |
range.collapse(false); | |
range.select(); | |
} | |
} |
OlderNewer