Skip to content

Instantly share code, notes, and snippets.

View whoami15's full-sized avatar
🎯
Focusing

Daryl Ferrer Legion whoami15

🎯
Focusing
View GitHub Profile
@inxilpro
inxilpro / --usage.php
Created February 13, 2024 17:22
Simple wrapper for OpenSpout
<?php
// Reading
CsvReader::read($path)->each(function(array $row) {
// Do something with $row
});
// Writing
return CsvWriter::for($data)->writeToHttpFile();
@hotmeteor
hotmeteor / ApaTitle.php
Created January 3, 2024 22:16
Laravel APA title case macro
<?php
namespace App\Providers\Macros;
class ApaTitle
{
public function __invoke()
{
return function ($string) {
// Define minor words to be lowercase
@cosmeoes
cosmeoes / ebtb-toc.md
Created May 16, 2023 01:18
Eloquent Beyond The Basics Table of Contents
  • The Laravel Query Builder
    • How does it work?
      • Bindings
    • Raw queries
    • Subqueries
      • Aggregates
  • Eloquent
    • What's an ORM?
    • What's the relationship between Eloquent and the query builder?
  • Where is the where?
@grantmcconnaughey
grantmcconnaughey / repeal-section-174.md
Created March 17, 2023 20:04
Letter to Senator to request the repeal of Section 174

Dear Senator [Last name],

As a concerned constituent, I urge you to support the repeal of Section 174 of the Internal Revenue Code, “Amortization of research and experimental expenditures.” This provision significantly increases taxes for small software businesses like mine, threatening our growth, innovation, and competitiveness.

The repeal of Section 174 is crucial for the following reasons:

  • Innovation: Increased taxes hinder small businesses’ ability to invest in research and development, stifling innovation.
  • Job loss: Small software businesses drive job creation. The tax increase may force downsizing, leading to job losses.
  • Fairness: The tax increase disproportionately affects small businesses, putting them at a disadvantage compared to larger corporations who can afford to pay the increased taxes.
<?php
function memoize($target) {
static $memo = new WeakMap;
return new class ($target, $memo) {
function __construct(
protected $target,
protected &$memo,
) {}
<template>
<inertia-head>
<title v-if="title">{{ title }} - My App</title>
<title v-else>My App</title>
<slot />
</inertia-head>
</template>
<script>
export default {
@diego3g
diego3g / metatags.html
Created September 28, 2020 21:57
Meta tags do curso de Next.js
<meta httpEquiv="x-ua-compatible" content="IE=edge,chrome=1" />
<meta name="MobileOptimized" content="320" />
<meta name="HandheldFriendly" content="True" />
<meta name="theme-color" content="#121214" />
<meta name="msapplication-TileColor" content="#121214" />
<meta name="referrer" content="no-referrer-when-downgrade" />
<meta name="google" content="notranslate" />
<meta property="og:title" content={pageTitle} />
<meta property="og:description" content={description} />
@plmrlnsnts
plmrlnsnts / vue-datatable.md
Last active May 15, 2023 18:12
Datatable component for Vue and Tailwind CSS

Keep in mind that this implementation requires an api for fetching data, and assumes the following response schema:

{
    "perPageOptions": [
        15, 50, 100
    ],
    "actions": [
        "Delete all", "Publish All", "Unpublish All"
    ],
@minthemiddle
minthemiddle / Markdium-Hack.php
Created July 9, 2020 20:05
Markdium-Lessons Learnt: Confident Laravel
class PHPUnit extends TestCase
{
public function testAssertions()
{
$this->assertTrue(true);
}
}