Skip to content

Instantly share code, notes, and snippets.

View ischenkodv's full-sized avatar

Dmitri Ischenko ischenkodv

  • Ukraine, Kryvyi Rih
View GitHub Profile
@ischenkodv
ischenkodv / ie_conditionals.html
Created February 11, 2014 21:11
Adding class names depending on Internet Explorer version.
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8" lang="en"> <![endif]-->
<!--[if IE 9 ]> <html class="ie9" lang="en"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
<body></body>
</html>
@ischenkodv
ischenkodv / joomla_json.php
Created November 30, 2014 00:35
Return JSON data from action of Joomla controller.
/**
* JSON response from controller's action.
*/
public function run( )
{
JFactory::getDocument()->setMimeEncoding( 'application/json' );
JResponse::setHeader('Content-Disposition','attachment;filename="progress-report-results.json"');
$data = array(
'foo' => 'bar'
@ischenkodv
ischenkodv / AsyncQueueSpec.js
Created February 28, 2015 20:22
Unit tests for AsyncQueue
describe('run()', function() {
var realNextFrame, realCancelFrame;
beforeEach(function() {
jasmine.clock().install();
jasmine.RequestAnimationFrame.install();
realNextFrame = window.nextFrame;
realCancelFrame = window.cancelFrame;
window.nextFrame = window.requestAnimationFrame;
describe('findByNavigator()', function() {
var geolocator, fnDone, fnFail;
beforeEach(function() {
geolocator = new Geolocator({language: 'fi'});
});
it('can find user location', function() {
var location, address, components;
@ischenkodv
ischenkodv / strings.js
Created April 18, 2015 21:07
Unit tests for lesson 2
/**
* This is module to test.
*/
module.exports = {
camelCase: function(string) {
return string.replace(/-[a-z]/g, function(match) {
return match[1].toUpperCase() + match.slice(2);
});
},
dashSeparated: function(string) {
@ischenkodv
ischenkodv / endless.js
Created April 18, 2009 21:35
Script for endless scrolling using jQuery
// 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){
<?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() ?>
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 = '';
@ischenkodv
ischenkodv / gist:745436
Created December 17, 2010 18:27
Checkboxes in Sencha TreeGrid
/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
/**
* @class Ext.ux.tree.TreeGridNodeUI
* @extends Ext.tree.TreeNodeUI
*/
@ischenkodv
ischenkodv / gist:812481
Created February 5, 2011 14:13
Table View Helper for Zend Framework.
<?php
/**
* Table View Helper
*/
class App_View_Helper_Table extends Zend_View_Helper_Placeholder_Container_Standalone
{
/**
* @var string registry key
*/