Skip to content

Instantly share code, notes, and snippets.

View claudiodekker's full-sized avatar

Claudio Dekker claudiodekker

View GitHub Profile
@claudiodekker
claudiodekker / .php-cs-fixer.dist.php
Created June 22, 2022 23:32
Personal pre-Pint .php-cs-fixer.dist.php file
<?php
$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap')
->notPath('node_modules')
->notPath('storage')
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->notName('*.blade.php');
@claudiodekker
claudiodekker / megapint.sh
Created June 22, 2022 22:48
Opinionated Laravel Pint alias. Prefers a repo-specific version of pint over a globally-installed one, and defaults to use the Laravel preset.
megapint() {
PINT=$([ -f "vendor/bin/pint" ] && echo "vendor/bin/pint" || echo "pint")
"$PINT" --preset laravel $@
}
@claudiodekker
claudiodekker / SSR - React.md
Last active April 20, 2023 08:32
Outdated SSR guide. Soon to be replaced with our generally-available release.

Inertia.js - SSR - React

This guide will explain how to add server-side rendering (SSR) to an existing React Inertia application.

Note, if you're using the Ziggy library, you're going to run into issues with SSR. While it is technically possible to use Ziggy in SSR, it requires a bunch of extra configuration, which this guide won't cover.

Upgrade dependencies

Upgrade to the latest version of Inertia (version 0.9.0 or newer):

@claudiodekker
claudiodekker / update-chromium.mjs
Last active April 14, 2024 18:30
Update (or install) Ungoogled Chromium (ARM64 / Apple "M1") with Widevine.
#!/usr/bin/env zx
const fs = require('fs')
async function getCurrentVersion() {
let version;
try {
version = await $`/Applications/Chromium.app/Contents/MacOS/Chromium --version`
} catch (e) {
@claudiodekker
claudiodekker / .eslintrc.js
Created May 20, 2021 11:08
ESLint Code Style for Vue.js
module.exports = {
extends: ['eslint:recommended', 'plugin:vue/recommended'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
env: {
amd: true,
browser: true,
es6: true,
@claudiodekker
claudiodekker / github-sponsors-graphql.graphql
Last active May 14, 2023 22:15
Retrieve a list of sponsors from the Github Graph API
query ($owner: String!, $after: String) {
user (login: $owner) {
sponsorshipsAsMaintainer(first: 100, after: $after, includePrivate: true) {
totalCount
nodes {
sponsorEntity {
... on User {
login
}
}
@claudiodekker
claudiodekker / External Tools.xml
Last active November 6, 2020 11:20
PHPStorm PHP-CS-Fixer External Tool - ~/Library/Application Support/JetBrains/PhpStorm2020.1/tools/External Tools.xml
<toolSet name="External Tools">
<tool name="PHP CS Fixer" showInMainMenu="false" showInEditor="false" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="false" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="/Users/claudiodekker/.composer/vendor/friendsofphp/php-cs-fixer/php-cs-fixer" />
<option name="PARAMETERS" value="--verbose fix $FilePath$" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$" />
</exec>
</tool>
</toolSet>
@claudiodekker
claudiodekker / v2gif.sh
Last active December 3, 2020 17:39
Simple command to turn videos into GIFs
#!/bin/bash
v2gif() {
# Based on https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/
ffmpeg=""
filter=""
palettegen="palettegen"
paletteuse="paletteuse"
while getopts "w:f:is:t:" opt; do

Keybase proof

I hereby claim:

  • I am claudiodekker on github.
  • I am claudiodekker (https://keybase.io/claudiodekker) on keybase.
  • I have a public key ASAB8_E1VCkbFUMNPLgdKz2-uEDn6bC5MUJ5XE_1tVM2Qgo

To claim this, I am signing this object: