Skip to content

Instantly share code, notes, and snippets.

View breadlesscode's full-sized avatar
🤡

Marvin Kuhn breadlesscode

🤡
View GitHub Profile
@malteos
malteos / german-iso-3166.csv
Last active June 19, 2024 13:14
German ISO-3166 Country Codes CSV (deutsche Ländercodes)
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
AF Afghanistan
EG Ägypten
AL Albanien
DZ Algerien
AD Andorra
AO Angola
AI Anguilla
AQ Antarktis
AG Antigua und Barbuda
GQ Äquatorial Guinea
@albe
albe / LocalizationService.php
Last active July 25, 2017 14:06
A LocalizationService Utility class for Neos Flow 4.x that fetches localization data from the CLDR
<?php
namespace Acme\Foo\Service;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\I18n\Cldr\CldrModel;
/**
* A service for localization purposes
*
* @Flow\Scope("singleton")
@breadlesscode
breadlesscode / NEOS_CMS_Backup.sh
Last active November 2, 2017 14:20
Small linux bash script to backup NEOS CMS. For Cronjobs or something else
#!/bin/bash
# Paths and package key
BACKUP_FOLDER="NEOS_Backup_%s" # %s is for date
NEOS_ROOT="/var/www/html/neos"
BACKUP_ROOT="/home/xy/backups"
NEOS_PACKAGE="My.Package"
# Which routines should be started
COMPRESS_BACKUP=true
NEOS_FLOW_EXPORT=true
MYSQL_FULL_BACKUP=true
@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);
}
@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;
@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"],
@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
{
import React from 'react';
type Props = {
data: Array<[number, string]>;
};
export default function LineChart({ data }: Props) {
if (!data.length) {
return null;
}
@Baldinof
Baldinof / .dockerignore
Last active February 13, 2024 22:52
Single PHP FPM container with Caddy
/vendor
/docker
/Dockerfile
@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