Skip to content

Instantly share code, notes, and snippets.

View chrillep's full-sized avatar
🆗
200

Christian Widlund chrillep

🆗
200
View GitHub Profile
@Log1x
Log1x / PostSearch.php
Last active May 22, 2024 21:37
Post Search component example using Acorn v4 and Livewire 3
<?php
namespace App\Livewire;
use Livewire\Attributes\Url;
use Livewire\Component;
use WP_Query;
class PostSearch extends Component
{
@Purpzie
Purpzie / update-lockfile.yml
Last active May 6, 2023 13:22
Action to update pnpm-lock.yaml when Dependabot opens a PR. Be warned that this may cause lots of merge conflicts.
# https://github.com/dependabot/dependabot-core/issues/1736
name: Dependabot
on: pull_request_target
permissions: read-all
jobs:
update-lockfile:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
permissions:
pull-requests: write
#!/usr/bin/env bash
#
# Setup automatic sync from a Github upstream repository to a fork
# - a branch "actions" will be created (or re-used) to hold the Github action to run
# - sync is done each hour
# - branch 'actions' needs to be the default branch of your fork (=> settings)
# - the script is able to both create and update and rewrite the sync script if you modify this script file
#
# Author: Mathiue Carbou
@kachar
kachar / Link-Next13.tsx
Last active May 6, 2024 21:38
Next.js Link + Material UI Link/Button components bundled with forwardRef
@zajca
zajca / dump_mysql_from_env.sh
Created June 13, 2019 07:13
dump mysql database using query string from .env
#!/bin/bash
source .env
if [ -z "$1" ]
then
echo "Missing file to dump"
exit 1
fi
@rhukster
rhukster / sphp.sh
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@QWp6t
QWp6t / BedrockMultisiteValetDriver.php
Last active March 6, 2024 11:28
Fix Laravel Valet when using WordPress subdirectory multisite + Bedrock
<?php
namespace Valet\Drivers\Custom;
class BedrockMultisiteValetDriver extends \Valet\Drivers\Specific\BedrockValetDriver
{
/**
* Determine if the incoming request is for a static file.
*
* @return string|false
@jaakkolehtonen
jaakkolehtonen / oh-my-zsh-custom-installation.sh
Last active March 19, 2021 00:22
Custom @ohmyzsh installation which keeps ~/.zshrc in sync via @dropbox
# Create hidden folder for Oh My Zsh core installation with subfolders for custom plugins and themes
mkdir -p ~/.zsh/custom/{plugins,themes}
# Clone Oh My Zsh from Github into root of hidden ~/.zsh directory
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.zsh/oh-my-zsh
# Clone Powerlevel9k theme to ~/.zsh/custom/themes folder
git clone https://github.com/bhilburn/powerlevel9k.git ~/.zsh/custom/themes/powerlevel9k
# Fetch and install Nerd Font from Github to be used with our new shell config (http://nerdfonts.com/#downloads), long script but does the job :)
@tobi-pb
tobi-pb / migrate.sh
Last active March 3, 2023 23:34
Upgrade MAMP to Mysql 5.6
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.24-osx10.9-x86_64.tar.gz
tar xfvz mysql-5.6*
echo "stopping mamp"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "creating backup"