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
#!/bin/bash | |
# @parameters file workspace | |
# Set locale to UTF-8 | |
export LC_ALL=en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
# Get the current file and workspace paths | |
current_file="$1" | |
workspace="$2" |
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
#!/bin/bash | |
# @parameters workspace | |
# Set the path to the Daily folder | |
daily_folder="$1/Daily" | |
# Check if the Daily folder exists | |
if [ ! -d "$daily_folder" ]; then | |
echo "Error: Daily folder not found in workspace" | |
exit 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
#!/usr/bin/env node | |
// @parameters file | |
/* | |
# Save Hook | |
This save hook is a Node.js script that automatically updates or adds a `date_updated` field in the YAML frontmatter of a file when it's saved. It's designed to work with text files that may or may not already have YAML frontmatter. | |
## Features |
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
<div x-data="{ open: false }"> | |
<button @click="open = true">Open Dropdown</button> | |
<ul | |
x-show="open" | |
@click.away="open = false" | |
> | |
Dropdown Body | |
</ul> | |
</div> |
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
<!-- Blade, e.g. welcome.blade.php --> | |
<form action="{{ route('form.submit') }}" method="POST" class="space-y-4"> | |
@csrf | |
<div> | |
@error('fullname') | |
<div class="text-red-500">{{ $message }}</div> | |
@enderror | |
<label for="fullname">Fullname</label> |
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
// routes/web.php | |
validate([ | |
'fullname' => 'required|alpha|min:3', | |
]); | |
return 'Submission allowed'; | |
})->name('form.submit'); | |
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
public function handle($request, Closure $next) | |
{ | |
if (! auth()->user()->is_admin) | |
{ | |
abort(403); | |
} | |
return $next($request); | |
} |
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
private function create_user(is_admin = 0) | |
{ | |
$this->user = factory(User::class)->create([ | |
'is_admin' => $is_admin, | |
]); | |
} |
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 = $this->post('login', [ | |
'email' => 'EMAIL', | |
'password' => 'PW' | |
]); | |
// assert where you expect to be redirected to, e.g. home | |
$response->assertRedirect('/home'); |
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
public rules() { | |
return [ | |
'name' => 'required', | |
'price' => 'required', | |
]; | |
} |
NewerOlder