Skip to content

Instantly share code, notes, and snippets.

JP DeVries jpdevries

Block or report user

Report or block jpdevries

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jpdevries
jpdevries / gist:4579637
Last active Dec 11, 2015
MODX Revolution PHP Snippet to return site_start context setting of b.com context
View gist:4579637
<?php
// assumes there is a site_url context_setting for b.com with a value such as http://b.com/
$setting = $modx->getObject('modContextSetting', array(
'context_key' => 'b.com',
'key' => 'site_url',
));
return $setting->get('value');
@jpdevries
jpdevries / gist:4684764
Created Jan 31, 2013
example of manually coded main nav in MODX as opposed to using wayfinder for everything
View gist:4684764
<header>
<a href="[[++site_url]]" class="logo">Heart Coffee Roasters</a>
<nav class="primary">
<ul>
<li class="home"><a href="[[++site_url]]">Home</a></li>
<li class="about">
<a class="tap-touch " href="[[~12? &scheme=`full`]]">About<span class="extra"> Heart</span></a>
<div class="dropdown-mask">
<div class="dropdown">
<ul>
@jpdevries
jpdevries / gist:5347290
Created Apr 9, 2013
HTML Source for Pow Pass Map Page
View gist:5347290
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Pow Pass - Boreal</title>
@jpdevries
jpdevries / gist:5347393
Created Apr 9, 2013
Pow Pass Map Pin List
View gist:5347393
<div id="map-canvas">
<ul>
<!-- list all the resorts -->
<li data-id="4" data-href="/north-america/westcoast/oregon/cooper-spur-ski-area.html" data-ajax="/north-america/westcoast/oregon/cooper-spur-ski-area.html?ajax=1" data-ridden="">
<h3>Cooper Spur</h3>
<p class="coords">Coordinates:<span class="lat">45.4117233</span>,<span class="lng">-121.6055214</span></p>
</li>
<li data-id="6" data-href="/north-america/westcoast/california/mt.-shasta-ski-park.html" data-ajax="/north-america/westcoast/california/mt.-shasta-ski-park.html?ajax=1" data-ridden="">
<h3>Mt. Shasta</h3>
<p class="coords">Coordinates:<span class="lat">41.2759798</span>,<span class="lng">-122.2130865</span></p>
@jpdevries
jpdevries / gist:5347775
Created Apr 9, 2013
Pow Pass Map JavaScript
View gist:5347775
<script type="text/javascript">
function initialize() {
$.address.state('/');
var _pins = [];
$('#map-canvas li').each(function(){
var _title = $(this).find('h3').html();
var _lat = $(this).find('.lat').html();
var _lng = $(this).find('.lng').html();
_pins.push({title:_title,lat:_lat,lng:_lng,href:$(this).data('href'),ajax:$(this).data('ajax'),ridden:$(this).data('ridden'),id:$(this).data('id')});
@jpdevries
jpdevries / gist:5347795
Created Apr 9, 2013
Pow Pass AJAX Response
View gist:5347795
<h1><span>Boreal</span><i class="icon-ok"></i></h1>
<ul class="nav"><li class="prev"><a href="north-america/westcoast/california/alpine-meadows.html" class="prev" title="Alpine Meadows"><i class="icon-double-angle-left"></i>&nbsp;Alpine Meadows</a></li><li class="next"><a href="north-america/westcoast/california/donner-ski-ranch.html" class="next" title="Donner Ski Ranch">Donner Ski Ranch&nbsp;<i class="icon-double-angle-right"></i></a></li></ul>
<ul class="nav">
<li style="width:100%;float:none;text-align:center"><a href="north-america/westcoast/california/">&ndash;&nbsp;&nbsp;View California Resorts&nbsp;&nbsp;&ndash;</a></li>
</ul>
<p><strong><br /></strong><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Parking_lot_at_boreal.jpg/800px-Parking_lot_at_boreal.jpg" alt="" width="800" height="533" /></p>
<p><strong>Boreal Mountain Resort</strong> is a <a class="mw-redirect" title="Ski area" href="http://en.wikipedia.org/wiki/Ski_area">ski area</a> in <a title="So
@jpdevries
jpdevries / gist:5505905
Created May 2, 2013
Export PhotoShop Layers as .png (save as a .jsx file open in Adobe ExtendScript Toolkit)
View gist:5505905
// layerName.jsx
// Copyright 2006-2008
// Written by Jeffrey Tranberry
// Photoshop for Geeks Version 2.0
/*
Description:
Using an alert(); to display current Layer's name.
Set the name of the current layer to a string "Timmy"
*/
@jpdevries
jpdevries / gist:5514537
Created May 3, 2013
JSFL Script to turn PNG Sequence into Reflected SWF animation
View gist:5514537
/**
* @language JSFL
*
* @author JP DeVries
* @since 24.08.11
* @version 0.1
*
* @description
* This is a jsfl script that will take all png files from a source folder and create a swf of the sequence playing forwards, then backwards
* The file that is currently open and has focus in the IDE is used as the host for exporting.
@jpdevries
jpdevries / gist:5516772
Last active Dec 16, 2015
Using phpthumb in a MODX CMP
View gist:5516772
$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',
@jpdevries
jpdevries / cacheguard.php
Last active Feb 28, 2017
Untick Empty Cache Checkbox for Unpublished Resources in MODX Revolution Plugin
View cacheguard.php
<?php
/**
* cacheguard plugin for cacheguard extra
*
* Copyright 2013 by JP DeVries jp@modx.com
* Created on 06-21-2013
*
* cacheguard is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
You can’t perform that action at this time.