Skip to content

Instantly share code, notes, and snippets.

View codeInBit's full-sized avatar

Olanrewaju Abidogun codeInBit

View GitHub Profile
@codeInBit
codeInBit / AGENTS.md
Created June 12, 2026 20:55 — forked from scpedicini/AGENTS.md
Personal AGENTS.md for LLMs (JS/TS Example)

Code Standards

  • Prefer types over interfaces for simple data structures
  • Use interfaces and class OOP for more complex components
  • Comments should be used to explain "why" decisions were made with possible source references
  • Avoid magic numbers or strings - use constants instead, and if they feel like configuration values, move them to a configuration file
  • Avoid default parameter values especially in method signatures since this can lead to unexpected behavior. For example if a method signature has three arguments, then a caller is required to pass in exactly three arguments.
  • Avoid null coalescing (??) or fallbacks. All values should always be explicitly set.
  • Avoid default parameters / default fallbacks / etc. since this silently obfuscates errors. Errors should always propagate so we can discover potential issues.
@codeInBit
codeInBit / Response.php
Created July 30, 2021 08:41 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@codeInBit
codeInBit / csv_to_array.php
Created November 22, 2018 12:50 — forked from jaywilliams/csv_to_array.php
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
@codeInBit
codeInBit / EnsureQueueListenerIsRunning.php
Created November 17, 2017 11:12 — forked from ivanvermeyen/EnsureQueueListenerIsRunning.php
Ensure that the Laravel 5.1 queue listener is running with "php artisan queue:checkup" and restart it if necessary. You can run this automatically with a cron job: http://laravel.com/docs/scheduling
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class EnsureQueueListenerIsRunning extends Command
{
/**
* The name and signature of the console command.
/*
* Original script by: Shafiul Azam
* Version 4.0
* Modified by: Luigi Balzano
* Description:
* Inserts Countries and/or States as Dropdown List
* How to Use:
In Head section: