Use composer to install Gitify on your environment
composer global require modmore/gitify:^2
devices: ( | |
{ | |
name: "Wireless Mouse MX Master 2S"; | |
smartshift: | |
{ | |
# Do not enable free scroll | |
on: true; | |
threshold: 15; # 7 is ideal for work | |
}; | |
hiresscroll: |
<?php | |
//** On WebPage Pre-Render **// | |
$corePath = $modx->getOption('preview.core_path', null, $modx->getOption('core_path') . 'components/preview/'); | |
require_once $corePath . '/model/preview/preview.class.php'; | |
$preview = new Preview($modx); | |
if(!$modx->user->hasSessionContext('mgr')) return; // currently forcing manager context | |
if(!$modx->getOption('preview.frontendEnabled')) return; // currently forcing manager context | |
$qsItem = $modx->getOption('preview.previewKey'); | |
$compareItem = $modx->getOption('preview.compareKey'); |
<?php | |
$base_path = dirname(__FILE__) . '/content/'; | |
if($_GET['q']) { | |
$q = explode('?', $_GET['q']); | |
$file_check = $base_path.preg_replace('"\.html$"', '.php', $q[0]); | |
if (substr($file_check, -1) == "/") { | |
$file_check .= "index.php"; | |
} |
const showrandom = document.querySelectorAll("[showrandom]"); | |
showrandom.forEach(el=>{ | |
const count = el.getAttribute('showrandom') ? el.getAttribute('showrandom') : 1; | |
const children = el.children; | |
while(children.length > count){ | |
const random = Math.floor(Math.random() * children.length); | |
children[random].remove(); | |
} | |
}); |
<?php | |
if(empty($input)) return; | |
$url = rtrim($modx->getOption('site_url'), '/').'/'.ltrim($input,'/'); | |
echo "<meta name=\"image\" property=\"og:image\" content=\"$url\" />"; | |
$path = rtrim($modx->getOption('base_path'), '/').'/'.ltrim($input,'/'); | |
$size = @getimagesize($path); | |
if ($size) { | |
$width = $size[0]; |
<?php | |
switch ($modx->event->name) { | |
case "OnFileManagerUpload": | |
if(!empty($files)){ | |
foreach($files as $file){ | |
$path = $directory . $source->sanitizePath($file['name']); | |
$object = $source->getObjectContents($path); | |
if(empty($object) || empty($object['mime']) || empty($object['content'])) continue; | |
switch($object['mime']) { | |
case 'image/svg': |
<?php | |
/** elFinder Plugin Options **/ | |
switch ($modx->event->name) { | |
case 'FredOnElfinderRoots': | |
$params = $modx->getOption('params', $scriptProperties); | |
if (empty($params)) return false; | |
// Enable Sanitizer | |
$params->bind['upload.pre mkdir.pre mkfile.pre rename.pre archive.pre ls.pre'][] = 'Plugin.Sanitizer.cmdPreprocess'; | |
$params->bind['paste.copyfrom upload.presave'][] = 'Plugin.Sanitizer.onUpLoadPreSave'; | |
$params->plugin['Sanitizer'] = [ |
location ~* \.(?:ico|css|js|jpe?g|png|gif|svg|pdf|mov|mp4|mp3|woff|woff2|otf|ttf)$ { | |
expires 7d; | |
add_header Pragma public; | |
add_header Cache-Control "public"; | |
gzip_vary on; | |
rewrite ^/(it|de|es|fr|cz)(/.*)$ $2 last; | |
} |
<?php | |
$regex = <<<'END' | |
/ | |
( | |
(?: [\x00-\x7F] # single-byte sequences 0xxxxxxx | |
| [\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx | |
| [\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2 | |
| [\xF0-\xF7][\x80-\xBF]{3} # quadruple-byte sequence 11110xxx 10xxxxxx * 3 | |
){1,100} # ...one or more times |