Skip to content

Instantly share code, notes, and snippets.

View tomasnorre's full-sized avatar
🐘

Tomas Norre Mikkelsen tomasnorre

🐘
View GitHub Profile
@tomasnorre
tomasnorre / Dockerfile
Last active December 12, 2022 15:02
Problems with systemctl in docker
FROM ubuntu:22.04
RUN apt update && apt install -y systemctl
COPY sleep.service /etc/systemd/system/sleep.service
RUN systemctl enable sleep
CMD ["bash"]
@tomasnorre
tomasnorre / ddev_debug_test_log.txt
Created July 5, 2022 12:26
DDEV Problems with NPM on arm64
username@ MBP2-9 site-temp1 % ddev debug test
Running bash [-c /var/folders/sg/rmtfd09n0nv_mm0g3v4ll1mh0000gn/T/test_ddev.sh]
OS Information: Darwin MBP2-11 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 arm64
User information: uid=501( username) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae),701(com.apple.sharepoint.group.1)
DDEV version: ITEM VALUE
DDEV version v1.19.3
architecture arm64
db drud/ddev-dbserver
@tomasnorre
tomasnorre / Readme.md
Created February 12, 2022 13:21 — forked from Tuurlijk/Readme.md
Kitty theme switching based on the time of day

Kitty theme switching based on the time of day

I realy like the PHPStorm extension ChronoMorph which switches between light and dark themes depending on the time of day.

I wanted that for my terminal too. And since the kitty terminal can be remote controlled, we can implement this with two simple scripts.

One script fetches the sunrise and sunset times. It can run once a day.

The other one checks the current time against the sunrise and sunset times and determines if a light or dark mode should be used. It can run every five minutes or however often you like.

@tomasnorre
tomasnorre / Info.md
Created July 10, 2021 22:14
Problem with Jigsaw, Laravel Mix and Locale fonts

I'm having a problem with the Jigsaw and copying the fonts from source/_assets/font folder to the build_product/assets/build/font when running npm run production

I have tried in the option section.

fileLoaderDirs.fonts = '_assets/font';

after the .options() section.

.copy('source/_assets/font/', 'font')
@tomasnorre
tomasnorre / DataService.php
Last active April 22, 2021 21:04
DataServer to Fetch JSON from URL and store in cache.
<?php
declare(strict_types=1);
namespace App\Services;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Log;
@tomasnorre
tomasnorre / debug-output.txt
Created April 5, 2021 18:38
Problem fetching box from Artifactory
vagrant up --debug
INFO global: Vagrant version: 2.2.15
INFO global: Ruby version: 2.6.6
INFO global: RubyGems version: 3.0.3
INFO global: VAGRANT_SERVER_ACCESS_TOKEN_BY_URL="true"
INFO global: VAGRANT_SERVER_URL="https://server.tld/artifactory/api/vagrant/devboxes"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.2.15/gems/vagrant-2.2.15/bin/vagrant"
@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 / Classes_QueueExecutor.php
Last active March 18, 2021 18:12
DI in TYPO3 10.4
<?php
declare(strict_types=1);
namespace AOE\Crawler;
use AOE\Crawler\Controller\CrawlerController;
use AOE\Crawler\Converter\JsonCompatibilityConverter;
use AOE\Crawler\CrawlStrategy\CallbackExecutionStrategy;
@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 {