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\Livewire; | |
use Livewire\Component; | |
class FieldRepeater extends Component | |
{ | |
public array $rows = []; | |
public string $field; |
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
switchphp () { | |
phpversion="$(php -v | head -n 1 | cut -d " " -f 2 | cut -f1-2 -d".")" | |
brew unlink php@$phpversion && brew link php@$1 && valet use php@$1 --force | |
} |
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 | |
public function getSummaryAttribute() | |
{ | |
$summary = Str::words($this->description, 250, '...'); | |
$summary = html_entity_decode($summary); | |
$summary = html_entity_decode($summary); | |
$summary = html_entity_decode($summary); | |
$summary = html_entity_decode($summary); | |
$summary = htmlspecialchars_decode($summary); |
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
switchphp () { | |
phpversion="$(php -v | head -n 1 | cut -d " " -f 2 | cut -f1-2 -d".")" | |
brew unlink php@$phpversion && brew link php@$1 && valet use php@$1 --force | |
} | |
# then switchphp 8.1, switchphp 7.4, whatever versions installed |
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
$('.repeater').on('click', '.repeater-btn', function(e) { | |
e.preventDefault(); | |
var $this = $(this), | |
$repeater = $this.closest('.repeater').find('[data-repeatable]'), | |
count = $repeater.length, | |
$clone = $repeater.first().clone(); | |
$clone.find('[id]').each(function() { | |
this.id = this.id + '_' + count; |
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
Response::macro('attachment', function ($content, $filename) { | |
$headers = [ | |
'Content-type' => 'text/plain', | |
'Content-Disposition' => 'attachment; filename="'.$filename.'"', | |
]; | |
return Response::make($content, 200, $headers); | |
}); |
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 | |
/** | |
* Complete the order, send notifications and invoice, if applicable | |
* @param Request $request | |
* @return \Illuminate\Http\JsonResponse | |
*/ | |
public function complete(Request $request) | |
{ | |
$user = $request->user(); |
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
/* | |
.orc { | |
transition: top 1s ease 0s; | |
position: relative; | |
top: -3000px; | |
&.shown { | |
top: 0; | |
} | |
} |
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 class="email" data-target="{{ base64_encode($email) }}" href="#">Email</a> |
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
// probably not necessary to normalize, but let's cover our bets | |
var value = val.normalize() | |
var conjugation = this.conjugation.normalize() | |
// collator to do a loose comparison of characters. some characters like ț in Romanian | |
// have three or more versions, so this seems to resolve the issue | |
var collator = new Intl.Collator('ro', { sensitivity: 'base' }) | |
// do the comparison, for feedback while they type | |
if (collator.compare(value.substring(0, value.length), conjugation.substring(0, value.length)) === 0) { |
NewerOlder