Skip to content

Instantly share code, notes, and snippets.

View acabreragnz's full-sized avatar

Toni Cabrera acabreragnz

  • Bixlabs
  • Montevideo, Uruguay
View GitHub Profile
@acabreragnz
acabreragnz / FeatureFlagProvider.php
Last active August 3, 2024 17:30
Acapedia - Laravel using the FeatureFlagProvider
<?php
// JsonResource
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
use Business\FeatureFlagProvider\FeatureFlagProvider;
use Business\FeatureFlagProvider\FeatureFlags;
#!/bin/bash
# This script, named generate-pr-report.sh, generates a Markdown report of pull requests for specified GitHub users and date ranges within a GitHub project.
# It must be executed within the root directory of the project you want to analyze.
#
# Usage:
# ./generate-pr-report.sh "user1,user2" "2024-02,2024-03"
# This command generates a report for pull requests created by user1 and user2 between February 2024 and March 2024.
#
# ./generate-pr-report.sh "user1"

Visit Counter for the Article Abstract Page

Objective

Implement a visit counter in a Vue2 application using Vuex and Vuetify on the page src/pages/Article/ArticleAbstractPage.vue. This setup includes error handling, a conditional reset mechanism, and a switch for controlling increment functionality, integrated with a managed loading state.

Requirements

  1. Vuex State Management:
@acabreragnz
acabreragnz / mock-pinia-with-vitest.ts
Last active October 11, 2024 11:06
Mock a pinia store using vitest
import { beforeEach, describe, it, expect } from 'vitest';
import { fn } from '@vitest/spy';
import { useSomeStore } from '@/useSomeStore';
import { createTestingPinia } from '@pinia/testing';
import { setActivePinia } from 'pinia';
describe('useCreditStore - Test with Mocked Getter', () => {
let mockCreditStore: Record<string, any>;
beforeEach(() => {