This file contains 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
$('pre.gist').each(function(){ | |
var placeholder = $(this); | |
var filename = placeholder.data('file'); | |
$.ajax({ | |
url: 'https://api.github.com/gists/'+$(this).data('id'), | |
type: 'GET', | |
dataType: 'jsonp' | |
}).success( function(gistdata) { | |
if(filename != null && typeof gistdata.data.files[filename] !== "undefined"){ | |
var content = gistdata.data.files[filename].content; |
This file contains 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
/** | |
* @param Collection $data | |
* @param string $key Ключ для записи с числовым значением | |
* @return Collection | |
*/ | |
function Analitics(Collection $data, $key){ | |
$out = new Collection; | |
$sum = $data->sum(function($item) use ($key){ | |
return $item[$key]; | |
}); |
This file contains 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 | |
/**************************************/ | |
/** HtmlInLine plugin for MODX Revo | |
* | |
* @version 1.2 | |
* @author Borisov Evgeniy aka Agel Nash (agel-nash@xaker.ru) | |
* @date 20.07.2012 | |
* | |
* @category plugin | |
* @internal @event OnWebPagePrerender |
This file contains 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 | |
/**************************************/ | |
/** StaticUrl plugin for MODX Revo | |
* | |
* @version 1.2 | |
* @author Borisov Evgeniy aka Agel Nash (agel-nash@xaker.ru) | |
* @date 23.10.2012 | |
* | |
* @category plugin | |
* @internal @event OnWebPagePrerender |
This file contains 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 | |
/** | |
* AssetsDoc snippet for MODX Evolution | |
* @desc Список опубликованных документов с определенной группой к которой имеет доступ текущий пользователь. | |
* @version 0.1 | |
* @author Borisov Evgeniy aka Agel Nash (agel-nash@xaker.ru) | |
* @date 04.01.2013 | |
* | |
* @category snippet |
This file contains 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 | |
/** | |
* SEOphpthumb | |
* | |
* @category snippet | |
* @version 1.3 | |
* @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html | |
* @author Agel_Nash <Agel_Nash@xaker.ru> | |
*/ | |
This file contains 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 | |
/** | |
* Include once file | |
* | |
* @category validate | |
* @version 0.1 | |
* @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html | |
* @param string $file Файл который необходимо подключить в текущей папке | |
* @param boolean $ret Возвращать статус подключения файла или его ответ | |
* @return boolean Результат подключения файла |
This file contains 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 | |
/** | |
* Protect TV-saver | |
* | |
* @category plugin | |
* @version 0.1 | |
* @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html | |
* @internal @events OnBeforeDocFormSave | |
* @internal @modx_category Manager and Admin | |
* @author Agel_Nash <Agel_Nash@xaker.ru> |
This file contains 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 | |
/** | |
* PHP: Detect location by IP | |
* http://www.catswhocode.com/blog/10-super-useful-php-snippets-you-probably-havent-seen | |
*/ | |
function detect_city($ip) { | |
$default = 'UNKNOWN'; | |
if (!is_string($ip) || strlen($ip) < 1 || $ip == '127.0.0.1' || $ip == 'localhost') |
This file contains 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 | |
/** | |
* TagPopular | |
* | |
* [[TagPopular? &tpl=`TagCloudItem` &tv=`7` &count=`15`]] | |
* | |
* TagCloudItem: | |
* <a href="/[~11~]?tag=[[urlencode? &input=`[+name+]`]]" title="Статьи с тегом [+name+]" class="label">[+name+] ([+count+])</a> | |
* | |
* @category snippet |
OlderNewer