brew install cloudflare/cloudflare/cloudflared
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
# Stop and disable NGINX | |
sudo systemctl stop nginx | |
sudo systemctl disable nginx | |
# Install Go | |
wget https://go.dev/dl/go1.20.2.linux-amd64.tar.gz | |
sudo rm -rf /usr/local/go | |
sudo tar -C /usr/local -xzf go1.20.2.linux-amd64.tar.gz | |
rm -f go1.20.2.linux-amd64.tar.gz |
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 Database\Factories; | |
use App\Models\City; | |
use App\Models\Country; | |
use App\Models\Region; | |
use Illuminate\Database\Eloquent\Factories\Factory; | |
class CityFactory extends Factory |
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 | |
# app/Http/Controllers/CaddyController.php | |
namespace App\Http\Controllers; | |
use App\Store; | |
use Illuminate\Http\Request; | |
class CaddyController extends Controller | |
{ |
After you copy a component from the Tailwind UI library and begin to adapt it from Vue JS to Alpine JS .. you may wonder what to do about the transitions. As I'm exploring this myself, I am documenting it for others in the same boat.
- Alpine calls the beginning and ending states "start" & "end"
- Vue calls the beginning and ending states "from" and "to"
- Alpine has inline "directives" ie x-transition:enter="classes"
- Vue has a wrapper component that applies classes to the child
- Alpine applies the classes you pass it for each state, :enter-start="class"
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\Services; | |
use Aws\Credentials\CredentialProvider; | |
use Aws\Credentials\Credentials; | |
use Aws\ElasticsearchService\ElasticsearchPhpHandler; | |
use Elasticsearch\ClientBuilder; | |
use Laravel\Scout\Engines\ElasticsearchEngine; |
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
def paginate(scope, default_per_page = 20) | |
collection = scope.page(params[:page]).per((params[:per_page] || default_per_page).to_i) | |
current, total, per_page = collection.current_page, collection.num_pages, collection.limit_value | |
return [{ | |
pagination: { | |
current: current, | |
previous: (current > 1 ? (current - 1) : nil), | |
next: (current == total ? nil : (current + 1)), |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Remove rubberband scrolling from web apps on mobile safari (iOS)</title> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="apple-touch-fullscreen" content="yes"> | |
<meta id="extViewportMeta" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script> | |
<style> | |
html, body {margin: 0; padding: 0; overflow: hidden} |