Skip to content

Instantly share code, notes, and snippets.

View johanvanhelden's full-sized avatar

Johan van Helden johanvanhelden

View GitHub Profile
@johanvanhelden
johanvanhelden / RepoComponent.stories.ts
Last active July 7, 2023 10:22
Storybook 7.0.26 issue with custom args
import type { Meta, StoryObj } from '@storybook/vue3';
import Component from './ReproComponent.vue';
const meta: Meta<typeof Component> = {
component: Component,
render: (args, { argTypes }) => ({
components: { Component },
props: Object.keys(argTypes),
template: `
@johanvanhelden
johanvanhelden / AppServiceProvider.php
Last active March 17, 2022 09:01
Fix for barryvdh/laravel-dompdf v1.0 with public folders other than "public"
<?php
declare(strict_types=1);
namespace App\Providers;
// snip
use Dompdf\Dompdf;
// snip
@johanvanhelden
johanvanhelden / extensions.md
Last active March 3, 2022 10:36
Personal VSCode settings
  • PHP Intelephense -> with premium license for better autocompletion and refactoring
  • Project Manager -> to allow for easy switching between projects
  • Better PHPUnit -> to easily execute tests
  • Eslint -> JS validation/linting
  • EditorConfig -> editorconfigfile support
  • Laravel Extra Intellisense -> Extra Laravel functionality
  • Laravel goto view
  • npm Intellisense
  • Partial diff
  • Path intellisense
@johanvanhelden
johanvanhelden / paqt.dev.conf
Created February 3, 2022 12:45
paqt.dev.conf
server {
listen *:80;
server_name ~^(?<subdomain>.+\.)?(?<domain>.+).paqt.dev$;
set $baseRoot "/var/www/projects/${domain}";
set $publicFolder "";
if (-d "${baseRoot}/public_html") {
set $publicFolder "public_html";
}
@johanvanhelden
johanvanhelden / lang.php
Created January 19, 2021 12:01
lang route
<?php
declare(strict_types=1);
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Route;
// Localization
@johanvanhelden
johanvanhelden / docker-cleanup-resources.md
Created January 9, 2019 16:39 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@johanvanhelden
johanvanhelden / big-uploads.localtest.me.conf
Created September 16, 2018 12:37
Big file uploads example vhost
server {
listen *:80;
server_name playground.big-uploads.localtest.me;
root /var/www/projects/playground/public_html/;
include conf.d/dockerhero/core/partials/logging.conf;
client_max_body_size 64m;
@johanvanhelden
johanvanhelden / reconfigure-laravel-instructions.md
Last active March 18, 2023 13:16
Laravel - public > public_html

These are the reconfiguration instructions to make Laravel use a public_html folder instead of a public folder.

  • Rename the public folder to public_html

  • Create a new file in de ./app directory called Bootstrapper.php with the followign contents:

<?php

namespace App;
@johanvanhelden
johanvanhelden / docker-hosts.sh
Created August 15, 2017 13:08
Create dockerhero hosts section
#!/bin/bash
#get all containers
containers=`docker ps -a --format '{{.Names}}'`
hostFileBegin="## DOCKERHERO HOSTS BLOCK START ##\n"
hostFileEnd="## DOCKERHERO HOSTS BLOCK END ##\n"
hostFile=$hostFileBegin
#find the ip belonging to container
@johanvanhelden
johanvanhelden / ide-helpers
Last active October 5, 2017 12:54
Laravel ide helpers generator bash alias for Dockerhero
## Simply add this function to your .bash_aliases and run ideHelpers in the root of your project.
ideHelpers() {
project=`basename $PWD`
docker exec -i --user=dockerhero dockerhero_workspace bash -c "cd /var/www/projects/$project && ./artisan ide-helper:generate"
docker exec -i --user=dockerhero dockerhero_workspace bash -c "cd /var/www/projects/$project && ./artisan ide-helper:meta"
#due to atom-ide-ui and ide-php, this file is now unwanted - so let's delete it instead.
#docker exec -i --user=dockerhero dockerhero_workspace bash -c "cd /var/www/projects/$project && ./artisan ide-helper:models -n"