Skip to content

Instantly share code, notes, and snippets.

@Cipa
Cipa / gist:5267977
Created March 29, 2013 00:46
ditto/list filter.class.inc.php a new filter
case 12 : // if not in comma delimited list
//works well with checkboxes configured to output a comma separated id list
if(!in_array($this->filterValue, explode(',', $value[$this->array_key])))
$unset = 0;
break;
@Cipa
Cipa / gist:4176156
Created November 30, 2012 14:39 — forked from madrobby/gist:4161897
Retina screen media query
@media (min--moz-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
(-webkit-min-device-pixel-ratio: 1.5),
(min-device-pixel-ratio: 1.5),
(min-resolution: 144dpi),
(min-resolution: 1.5dppx) {
/* Retina rules! */
}
@Cipa
Cipa / gist:3784058
Created September 25, 2012 19:54
Dropdown TV @select binding
@SELECT `pagetitle` AS `name`,`id` FROM `[+PREFIX+]site_content` WHERE `published` = 1 AND `deleted` = 0 AND `parent`=4 ORDER BY name ASC
@Cipa
Cipa / remove www
Last active October 2, 2015 18:28
remove www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [R=301,QSA,NC,L]
@Cipa
Cipa / custom modx evolution tinymce config
Created February 29, 2012 19:53
custom modx evolution tinymce config
autosave,save,advlist,style,fullscreen,advimage,paste,advlink,media,contextmenu,table,nonbreaking,visualchars
undo,redo,selectall,separator,pastetext,pasteword,separator,search,replace,separator,nonbreaking,hr,charmap,separator,image,link,unlink,anchor,media,separator,cleanup,removeformat,separator,fullscreen,print,code,help
bold,italic,underline,strikethrough,sub,sup,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect,separator,styleprops
@Cipa
Cipa / phx:FullUrls.php
Created November 2, 2011 14:36
Full urls custom modfier for PHx
<?php
$replace = array();
$replaceWith = array();
//match links
preg_match_all('(href="(.*?)")',$output,$matches);
foreach($matches[1] as $key=>$m){
@Cipa
Cipa / chunk.weblogin.css
Created October 16, 2011 15:35
CSS for MODX Evolution WebLogin clean template
#LoginForm{
}
#LoginForm div.row {
overflow: hidden;
padding-bottom: 10px;
}
#LoginForm div.row label{
display: block;
width: 100px;
@Cipa
Cipa / chunk.weblogin.tpl.html
Created October 16, 2011 14:50
MODX Evolution WebLogin clean template
<!-- #declare:separator <hr> -->
<!-- login form section-->
<form method="post" name="loginfrm" action="[+action+]" id="LoginForm">
<input type="hidden" value="[+rememberme+]" name="rememberme">
<div class="row">
<label for="username">User:</label>
<input type="text" name="username" id="username" tabindex="1" onkeypress="return webLoginEnter(document.loginfrm.password);" value="[+username+]" />
</div>
<div class="row">
<label for="username">Password:</label>
@Cipa
Cipa / redirect to parent revo
Created September 8, 2011 00:20
redirect to parent revo
$modx->sendRedirect($modx->makeUrl($modx->resource->get('parent'), '', '', 'full'));
@Cipa
Cipa / labels and values revo
Created September 1, 2011 12:34
MODX Revolution - Get labels and values for checkbox, radio and select TVs
$tv = $modx->getObject('modTemplateVar',array('name'=>'MyTv'));
// or
//$tv = $modx->getObject('modTemplateVar',$id); // ID of the TV
$optionValues = $tv->get('elements');
$defaultValue = $tv->get('default_text');