Skip to content

Instantly share code, notes, and snippets.

View breadlesscode's full-sized avatar
🤡

Marvin Kuhn breadlesscode

🤡
View GitHub Profile
@phanan
phanan / MyList.vue
Last active February 2, 2023 17:10
Virtual scroller with Vue Composition API
<template>
<VirtualScroller v-slot="{ item }" :item-height="35" :items="myMassiveArray">
<div :item="item" :key="item.id">{{ item.details.i.guess? }}</div>
</VirtualScroller>
</template>
<?php
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use Spatie\YamlFrontMatter\YamlFrontMatter;
Route::get('{slug?}', function ($slug = 'index') {
$path = resource_path('pages/' . $slug . '.md');
if (!file_exists($path)) {
@jordienr
jordienr / Gradient.js
Created September 12, 2021 00:23
Stripe Mesh Gradient WebGL
/*
* Stripe WebGl Gradient Animation
* All Credits to Stripe.com
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and
* commented out for now.
* https://kevinhufnagl.com
*/
@breadlesscode
breadlesscode / EmailObfuscationImplementation.php
Last active January 16, 2020 16:49
NEOS CMS E-Mail obfuscation fusion implentation
<?php
namespace My\Package\Fusion;
class EmailObfuscationImplementation extends \Neos\Fusion\FusionObjects\DataStructureImplementation
{
const MAILTO_REGEX = '/<a(.*?)href="mailto:(.+?)"(.*?)>(.*?)<\/a>/i';
/**
* Get the glue to insert between items
@Baldinof
Baldinof / .dockerignore
Last active February 13, 2024 22:52
Single PHP FPM container with Caddy
/vendor
/docker
/Dockerfile
import React from 'react';
type Props = {
data: Array<[number, string]>;
};
export default function LineChart({ data }: Props) {
if (!data.length) {
return null;
}
@mficzel
mficzel / ExampleController.php
Last active June 7, 2019 06:26
Backend Module with Fusion-AFX
<?php
namespace Test\BeModule\Controller;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Mvc\View\ViewInterface;
use Neos\Fusion\View\FusionView;
use Neos\Neos\Controller\Module\AbstractModuleController;
class ExampleController extends AbstractModuleController
{
@stephanbogner
stephanbogner / index.js
Created March 7, 2018 22:17
Create tree structure from paths array
var paths = [
["Account"],
["Account", "Payment Methods"],
["Account", "Payment Methods", "Credit Card"],
["Account", "Payment Methods", "Paypal"],
["Account", "Emails"],
["Account", "Emails", "Main Email"],
["Account", "Emails", "Backup Email"],
["Account", "Devices"],
["Account", "Devices", "Google Pixel"],
@dfeyer
dfeyer / TemplateImplementation.php
Created March 30, 2017 09:22
Custom Fusion TemplateImplementation
<?php
namespace Flowpack\FusionBP\FusionObjects;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Mvc\ActionRequest;
use Neos\Fusion\FusionObjects\TemplateImplementation as OriginalTemplateImplementation;
use Neos\Fusion\FusionObjects\Helpers as Helpers;
use Neos\FluidAdaptor\Core\Parser\Interceptor\ResourceInterceptor;
use TYPO3Fluid\Fluid\Core\Parser\InterceptorInterface;
@ca0v
ca0v / debounce.ts
Last active June 19, 2024 11:20
Typescript Debounce
// ts 3.6x
function debounce<T extends Function>(cb: T, wait = 20) {
let h = 0;
let callable = (...args: any) => {
clearTimeout(h);
h = setTimeout(() => cb(...args), wait);
};
return <T>(<any>callable);
}