Skip to content

Instantly share code, notes, and snippets.

View hgrimelid's full-sized avatar

Håvard Grimelid hgrimelid

  • Mediebruket
  • Norway
  • 20:28 (UTC +02:00)
View GitHub Profile
@marcorieser
marcorieser / Format Antlers, Blade, Vue, Tailwind and PHP with Prettier in PhpStorm.md
Last active June 15, 2024 18:11
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,
  "trailingComma": "all",
  "printWidth": 140,
@jenningsb2
jenningsb2 / custom.css
Last active October 30, 2023 07:13
My current CSS theme for Logseq
@import url("https://fonts.rcvd.io/iA Writer/stylesheet.css");
:root {
--highlight-color: #ffdb8a;
}
a.tag[data-ref="important"] {
border: 1px solid currentColor;
background-color: var(--ct-block-reference-background);
padding: 0 4px;
@carlalexander
carlalexander / expect-header-fix.php
Last active August 13, 2021 00:40
WordPress "Expect" header fix
<?php
/**
* By default, cURL sends the "Expect" header all the time which severely impacts
* performance. Instead, we'll send it if the body is larger than 1 mb like
* Guzzle does.
*/
function add_expect_header(array $arguments)
{
$arguments['headers']['expect'] = '';
@simonhamp
simonhamp / MigrateUsers.php
Last active February 1, 2024 10:16
Migrate Statamic v3 file-based users to a database
<?php
/**
* Statamic v3 User Migrator
* @author Simon Hamp <simon.hamp@me.com>
* @copyright Copyright (c) 2021, Simon Hamp
* @license MIT
*/
namespace App\Console\Commands;
use Exception;
@robbplo
robbplo / opendb.fish
Last active September 19, 2020 14:12 — forked from AlexVanderbist/opendb.sh
fish function of AlexVanderbist/opendb.sh
function opendb
[ ! -f .env ] && { echo "No .env file found."; exit 1; }
set DB_CONNECTION (grep DB_CONNECTION .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
set DB_HOST (grep DB_HOST .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
set DB_PORT (grep DB_PORT .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
set DB_DATABASE (grep DB_DATABASE .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
set DB_USERNAME (grep DB_USERNAME .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
set DB_PASSWORD (grep DB_PASSWORD .env | grep -v -e '^\s*#' | cut -d '=' -f 2-)
@hgrimelid
hgrimelid / .tmux.conf
Last active January 18, 2021 18:14
My tmux configuration and key bindings
# Requires Fish
# Rebind prefix key to C-a
unbind C-b
set -g prefix C-a
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
@hofmannsven
hofmannsven / .env.github
Last active May 30, 2024 19:16
Notes on working with GitHub Actions and Laravel Nova.
APP_ENV=ci
APP_KEY=
APP_DEBUG=true
APP_URL=https://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=33306
@rubenvanassche
rubenvanassche / tests.yml
Last active March 3, 2024 11:12
A simple Laravel testing workflow for GitHub Actions
name: Tests (PHP)
on: [push]
jobs:
tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
@Braunson
Braunson / pivot-tables.md
Last active May 15, 2024 08:12
Laravel 8.x - Diving into Pivot Tables

Laravel 6 - Diving Into Pivot Tables

Pivot tables can be confusing and a little hard to wrap your head around at first. In this quick article we are going to dive into what a pivot table is, how to create one and finally how to use the pivot table. Let's dive in!

What is a pivot table?

A pivot table is used to connect relationships between two tables. Laravel provides a Many To Many relationship where you can use a pivot table.

@jonsugar
jonsugar / show-tailwind-breakpoint.html
Last active June 13, 2024 19:39
Show current tailwind breakpoint.
<div class="flex items-center m-2 fixed bottom-0 right-0 border border-gray-400 rounded p-2 bg-gray-300 text-pink-600 text-sm">
<svg class="h-6 w-auto inline" viewBox="0 0 80 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill="url(#paint0_linear)" fill-rule="evenodd" clip-rule="evenodd" d="M32 16C24.8 16 20.3 19.6 18.5 26.8C21.2 23.2 24.35 21.85 27.95 22.75C30.004 23.2635 31.4721 24.7536 33.0971 26.4031C35.7443 29.0901 38.8081 32.2 45.5 32.2C52.7 32.2 57.2 28.6 59 21.4C56.3 25 53.15 26.35 49.55 25.45C47.496 24.9365 46.0279 23.4464 44.4029 21.7969C41.7557 19.1099 38.6919 16 32 16ZM18.5 32.2C11.3 32.2 6.8 35.8 5 43C7.7 39.4 10.85 38.05 14.45 38.95C16.504 39.4635 17.9721 40.9536 19.5971 42.6031C22.2443 45.2901 25.3081 48.4 32 48.4C39.2 48.4 43.7 44.8 45.5 37.6C42.8 41.2 39.65 42.55 36.05 41.65C33.996 41.1365 32.5279 39.6464 30.9029 37.9969C28.2557 35.3099 25.1919 32.2 18.5 32.2Z"></path>
<defs>
<linearGradient id="paint0_linear" x1="3.5" y1="16" x2="59" y2="48" gradien