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 Support\Livewire; | |
use FilippoToso\Domain\Livewire\Component as BaseComponent; | |
use Illuminate\Support\Facades\View; | |
class Component extends BaseComponent | |
{ | |
public function __construct() |
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 openai import Embedding, ChatCompletion, Completion | |
class Usage: | |
def __init__(self): | |
self.__usage = [] | |
self.__old_embedding_create = Embedding.create | |
Embedding.create = self.__new_embedding_create | |
self.__old_completion_create = Completion.create |
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 | |
use Illuminate\Support\Facades\Http; | |
use Illuminate\Http\Client\Request; | |
use Illuminate\Support\Arr; | |
Http::macro('fakeRequest', function ($method, $url, $payload = [], $response = null) { | |
Http::fake(function (Request $request) use ($method, $url, $payload, $response) { | |
if ($request->url() != $url) { |
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 | |
/** | |
* Copyright 2021 Filippo Toso | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation | |
* files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, | |
* modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software | |
* is furnished to do so, subject to the following conditions: | |
* |
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
@echo off | |
SET /P FOLDER=Please enter the project folder: | |
IF "%FOLDER%"=="" GOTO Error | |
mkdir %FOLDER% | |
cd %FOLDER% | |
call laravel new project --auth | |
move project/public public_html | |
cd project | |
composer require filippo-toso/models-generator filippo-toso/test-email --dev | |
php artisan vendor:publish --tag=config --provider="FilippoToso\ModelsGenerator\ServiceProvider" |
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
<VirtualHost *:80> | |
DocumentRoot "D:/Projects/<project>/public_html" | |
ServerName <project>.local | |
ServerAlias <project>.local | |
<Directory "D:/Projects/<project>/public_html"> | |
AllowOverride All | |
Require all Granted | |
</Directory> | |
</VirtualHost> |
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 | |
use Google\Protobuf\Struct; | |
function struct2array(Struct $struct) { | |
return json_decode($struct->serializeToJsonString(), true); | |
} |
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
/*! debug.css | MIT License | zaydek.github.com/debug.css */ | |
*:not(path):not(g) { | |
color: hsla(210, 100%, 100%, 0.9) !important; | |
background: hsla(210, 100%, 50%, 0.5) !important; | |
outline: solid 0.25rem hsla(210, 100%, 100%, 0.5) !important; | |
box-shadow: none !important; | |
} |
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
/* | |
* A spacing extension to Bulma.io | |
* | |
* This extension implements rules likes: | |
* has-margin-none, has-padding-medium, has-margin-bottom-large, has-margin-auto | |
* | |
* The classes are built as follows (in rem): | |
* | |
* has-margin | |
* -(*|top|right|bottom|left) |
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 | |
use GuzzleHttp\Client; | |
function remote_file_size($url) { | |
$client = new Client(); | |
$response = $client->head($url); | |
$headers = $response->getHeader('Content-Length'); | |
return end($headers); | |
} |
NewerOlder