Skip to content

Instantly share code, notes, and snippets.

@nepkto
nepkto / index.html
Created August 18, 2023 20:53
Reusable Ajax Request
<!-- Include jQuery library -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
function handleFormSubmit(formSelector, buttonText, successCallback, errorCallback) {
$(document).ready(function() {
$(formSelector).submit(function(event) {
event.preventDefault();
var form = $(this);
var method = form.attr("method");
@nepkto
nepkto / BackedEnum.php
Created August 25, 2022 05:56
Backed Enum
<?php
namespace App\Enums;
enum UserStatusEnum: string
{
case ACTIVE = 'active';
case INACTIVE = 'inactive';
case BLOCKED = 'blocked';
@nepkto
nepkto / .bash_aliases
Last active June 9, 2023 10:57
Alias for my daily work
#laravel
alias pa='php artisan'
alias pas='php artisan serve'
alias pam='php artisan migrate'
alias pam:f='php artisan migrate:fresh'
alias pam:fs='php artisan migrate:fresh --seed'
alias pad:s='php artisan db:seed'
alias pam:rbo='php artisan migrate:rollback --step=1'
alias pam:rb='php artisan migrate:rollback'
alias parl='php artisan route:list'