Skip to content

Instantly share code, notes, and snippets.

@pepebe
pepebe / pdf2jpg.snippet.php
Last active February 8, 2024 16:38
pdf2jpg - MODX snippet to create a thumbnail jpg from a pdf file
<?php
/*
pdf2jpg v.0.0.1
---------------------------------------
MODX snippet to create a jpg thumbnail from a pdf file
AUTHOR:
---------------------------------------
info@pepebe.de
@pepebe
pepebe / ul.reset
Created August 28, 2011 15:15
css: reset class for unordered lists
ul.reset,
ul.reset li,
ul.reset ul li {
margin:0;
padding: 0;
text-indent: 0;
list-style-type: 0;
}
@pepebe
pepebe / gist:4554926
Created January 17, 2013 09:52
SQL: Repair German "Umlaute" inside a MySQL Database.
<?php
/**
* Alle kaputten Umlaute reparieren bei Umstellung von ISO->UTF8
* Source: http://xhtmlforum.de/66480-kleines-skript-alle-umlaute-der-datenbank.html
*
* @project -
* @author Boris Bojic <bojic@devshack.biz>
* @copyright Copyright (c) 2011, Boris Bojic (DevShack)
* @version Fri, 23 Dec 2011 13:47:11 +0100
* @updated -

Purpose:

Give a visual feedback on all moregallery custom fields starting with "color".

image

Usage:

Add custom fields to moregallery.

Start the variable name with "color". "colorBg" or "colorText" are valid field names

@pepebe
pepebe / gist:4508243
Created January 11, 2013 05:46
CSS: Cross-Browser Image Grayscale with CSS
/*
Author: Karl Horky
http://www.karlhorky.com/2012/06/cross-browser-image-grayscale-with-css.html
Demo: http://jsfiddle.net/KDtAX/487/
*/
img.grayscale {
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
@pepebe
pepebe / readme.md
Last active August 12, 2023 08:56
Wordpress shortcode: Render all posts by a certain user

shortcode

[wsrn_autorPosts user="11"]

Note: user must contain a valid userid

Note:

html is rendered by a small function that replaces a placeholder inside swirly brackets with a value from an array.

@pepebe
pepebe / collections.imageRenderer.php
Last active July 14, 2023 18:32
Collections - Snippetrenderer for images. Supports Media Source
<?php
// Collections Snippet Renderer
// Version: 0.1
// 2do: autoimatically retrieve assets path from media source
$row = $modx->getOption('row', $scriptProperties, '');
$value = $modx->getOption('value', $scriptProperties, '');
$column = $modx->getOption('column', $scriptProperties, '');
$imgName = $value;
@pepebe
pepebe / readme.md
Last active June 21, 2023 09:43
pdoTools Kichensink

About this list

A currated list of useful pdoTools settings/examples

@pepebe
pepebe / regClient.snippet.php
Last active October 27, 2022 14:01
regClient: Move stuff around inside your modx template
<?php
/*
Reposition Blocks of Code:
--------------------------
[[!regClient?
&value=`code block or file url`
&option=`regClientCSS`
]]
&option - Pick one of the regClient functions
@pepebe
pepebe / gist:4369623
Last active October 11, 2022 11:34
Progressive loading with Cycle2
Cycle2 doesn't support progressive loading for sliders utilizing the pager option:
As a quickfix I lazyload all images with jail.js and after jail is finished I initialize cycle().
HOWTO:
1. Download jail.js: https://github.com/sebarmeli/JAIL/blob/master/src/jail.js
hint: get familiar with all the options jail offers. It's really a nice tool.
2. Add jail.js to the head of your html