This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter the bring shipping rates. | |
*/ | |
add_filter('bring_shipping_rates', function( $rates ) { | |
$shipping_classes = [ | |
'no-mailbox', | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Terminal; | |
class Color | |
{ | |
private string $reset = "\033[0m"; | |
private string $color = "\033[0;36m"; // Cyan | |
public function __construct(private readonly string $text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
'black' => "\033[0;30m", | |
'dark_gray' => "\033[1;30m", | |
'blue' => "\033[0;34m", | |
'light_blue' => "\033[1;34m", | |
'green' => "\033[0;32m", | |
'light_green' => "\033[1;32m", | |
'cyan' => "\033[0;36m", | |
'light_cyan' => "\033[1;36m", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Support; | |
class ComposerModuleAutoLoader | |
{ | |
public static function load($event) | |
{ | |
$package = $event->getComposer()->getPackage(); | |
$base_path = dirname(__DIR__, 2).'/'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function rename_file_with_snake_case(string $filename): string { | |
$basename = basename($filename); | |
$dir = dirname($filename); | |
$newName = strtolower($basename); | |
$newName = preg_replace('/[^\w\.]/', ' ', $newName); | |
$newName = preg_replace('/\s+/', ' ', $newName); | |
$newName = preg_replace('/\s/', '_', $newName); | |
$newName = preg_replace('/_\./', '.', $newName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
COMPOSER=/usr/local/bin/composer | |
STATAMIC=~/.composer/vendor/bin/statamic | |
if [ ! -f "$COMPOSER" ]; then | |
echo "Composer CLI not found" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AWordPressValetDriver extends BasicValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
error_reporting(-1); | |
ini_set( 'display_errors', 1 ); | |
$files = [ | |
"wp/wp-load.php", | |
"public/wp/wp-load.php", | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter the bring shipping rates. | |
* Sets the price of the chosen services based on weight | |
*/ | |
add_filter( 'bring_shipping_rates', function( $rates ) { | |
// Configure services and prices. | |
$services = [ 'SERVICEPAKKE', '5800' ]; | |
$prices = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var quill = new Quill('#editor-container', { | |
modules: { | |
toolbar: [ | |
[{ header: [1, 2, 3, false] }], | |
[{ 'header': 1 }, { 'header': 2 }, 'bold', 'italic', 'underline'], | |
['image', 'code-block'] | |
], | |
clipboard: { | |
matchVisual: false | |
} |
NewerOlder