Skip to content

Instantly share code, notes, and snippets.

View jenswittmann's full-sized avatar

Jens Wittmann – Gestaltung & Entwicklung jenswittmann

View GitHub Profile
@jenswittmann
jenswittmann / alphabeticalLetters.php
Last active February 15, 2021 13:17
Get alphabetical Letters from MODX PDO Collection
<?php
/**
* alphabeticalLetters
*
* DESCRIPTION
*
* This Snippet return alphabetical Letters from Collection
*
* PROPERTIES:
*
@jenswittmann
jenswittmann / functions.php
Last active February 3, 2021 14:22
Timber embed SVG Plugin for WordPress
/**
* embed SVG
* Example: <span>{{ "logo"|svg }}</span>
*
* @param \Twig\Environment $twig The Twig environment.
* @return \Twig\Environment
*/
function twig_svg_embed($twig)
{
$twig->addFilter(
@jenswittmann
jenswittmann / .gitify
Last active December 22, 2020 10:02
Gitify config file
data_directory: _gitify/
backup_directory: _backup/
packages:
modx.com:
service_url: http://rest.modx.com/extras/
packages:
- pthumb
- pdotools
- collections
modmore.com:
@jenswittmann
jenswittmann / aria-helper.css
Last active November 10, 2020 14:55
HTML A11Y ARIA helpers
// hide tab focus if not needed
* {
&:focus,
&:-moz-focusring {
outline: 0 !important;
}
}
.focus-outline {
@jenswittmann
jenswittmann / instagramLatestPosts.php
Created October 20, 2020 08:58
instagramLatestPosts Snippet for MODX Revolution
<?php
/**
* instagramLatestPosts
*
* DESCRIPTION
*
* This Snippet return latest posts from Instagram as iframe embed.
*
* PROPERTIES:
*
@jenswittmann
jenswittmann / loopjson.php
Last active August 21, 2020 14:54
loopJSON (MODX Snippet)
<?php
/**
* loopJSON
*
* DESCRIPTION
*
* This Snippet loop a JSON Array.
*
* PROPERTIES:
*
@jenswittmann
jenswittmann / fluid-base-rem
Last active April 14, 2020 08:15
Set font-size for <html> proportional for scalling everything with rem.
<!--
$basePxFor1rem = 16;
$baseDesignWidthFromAdobeXD = 1920;
$baseFontSize = 100 * $basePxFor1rem / $baseDesignWidthFromAdobeXD;
Result: .833333333333333vw;
-->
<style>
html {
font-size: .833333333333333vw;
@jenswittmann
jenswittmann / collections.custom.js
Created August 1, 2018 07:32
MODX Collections update TV from grid
collections.combo.TVNAME = function(config) {
config = config || {};
Ext.applyIf(config,{
store: new Ext.data.SimpleStore({
fields: ['v']
,data: [
['val1'],
['val2'],
['val3']
]
@jenswittmann
jenswittmann / gist:8ebf882e956c89976fd4dfe2a32a7f37
Created April 4, 2017 10:56
SSH Kommandos zur Sicherung von MODX Evolution auf all-Inkl.com
find -type d -exec /bin/chmod 755 {} \;
find -type f -exec /bin/chmod 644 {} \;
find -type f -name "*.php*" -exec /bin/chmod 600 {} \;
@jenswittmann
jenswittmann / secure-headers.php
Created December 4, 2016 13:18
MODX secure http headers
header("X-Content-Type-Options: nosniff");
header("X-XSS-Protection: 1; mode=block");
header("X-Frame-Options: SAMEORIGIN");
header("Connection: keep-alive");
header("ETag: ");
header("Content-Security-Policy: base-uri https://nixlos.de; default-src https:; script-src https: 'unsafe-inline' 'unsafe-eval'; style-src https: 'unsafe-inline'; child-src https://nixlos.de");