Skip to content

Instantly share code, notes, and snippets.

View tomasnorre's full-sized avatar
🐘

Tomas Norre Mikkelsen tomasnorre

🐘
View GitHub Profile
@tomasnorre
tomasnorre / webpack.config.js
Created January 6, 2021 19:17 — forked from bjo3rnf/webpack.config.js
Tailwind CSS in a Symfony Project with Webpack Encore and Purge CSS
const Encore = require('@symfony/webpack-encore');
const tailwindcss = require('tailwindcss');
const autoprefixer = require('autoprefixer');
const purgecss = require('@fullhuman/postcss-purgecss')({
content: [
'./templates/**/*.twig',
'./assets/js/**/*.vue',
'./assets/js/**/*.js',
@tomasnorre
tomasnorre / .Question.txt
Last active July 13, 2020 17:37
How to best write Unit tests for this ?
Hi,
How would you write unit-test for this function? addFlushedPagesToCrawlerQueue()
With a functional test I would check the queue size, if the expected number of pages was added to the queue,
but not sure how to deal with this in unit-tests.
Could you please give me some pointer.
I have added DataHandlerHookTests.php with an idea, but as I always expect null, I would not know which return route it has taken. Therefore... Bad Tests..
@tomasnorre
tomasnorre / wrap.ts
Created June 10, 2020 12:26
scroll-to attribute
lib.parseFunc_RTE {
tags.a {
# Add scroll-to directive to anchor links on the current page
# * href uses the linkhandler t3:// URL scheme, with page and anchor id separated by "#", e.g. t3://page?uid=283287#6613007
# * when splitting the href by "#", the second list item contains the target anchor id
# * the if.equals block extracts the target page uid from the link and compares it to the page id being processed
# * By using append.required = 1, the scroll-to directive will only be added if the stdWrap returns an anchor id
typolink.ATagParams.append = TEXT
typolink.ATagParams.append {
stdWrap {
I got the same yesterday with Intellij and it took me quite long to fix it. This worked worked for me (You need to adapt the paths to Webstorm):
```
rm -rf ~/Library/Application\ Support/JetBrains/IntelliJIdea2020.1/plugins/*
rm -rf ~/Library/Application\ Support/JetBrains/IntelliJIdea2020.1/disabled_plugins.txt
```
I found it here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360007952039-Android-support-in-IDEA-2020-1-Ultimate-is-gone-
@tomasnorre
tomasnorre / crawler-devbox.yml
Created April 10, 2020 15:12
Site Configuration TYPO3 9LTS
base: 'https://crawler-typo3v9.ddev.site/'
baseVariants: { }
errorHandling: { }
languages:
-
title: Default
enabled: true
base: /
typo3Language: default
locale: en_US.UTF-8
{
"name": "tnm/typo3v10-test",
"type": "project",
"description": "",
"require": {
"typo3/minimal": "^10.2",
"typo3/cms-introduction": "~4.0",
"typo3/cms-tstemplate": "^10.2",
"typo3/cms-info": "^10.2",
"typo3/cms-belog": "^10.2",
{
"servers": [
{
"id": "Shanghai_VPN",
"url": "127.0.0.1",
"desc": "hi there"
},
{
"id": "Beijing_VPN",
"url": "127.0.0.2",
[
{
"id": "1",
"repository": {
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
<?php
namespace Aoe\AoeDbSequenzer\Xclass;
use Aoe\AoeDbSequenzer\Sequenzer;
use Aoe\AoeDbSequenzer\Service\Typo3Service;
use TYPO3\CMS\Core\Database\Query\QueryBuilder as CoreQueryBuilder;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* @package Aoe\AoeDbSequenzer\Xclass
@tomasnorre
tomasnorre / README.md
Last active September 26, 2019 15:10

What does it do?

This littel script fetches all packages, listed on packagist with type typo3-cms-extension, and iterates over them and collect download data for every single packages.

It will echo it as csv, so it can easily be parsed into a .csv file for better sorting etc.

How to generate csv file

$ php fetchExtensionDownloadDataFromPackagist.php &gt; downloadData.csv