Skip to content

Instantly share code, notes, and snippets.

View renepardon's full-sized avatar

Christoph, René Pardon renepardon

View GitHub Profile
@renepardon
renepardon / jsconfig.json
Created December 30, 2022 21:35
Vite Alias Support for IntelliJ/PHPStorm/Webstorm
{
"_comment": "This file is used to trick IntelliJ/Webstorm/PHPStorm to use the correct alias as defined in vite.config.js",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["resources/js/*"]
}
}
}
@renepardon
renepardon / Dockerfile
Created July 8, 2022 07:29
Simple react application Docker image
FROM node:16-alpine3.16 as build
WORKDIR /app
COPY package.json /app/package.json
COPY yarn.lock /app/yarn.lock
RUN yarn install --silent
COPY . /app
@renepardon
renepardon / User.php
Created February 15, 2022 09:01
GraphQL Federation - resolve User type through API Gateway
<?php
namespace App\GraphQL\Entities;
use App\Models\Tenant;
use GraphQL\Client;
use GraphQL\Query;
class User
{

Warning: Due to Homebrew/php tap being deprecated at the end of March 2018, and the moving of all PHP formulas to Homebrew/core, the installation of PHP versions we currently use is going to change. Currently PHP 7.2 is available in the core, but we are waiting on previous versions to be made available and will update this guide as soon as we can. Thanks!

Part 1: macOS 10.13 High Sierra Web Development Environment

Note: This is an updated version of our prior OS X development series. The newly released macOS 10.13 High Sierra and the accompanying updates to Brew require significant changes compared to prior releases, necessitating a thorough revamp in the process. Since 10.12 we now use Homebrew's Apache, rather than the built-in version, but this new appraoch is more flexible and should continue to work on prior OS X versions.

Developing web applications on macOS is a real joy. There are plenty of options for setting up your develop

@renepardon
renepardon / phpunit.xml
Last active October 25, 2021 07:01
nwidard/laravel-modules PHPUnit config which fails to calculate coverage for Modules/ directory
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="bootstrap/test.php"
colors="true"
cacheResult="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
@renepardon
renepardon / stack.yml
Created August 19, 2021 05:59
keycloak swarm deploy
version: "3.8"
services:
keycloak:
image: jboss/keycloak
env_file:
- ./.env
environment:
JDBC_PARAMS: "useSSL=false"
DB_VENDOR: "h2"
<?php
namespace Modules\Whatever\Http\Controllers\Api;
use Illuminate\Routing\Controller;
class UploadController extends Controller
{
public function handleUpload()
{
@renepardon
renepardon / zsh-setup.md
Created May 20, 2020 12:53
Configure zsh for MacOS with iTerm2 (but works also with Terminal!), antigen and oh-my-zsh with material design colors and agnoster theme

ZSH Setup

Install dependencies

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" && \
cd Downloads && \
curl -O https://raw.githubusercontent.com/MartinSeeler/iterm2-material-design/master/material-design-colors.itermcolors
@renepardon
renepardon / git-pushing-multiple.rst
Created December 10, 2019 07:36 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

# just a default scalar class for now
scalar _Any @scalar(class: "App\\GraphQL\\Scalars\\Any")
type _Service {
sdl: String
}
extend type Query {
_entities(representations: [_Any!]!): [_Entity]! @field(resolver: "App\\GraphQL\\Queries\\Federation")
_service: _Service! @field(resolver: "App\\GraphQL\\Queries\\Federation")