Skip to content

Instantly share code, notes, and snippets.

View marcorieser's full-sized avatar

Marco Rieser marcorieser

View GitHub Profile
@marcorieser
marcorieser / valet-443-nginx.conf
Last active February 13, 2019 08:24
Laravel Valet project nginx.conf which serves remote upload files if they do not exist localy.
server {
listen 80;
server_name project.test www.project.test *.project.test;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
@marcorieser
marcorieser / valet-80-nginx.conf
Last active February 13, 2019 08:23
Laravel Valet project nginx.conf which serves remote upload files if they do not exist localy.
server {
listen 80;
server_name project.test www.project.test *.project.test;
root /;
charset utf-8;
client_max_body_size 128M;
location /41c270e4-5535-4daa-b23e-c269744c2f45/ {
<?php
$current_year = date("Y");
echo '<ul>';
for ($month = 1; $month <= 12; $month++) {
echo '<li>';
echo date("d.M.Y", strtotime("first monday of $current_year-$month") - 1);
echo '</li>';
}
echo '</ul>';

VIM Cheat Sheet

Commands

  • i Start insert mode at current position
  • I Start insert mode beginning of line
  • a Start insert mode after current position (append)
  • A Start insert mode at end of line (append)
  • d Delete
  • dd Delete line

How to setup PHPStorm for Statamic Antlers

  • In the settings under Editor > File Types add the pattern *.antlers.html to Twig.
  • Adjust the syntax under PHP &gt; Twig as shown in the screenshots.
@marcorieser
marcorieser / Format Antlers, Blade, Vue, Tailwind and PHP with Prettier in PhpStorm.md
Last active November 14, 2024 08:32
Format Antlers, Blade, Vue, Tailwind and PHP with Prettier in PhpStorm

Install dependencies

Run npm install -D prettier prettier-plugin-antlers prettier-plugin-blade prettier-plugin-tailwindcss @prettier/plugin-php in your terminal

Configure prettier

Create a .prettierrc file with the following content

{
  "singleQuote": true,
  "printWidth": 140,
  "tabWidth": 4,
const plugin = require('tailwindcss/plugin');
const columns = 12;
const columnUtilityOptions = {
...{ full: 'full', hd: 'hd', content: 'content' },
...Object.fromEntries([...Array(columns).keys()].map((k) => [`${k + 1}`, `${k + 1}`])),
};
/** @type {import('tailwindcss').Config} */
export default {