Skip to content

Instantly share code, notes, and snippets.

View emmadesilva's full-sized avatar
🎩
HydePHP.com

Emma De Silva emmadesilva

🎩
HydePHP.com
View GitHub Profile
@emmadesilva
emmadesilva / tailwind.html
Created March 3, 2022 15:06
Tailwind CDN with Darkmode Class
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
darkMode: 'class',
}
</script>
@emmadesilva
emmadesilva / tags.blade.php
Created March 4, 2022 12:11
Minimal & Responsive Blade+TailwindCSS Tags Component
@if($post->tagsArray)
<div>
<ul class="article-tags">
@foreach ($post->tagsArray as $tag)
@if($loop->index >= 2)
@continue
@endif
<li class="article-tag bg-slate-500 bg-opacity-25 text-sm py-0.5 px-1.5 m-1 rounded-lg {{ $loop->index < 1 ? 'inline' : 'hidden sm:inline' }}">
{{ $tag }}
</li>
@emmadesilva
emmadesilva / Log.php
Created March 12, 2022 17:43
Tie-in gist with API blog post #3
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Log extends Model
{
/**
* Indicates if the model should be timestamped.
@emmadesilva
emmadesilva / semantic.html
Created March 13, 2022 21:53
Semantic HTML exists. Semantic HTML is great. Use Semantic HTML.
<article>
<header>
<h1>Semantic HTML exists. Semantic HTML is great. Use Semantic HTML.</h1>
by <a href="https://twitter.com/StressedDev" rel="author">@StressedDev</a>
at <time datetime="2022-03-13 21:44:44 UTC">Sunday, 13 March 2022</time>
</header>
<main>
<h2>Content heading</h2>
<p>
With some text paragraphs. #codingtip of the day.
@emmadesilva
emmadesilva / Torchlight.scss
Created March 16, 2022 11:12
Torchlight.dev Default Styles as SCSS
pre {
border-radius: 0.25rem;
margin-top: 1rem;
margin-bottom: 1rem;
overflow-x: auto;
code.torchlight {
display: block;
min-width: -webkit-max-content;
min-width: -moz-max-content;
title
About Us

This is an example of a Markdown based static HTML page built with Hyde

If you have a keen eye, you will see that a link to this page has been added to the navigation menu!

@emmadesilva
emmadesilva / errors.blade.php
Created May 12, 2022 10:46
Bootstrap 5 Form Errors for Blade
@if($errors->any())
<div class="alert alert-danger">
<ul class="mb-0">
@foreach($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
cd hyde
git config user.name github-actions
git config user.email github-actions@github.com
git remote add upstream https://${{ secrets.PAT }}@github.com/hydephp/hyde.git
if ! git diff-index --quiet HEAD --; then
git add .
git commit -m "$COMMIT_MESSAGE https://github.com/hydephp/develop/commit/${{ github.sha }}"
git push upstream develop
else
echo "No changes to this package. Exiting gracefully."
<?php
declare(strict_types=1);
namespace Hyde\Support\Contracts;
/**
* @internal Interface for the Illuminate Filesystem class, but with static methods and strong types inferred from the PHPDocs.
*
* @see \Illuminate\Filesystem\Filesystem
@emmadesilva
emmadesilva / Types.php
Last active December 5, 2023 08:37
Idea for a strongly typed systen
<?php
declare(strict_types=1);
final class Types
{
protected static bool $strict = false;
public static function string(mixed $input): string
{