Skip to content

Instantly share code, notes, and snippets.

@modxws
modxws / getRandomQuipVideos.php
Created December 8, 2012 19:30
Quip, xPDO, youtube links into embeded html-code. Get Quip comments from thread 'videos' and parse them for creating embedded blocks of random youtube videos
<?
/**************************************************
[[!getRandomVideos?
&limit=`3`
&width=`310`
&height=`233`]]
MODX Revolution, Quip, xPDO, youtube links into embeded html-code.
Get Quip comments from thread 'videos' and parse them
for creating embedded blocks of random youtube videos.
Author Viktorminator http://modx.ws
@modxws
modxws / modxws-urok17-1.xml
Created July 1, 2012 11:36
XML: modxws-urok17-1
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>[[*longtitle]]</title>
<link>[[~[[*id]]? &scheme=`full`]]</link>
<description>[[*introtext:cdata]]</description>
<language>[[++cultureKey]]</language>
<ttl>120</ttl>
<atom:link href="[[~[[*id]]? &scheme=`full`]]" rel="self" type="application/rss+xml" />
[[!getResources?
vendor(prop, args)
-webkit-{prop} args
-moz-{prop} args
-ms-{prop} args
-o-{prop} args
{prop} args
transition()
vendor('transition', arguments)
.socicons
a.socicons__ico.socicons__ico--vk(href='http://vk.com/modxrevolution')
i.fa.fa-vk
a.socicons__ico.socicons__ico--fa(href='https://www.facebook.com/groups/modxrevolution/')
i.fa.fa-facebook
a.socicons__ico.socicons__ico--twitter(href='http://twitter.com/@viktorminator')
i.fa.fa-twitter
a.socicons__ico.socicons__ico--github(href='http://github.com/Viktorminator')
i.fa.fa-github
a.socicons__ico.socicons__ico--skype(href='skype:viktorminator?chat&topic=MODX уроки')
git clone git@github.com:Viktorminator/socicons.git && cd socicons && bower install && npm install
link(rel='stylesheet', href='bower_components/font-awesome/css/font-awesome.css')
mkdir myicons
cd myicons
yo tapp
@modxws
modxws / tags.html
Created August 9, 2013 23:19
Tags with toLinks Snippet MODX
[[*blogtags:notempty=`[[!tolinks? &items=`[[*blogtags]]` &tagKey=`blogtags` &tpl=`tolinks.tpl` &outputDelim=`` &target=`28`]]`]]
<?php
// Отвечаем ТОЛЬКО на ajax запросы
if ($_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest') {return;}
// данный код можно расширить добавив другие действия и указать их в case
$action = filter_input(INPUT_POST,'action');
// Если в массиве POST нет действия - выход
if (empty($action)) {return;}
@modxws
modxws / metadata.html
Created August 7, 2013 23:48
metadata
<meta property="og:image" content="[[++site_url]][[*title_post_image:phpthumbof=`w=90&h=90&q=80&zc=T`]]"/>
<meta property="og:site_name" content="[[++site_name:htmlent]]"/>
<meta property="og:title" content="[[*pagetitle]]"/>
<meta property="og:url" content="[[~[[*id]]? &scheme=`full`]]"/>
<meta property="og:type" content="article"/>