Skip to content

Instantly share code, notes, and snippets.

<?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
<?php
/**
* MODX Revolution OnElementNotFound plugin
* Add static elements inside categories for defined packages OnElementNotFound
*
* Author: Jeroen Kenters / www.kenters.com
* Version: 1.0.0-beta
* License: GPL
*
* Warning:
@pepebe
pepebe / mgThumb.plugin.php
Last active August 29, 2015 14:01 — forked from christianseel/moregallery img to TV
Add this as a plugin (OnDocFormSave). Saves the first MoreGallery image or cropimage into a TV (could be a hidden one) for quicker access.
<?php
/*
mgThumb by pepebe
---------------------------------------------
saves the first image in a galley inside a tv
trigger OnDocFormSave
Initial idea: https://gist.github.com/christianseel/557a1e0f2a1f502ce1c5
Changelog:
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
@pepebe
pepebe / plugin.php
Created August 20, 2014 22:33 — forked from Mark-H/plugin.php
<?php
if ($modx->getOption('http_host') == 'YOUR_DOMAIN_HERE') {
$op = '<script type="text/javascript">
Ext.onReady(function() {
document.getElementById("modx-login-username").value = "USER";
document.getElementById("modx-login-password").value = "PASS";
document.getElementById("modx-login-btn").click();
});
</script>';
/**
* A* (A-Star) Pathfinding Algorithm in JavaScript
* @author Matthew Trost
* @license Creative Commons Attribution-ShareAlike 3.0 Unported License
* @datepublished December 2010
*/
function astar (map, heuristic, cutCorners) {
var listOpen = [];
var listClosed = [];