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 | |
declare(strict_types=1); | |
// composer require openswoole/core:22.1.5 | |
require_once "vendor/autoload.php"; | |
use OpenSwoole\Core\Coroutine\Pool\ClientPool; | |
use OpenSwoole\Core\Coroutine\Client\PDOClientFactory; | |
use OpenSwoole\Core\Coroutine\Client\PDOConfig; | |
use OpenSwoole\Runtime; |
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 MyPlugin\Foundation; | |
use Illuminate\Database\Connection; | |
use Illuminate\Database\Query\Grammars\MySqlGrammar as QueryGrammar; | |
use Illuminate\Database\Query\Processors\MySqlProcessor; | |
use Illuminate\Database\Schema\Grammars\MySqlGrammar as SchemaGrammar; | |
use Illuminate\Database\Schema\MySqlBuilder; | |
use Exception; |
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
FROM php:8.3-cli-alpine | |
ENV SWOOLE_VERSION=5.1.1 | |
ENV COMPOSER_ALLOW_SUPERUSER=1 | |
ENV COMPOSER_HOME=/composer | |
RUN apk add --no-cache \ | |
postgresql-dev \ | |
libzip-dev \ | |
libpng-dev \ |
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 MyPlugin\Foundation; | |
use Illuminate\Database\Connection; | |
use Illuminate\Database\Query\Grammars\MySqlGrammar as QueryGrammar; | |
use Illuminate\Database\Query\Processors\MySqlProcessor; | |
use Illuminate\Database\Schema\Grammars\MySqlGrammar as SchemaGrammar; | |
use Illuminate\Database\Schema\MySqlBuilder; | |
use Exception; |
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
# Install duti | |
echo "Installing duti..." | |
brew install duti | |
# Set Sublime Text 4 as default for various code and config formats | |
echo "Setting Sublime Text 4 as default for code and config formats..." | |
# Sublime Text 4 bundle identifier | |
SUBLIME_ID="com.sublimetext.4" |
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
<scheme name="GitHub Inspired" version="142" parent_scheme="Default"> | |
<metaInfo> | |
<property name="ide">PhpStorm</property> | |
<property name="ideVersion">2024.2.0.0</property> | |
<property name="originalScheme">GitHub Inspired</property> | |
</metaInfo> | |
<colors> | |
<option name="CARET_ROW_COLOR" value="f5f5f5" /> | |
<option name="GUTTER_BACKGROUND" value="ffffff" /> | |
<option name="LINE_NUMBERS_COLOR" value="b3b3b3" /> |
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
# Configuration | |
SITE_DIR="/home/forge/myapp.com" | |
GIT_REPO="[email protected]:myapp/myapp.git" | |
RELEASES_DIR="$SITE_DIR/releases" | |
PERSISTENT_DIR="$SITE_DIR/persistent" | |
CURRENT_DIR="$SITE_DIR/current" | |
RELEASE_NAME=$(date +"%Y%m%d-%H%M%S") | |
NEW_RELEASE_DIR="$RELEASES_DIR/$RELEASE_NAME" | |
# Ensure required directories exist |
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
# Configuration | |
SITE_DIR="/home/forge/staging.streampot.io" | |
GIT_REPO="[email protected]:StreamPot/SaaS.git" | |
RELEASES_DIR="$SITE_DIR/releases" | |
PERSISTENT_DIR="$SITE_DIR/persistent" | |
CURRENT_DIR="$SITE_DIR/current" | |
RELEASE_NAME=$(date +"%Y%m%d-%H%M%S") | |
NEW_RELEASE_DIR="$RELEASES_DIR/$RELEASE_NAME" | |
# Ensure required directories exist |
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
# FallbackStiToBase | |
# | |
# This concern provides a customizable fallback mechanism for Single Table Inheritance (STI) in Rails. | |
# It allows specifying which types should raise an error when not found, while others fallback to the base class. | |
# | |
# Usage: | |
# class Action < ApplicationRecord | |
# include FallbackStiToBase | |
# validates :type, presence: true, inclusion: { in: %w[Value1 Value2 Value3] } | |
# fallback_excluded_types 'RemovedValue1', 'RemovedValue2' |
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
module Types | |
class AppendSuffixType < ActiveRecord::Type::String | |
def initialize(suffix) | |
@suffix = suffix.to_s | |
end | |
def cast_value(value) | |
value.to_s + @suffix unless value.nil? | |
end |
NewerOlder