This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
archey -o | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management | |
# 6. Networking | |
# 7. System Operations & Information |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$options = (isset($options))?$options:'span'; | |
$words = explode(" ", $input); | |
$words[count($words)-1] = '<'.$options.'>'.$words[count($words)-1]'</'.$options.'>'.; | |
return implode(" ", $words); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Based on https://gist.github.com/OptimusCrime/dac5deec0d65872740c9d7bccdc5e336 | |
** Add system setting named "max_image_dimension" to set a max height or width for images | |
*/ | |
if(!function_exists(autoRotateImage)) { | |
function autoRotateImage($image,$max_image_dimension = 0) { | |
$orientation = $image->getImageOrientation(); | |
switch($orientation) { | |
case imagick::ORIENTATION_BOTTOMRIGHT: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<policy> | |
<template> | |
<name>AdministratorTemplate</name> | |
<description>Context administration policy template with all permissions.</description> | |
<lexicon>permissions</lexicon> | |
<template_group>Admin</template_group> | |
<permissions> | |
<permission> | |
<name>about</name> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@INHERIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: Mat | |
* Date: 6/19/2017 | |
* Time: 3:33 AM | |
*/ | |
$sc = $modx->getService('simplecart','SimpleCart',$modx->getOption('simplecart.core_path',null,$modx->getOption('core_path').'components/simplecart/').'model/simplecart/',$scriptProperties); | |
if (!($sc instanceof SimpleCart)) return ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[!FormIt? | |
&store=`1` | |
&hooks=`spam,redirect` | |
&submitVar=`checkout` | |
&redirectTo=`[[*id:scFirstChild]]` | |
]] | |
[[!scLastOrderDetails]] | |
<div id="simplecart"> | |
<form action="[[~[[*id]]]]" method="post" id="form_cartoverview"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: matdave | |
* Date: 8/17/17 | |
* Time: 3:27 PM | |
* Description: Paths designed for core directly in front of the user's home directory. | |
*/ | |
define('MODX_CORE_PATH', getenv('HOME').'/core/'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$nostate = array('Hawaii','Alaska','HI','AK'); | |
$success = !(in_array($value,$nostate)); | |
if(!$success){ | |
$validator->addError($key, "Continental US only."); | |
} | |
return $success; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add a system setting per user or group for 'manager_start_page'. | |
// The redirect contains action variable already, so you just need everything after '?a=' | |
// Set the plugin to run OnManagerLogin | |
$managerurl = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://'; | |
$managerurl .= $_SERVER['HTTP_HOST']; | |
$managerurl .= $modx->getOption('manager_url'); | |
//$modx->log(1,$managerurl. ' '.$_SERVER['HTTP_REFERER']); | |
if ($modx->event->name == 'OnManagerLogin' && $_SERVER['HTTP_REFERER'] == $managerurl){ | |
$managerRedirect = $modx->getOption('manager_start_page'); |