Skip to content

Instantly share code, notes, and snippets.

View mauricerenck's full-sized avatar

Maurice Renck mauricerenck

View GitHub Profile
@mauricerenck
mauricerenck / rss-exsample.php
Created February 17, 2023 15:02
kirby rss example
<?php
// Bei mir spielen mehrere Dateien eine Rolle
// Die Query für die einzelnen Beitragsquellen habe ich in collections: https://getkirby.com/docs/guide/templates/collections
// blog collection:
return function ($site) {
return page('blog')->index()->listed();
};
// Die Daten trage ich im controller für die sitemap zusammen:
<?php
namespace mauricerenck\Komments;
$kommentUtils = new KommentBaseUtils();
$komments = $kommentUtils->parseKomments($page->kommentsInbox());
$kommentList = ['LIKES' => [], 'REPOSTS' => [], 'REPLIES' => [], 'MENTIONS' => []];
$kommentsInModeration = 0;
function addReply($komment)
inputField.addEventListener('keyup', event => {
// prevent some evil queries
const keyword = inputField.value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&')
// at least two chars needed to trigger the search
if (keyword.length < 2) {
return false
}
<?php
class EpisodeTemplateNamePage extends Page
{
public function podcasterDescription()
{
$field = new Field($this, 'podcasterDescription', $this->podcasterDescription()->value() . $this->podcasterContent()->value());
return $field;
}
}
export const initLazyloading = (selector: string): void => {
let images = document.querySelectorAll(selector)
if ('IntersectionObserver' in window) {
// Create new observer object
let lazyImageObserver = new IntersectionObserver(function(entries, observer) {
// Loop through IntersectionObserverEntry objects
entries.forEach(function(entry) {
// Do these if the target intersects with the root
if (entry.isIntersecting) {
export const initLazyloading = (selector: string): void => { let images = document.querySelectorAll(selector) if ('IntersectionObserver' in window) { // Create new observer object let lazyImageObserver = new IntersectionObserver(function(entries, observer) { // Loop through IntersectionObserverEntry objects entries.forEach(function(entry) { // Do these if the target intersects with the root if (entry.isIntersecting) { let lazyImage: any = entry.target lazyImage.src = lazyImage.dataset.src lazyImage.classList.remove('lazy') lazyImage.classList.add('lazyloaded') lazyImageObserver.unobserve(lazyImage) } }) }) // Loop through and observe each image images.forEach(function(lazyImage) { lazyImageObserver.observe(lazyImage) }) } }
@mauricerenck
mauricerenck / customizing-vs-code.md
Created July 9, 2018 12:07 — forked from rzvdaniel/customizing-vs-code.md
Customizing VS Code for Two Fonts.

Customizing VS Code

I followed the instructions in this blog post Multiple Fonts: Alternative to Operator Mono in VSCode, but did not see any changes made to VS Code. After digging a bit, I discovered that all the CSS class names had changed. They’re now e.g. .mtk13, .mtk16 { … }.

Gotchas

  • Ensure it’s a file URL e.g. { "vscode_custom_css.imports": [ "file:///Users/Brian/Desktop/vscode-style.css" ] }
  • If you move the location of your file and update your user settings with the new location, you will need to disable and enable custom CSS cmd+shift+p.
  • Also, anytime you change the style in your custom CSS file, you need to disable, then re-enable the extension.

For reference

<!-- right after <body> -->
<div class="fader"></div>
<script>
const fader = document.querySelector('.fader')
fader.classList.add('fade');
</script>
<!-- before </body> -->
<!-- Dublin Core -->
<meta name="DC.Title" content="<?php echo $title ?>">
<meta name="DC.Creator" content="<?php echo $site->author() ?>">
<meta name="DC.Rights" content="<?php echo $site->author() ?>">
<meta name="DC.Publisher" content="<?php echo $site->author() ?>">
<meta name="DC.Description" content="<?php echo $page->seoDescription() ?>">
<meta name="DC.Language" content="<?php echo $kirby->language()->code(); ?>">
<meta name="DC.Subject" content="<?php echo $page->seoKeywords() ?>">
<meta name="DC.Type" content="Text">
<meta name="DC.Format" content="text/html">
{
"ab":{
"name":"Abkhaz",
"nativeName":"аҧсуа"
},
"aa":{
"name":"Afar",
"nativeName":"Afaraf"
},
"af":{