Skip to content

Instantly share code, notes, and snippets.

@pepebe
pepebe / Executioner.snippet.php
Created February 24, 2012 19:37 — forked from opengeek/Executioner.snippet.php
MODX REVO : Executioner snippet
<?php
/*
Fork of the original executioner snippet by opengeek
Usage:
[[!Executioner?
&tElementClass=`modSnippet`
&tEcho=`comment`
&tElement=`getResourceField`
&id=`27`
@pepebe
pepebe / transpose_table.js
Created July 31, 2012 08:45 — forked from pgaertig/transpose_table.js
JS: Transpose HTML table using jQuery
$(function() {
var t = $('#thetable tbody').eq(0);
var r = t.find('tr');
var cols= r.length;
var rows= r.eq(0).find('td').length;
var cell, next, tem, i = 0;
var tb= $('<tbody></tbody>');
while(i<rows){
cell= 0;
@pepebe
pepebe / find-that-bastard.js
Created September 28, 2012 10:57 — forked from gnab/find-that-bastard.js
JS: Find the event handler blocking events (event.preventDefault())
// Scenario: Some event handler is blocking events (event.preventDefault()) that shouldn't be blocked, i.e. because it binds to document instead of a more specific element
// 1) Place this before all other JavaScript
var originalPreventDefault = Event.prototype.preventDefault;
Event.prototype.preventDefault = function () {
// Lookup specific event you're expecting, i.e. pressing space
if (this instanceof KeyboardEvent && this.keyCode === 32) {
// This will log an error with full stack trace
make_error_to_see_stacktrace
@pepebe
pepebe / optimized.html
Last active October 11, 2015 05:57 — forked from opengeek/optimized.html
Example of optimizing conditional filters using a Chunk wrapper
[[[[*page-image:notempty=`$wrapImgThumb?
&src=`*page-image`
&alt=`[[*pagetitle]]`
&thumbOpts=`w=480&h=320`
`]]]]
@pepebe
pepebe / chunk.html
Created October 23, 2012 14:09 — forked from Mark-H/chunk.html
Plugin to send email notifications to all members of a user group
<p>Hi there!</p>
<p>The resource [[+pagetitle]] (ID: [[+id]]) has been [[+mode]].</p>
<p>You can login to the manager at www.mysite.com/manager/ to review and if needed publish the resource.</p>
<p>Thank you!</p>
<?php
/* forked from MikeRogers0/twitter-proxy.php */
/**
* Usage:
* Send the url you want to access url encoded in the url paramater, for example (This is with JS):
* /twitter-proxy.php?url='+encodeURIComponent('statuses/user_timeline.json?screen_name=MikeRogers0&count=2')
*/
<?php
class videoThumb {
var $config;
function __construct($config = array()) {
$this->config = array_merge(array(
'imagesPath' => dirname(__FILE__) . '/images/'
,'imagesUrl' => '/images/'
var content = '';
content += '<h3>Hinweise</h3>';
content += '<p>Hinweistext</p>';
content += '<style>.hdkInfo-panel p {margin-bottom: 10px; line-height:1.6;} .hdkInfo-panel h4 {margin-top: 15px; margin-bottom: 5px;}</style>';
var hdkInfo = function(config) {
@pepebe
pepebe / gist:11168024
Created April 22, 2014 07:04 — forked from jpdevries/gist:5516772
Use phpthumbof in a cmp
$modAuth = $this->modx->user->getUserToken('mgr');
$thumbQuery = http_build_query(array(
'src' => $image['urlAbsolute'],
'w' => 360,
'h' => 270,
'HTTP_MODAUTH' => $modAuth,
//'f' => $thumbnailType,
'q' => 80,
'wctx' => 'mgr',
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php