Skip to content

Instantly share code, notes, and snippets.

View neverything's full-sized avatar
🍀
Good vibes for you

Silvan Hagen neverything

🍀
Good vibes for you
View GitHub Profile
<?php
namespace App\Listeners;
use App\Events\RequestMagicLoginLink;
use App\Models\User;
class SendMagicLoginLinkNotification
{
/**
@neverything
neverything / install_plugins.sh
Created September 22, 2023 14:14
Get the 108 most popular WordPress plugins and install them using the WP CLI
#!/bin/bash
# Download the JSON file
curl -sSL https://plugintable.com/plugins.json -o plugins.json
# Extract the plugin slugs using jq
plugin_slugs=$(jq -r '.[].slug' plugins.json)
# Loop through each plugin slug and install it using wp-cli
for slug in $plugin_slugs; do
@neverything
neverything / functions.php
Last active August 25, 2023 14:59
WordPress: Disable blocks for all users on certain post types. See details https://silvanhagen.com/writing/disable-wordpress-blocks-for-all-users/
<?php
add_filter( 'allowed_block_types_all', function( $allowed_blocks, $editor_context ) {
if ( in_array( $editor_context->post?->post_type, ['post', 'page'] ) ) {
$blocks = array_diff(
array_keys( WP_Block_Type_Registry::get_instance()->get_all_registered() ),
[
'core/image',
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!-- Define the Alpine.js component using x-data -->
<div x-data="{ show: false }">
<!-- Bind the type attribute to the value of show using the :type notation -->
<input :type="show ? 'text' : 'password'" name="password" type="password" value="LookMaaGreatPassw0rd!" />
<!-- Toggle the value of show on click using @click and bind the class
attribute to it using the :class notation -->
<svg @click="show = !show" :class="{'block': !show, 'hidden':show }">...</svg>
<?php
namespace App\Http\Middleware;
use App\Models\TeamInvitation;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;
class Authenticate extends Middleware
{
<!-- Start Duda GA4 ecommerce tracking -->
<script>
window.onload = () => {
const currency = 'CHF';
const brandName = 'Nina Burri';
// Bail if we are not on a shop page.
if (typeof Ecwid == 'undefined') {
return;
@neverything
neverything / yoast-faq.css
Last active March 23, 2022 16:53 — forked from freddielore/yoast-faq.css
[Yoast SEO FAQ] Add collapsible headers support to Yoast SEO FAQ schema
/* Accordion
------------------------------------------------------------ */
.schema-faq-question{
cursor: pointer;
}
.schema-faq-question:before{
width: 16px;
height: 20px;
display: inline-block;