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
/* | |
*last 6 featured articles | |
*/ | |
$db = JFactory::getDbo(); | |
$query = $db->getQuery(true); | |
$query->select('*') | |
->from($db->quoteName('#__content')) | |
->where($db->quoteName('featured') . ' = 1 ') | |
->order('created DESC'); |
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
/* | |
* get subcategory ids | |
*/ | |
$catID = $this->category->id; | |
$categories = JCategories::getInstance('Content'); | |
$cat = $categories->get($catID); | |
$children = $cat->getChildren(); | |
$children = array_map(function($el) { | |
return (array)$el; |
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
# Usage examples: | |
# | |
# dataService.getTree().then((response)-> | |
# if response | |
# $scope.list = response.data | |
# | |
# dataService.saveTree(nodeData) | |
.service "dataService", ($http) -> | |
delete $http.defaults.headers.common["X-Requested-With"] |
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
# Usage: <input type="hidden" ng-model="elementid" ng-update-hidden /> | |
.directive 'ngUpdateHidden', -> | |
(scope, el, attr) -> | |
model = attr["ngModel"] | |
scope.$watch model, (nv) -> | |
el.val nv | |
return | |
return |
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
/* | |
* возвращает путь к локальному файлу - thumbnail'у видео с youtube | |
*/ | |
$getYoutubeThumb = function ($videoUrl) { | |
/* | |
* скачивает в кэш thumbnail видео, возвращает полный путь к файлу | |
* Имя файла = md5(url) | |
*/ | |
$downloadPic = function ($srcUrl, $getThumbUrl) { | |
return call_user_func( |
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
# разбор GET параметров | |
getParams = -> | |
query = window.location.search.substring(1) | |
raw_vars = query.split("&") | |
params = {} | |
for v in raw_vars | |
[key, val] = v.split("=") | |
params[key] = decodeURIComponent(val) | |
params |
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
encodeQueryData = (data) -> | |
ret = [] | |
for d of data | |
ret.push(encodeURIComponent(d) + "=" + encodeURIComponent(data[d])) | |
ret.join "&" |
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
$regionsList = array_map("unserialize", array_unique(array_map("serialize", $regionsList))); |
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
# clone git repository | |
git clone --bare repository.git repoclone | |
cd repoclone | |
git push --mirror new-repository.git |
OlderNewer