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/bash | |
success_color='\E[0;32m' | |
error_color='\E[0;31m' | |
end_color="\033[0m" | |
# custom echo | |
# Example: | |
# cwrite 'test' $success_color | |
# cwrite 'test' $error_color |
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
SELECT | |
`calldate`, | |
COUNT(`duration`) as count_all_calls, | |
SUM(IF((`duration`-12)>0, 1, 0)) as count_paid_calls, | |
SUM(`duration`) as summ_all_second, | |
SUM(IF(`duration`>12, `duration`-12, 0)) as summ_paid_second, | |
CEILING(SUM(`duration`)/60) as summ_all_minutes, | |
CEILING(SUM(IF((`duration`-12)>0, `duration`-12, 0))/60) as summ_paid_minutes | |
FROM `cdr` | |
WHERE `calldate` BETWEEN '2012-06-13 12:00:00' and '2012-06-13 18:00:00' |
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
img.grayscale.disabled { | |
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale"); | |
-webkit-filter: grayscale(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 | |
namespace Kohana; | |
use \Kohana; | |
class View { | |
protected static $_global_data = array(); | |
protected static $_paths = array('views'); |
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
- [ ] a task list item | |
- [ ] list syntax required | |
- [ ] normal **formatting**, @mentions, #1234 refs | |
- [ ] incomplete | |
- [x] completed |
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 | |
/* | |
Класс-маршрутизатор для определения запрашиваемой страницы. | |
> цепляет классы контроллеров и моделей; | |
> создает экземпляры контролеров страниц и вызывает действия этих контроллеров. | |
*/ | |
class Route | |
{ |
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 render_level_list($items) | |
{ | |
$level=0; | |
foreach($items as $item) | |
{ | |
if($item->level==$level) { | |
echo "</li>\n"; | |
} |
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
// получаем URL параметры | |
// var allVars = $.getUrlVars(); | |
// получаем значение параметра по его имени | |
// var byName = $.getUrlVar('name'); | |
$.extend({ | |
getUrlVars: function(){ | |
var vars = [], hash; |
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 | |
/** | |
* Convert a multi-dimensional array into a stdClass object. | |
* | |
* Example: | |
* $values = array('hello'=>'world'); | |
* | |
* // Convert the array to an object | |
* array_to_object($values); | |
* |
NewerOlder