Skip to content

Instantly share code, notes, and snippets.

View tomasnorre's full-sized avatar
🐘

Tomas Norre Mikkelsen tomasnorre

🐘
View GitHub Profile
@tomasnorre
tomasnorre / 01_Problem.md
Last active January 31, 2024 08:46
Symfony - controller.service_arguments

I'm like 6 hours old in working with symfony, and I really love the documentation, but this one bit I don't get what I'm doing wrong.

When calling my url: /game/complete?personId=1&exerciseId=2 i get the error:

Could not resolve argument $personId of "App\Controller\GameController::complete()", maybe you forgot to register the controller as a service or missed tagging it with the "controller.service_arguments"?

Problem Solved: I was missing the params in my routing annotation, see updated file.

@tomasnorre
tomasnorre / docker-compose.yaml
Created September 15, 2019 17:02
Docker MySQL in Memory
services:
db:
image: mysql:5.6
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: database
ports:
- 3306:3306
tmpfs:
@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 / namespaceRefactor.php
Created February 18, 2016 12:36 — forked from hpbuniat/namespaceRefactor.php
Super-simple script to convert a existing project to use namespaces
<?php
/**
* Super-simple script to convert a existing project to use namespaces
*
* @author Hans-Peter Buniat <hpbuniat@googlemail.com>
* @copyright 2012 Hans-Peter Buniat <hpbuniat@googlemail.com>
* @license http://opensource.org/licenses/BSD-3-Clause
*/
class namespaceRefactor {
@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 / 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;