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 / spotcheck-guide.html
Last active May 8, 2026 23:31
ENG-4593 spot-check: master vs branch for Heading size 100/200 callers (muted default baked in)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>ENG-4593 — Heading size=100 spot-check (muted default + 10→12 bump)</title>
<style>
body { font-family: system-ui, -apple-system, sans-serif; color: #18181b; margin: 0; padding: 32px; background: #fff; max-width: 1600px; }
h1 { font-size: 22px; margin: 0 0 4px; color: #101840; }
.lead { color: #52525b; font-size: 13px; margin: 0 0 24px; }
section { margin: 0 0 40px; }
@acabreragnz
acabreragnz / heading-typography-guide.html
Created May 8, 2026 16:33
Heading typography diff — Evergreen vs Materials refreshed (ENG-4593 / PR #6850)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Heading typography diff — Evergreen vs Materials (refreshed)</title>
<style>
body {
font-family: system-ui, -apple-system, sans-serif;
color: #18181b;
margin: 0;
@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(() => {

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:
#!/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"
@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;
@acabreragnz
acabreragnz / FeatureFlagVuexStore.js
Created June 21, 2023 22:02
Acapedia - Vuex store using the featureFlagProvider
import { createStore } from 'vuex';
import axios from 'axios';
import { featureFlagProvider } from '@/lib/featureFlag';
export default createStore({
state: {
products: [],
},
mutations: {
SET_PRODUCTS(state, products) {
@acabreragnz
acabreragnz / FeatureFlagComponent.vue
Last active August 3, 2024 17:30
Acapedia - Vue component using the featureFlagsMixin
<template>
<div>
<div :class="{'new-feature': isFeatureActive, 'old-feature': !isFeatureActive}">
<!-- Content goes here when MILESTONE_NEW_FEATURE_ENABLED is enabled/disabled -->
<button @click="fetchData">Fetch Data</button>
<div v-if="apiData">{{ apiData }}</div>
</div>
<p>{{ computedMessage }}</p>
</div>
@acabreragnz
acabreragnz / compraPesosMediaBrou.js
Last active June 9, 2023 01:15
Este script te permite convertir una cantidad de dólares a pesos UY, utilizando el valor del dólar actual a la media, obtenido de la pagina de ebrou cotizaciones. https://www.brou.com.uy/cotizaciones
(function () {
const selectorToFloat = (selector) => parseFloat(document.querySelector(selector).textContent.trim().replace(',', '.'));
const floatToLocaleString = (number) => number.toLocaleString('es-UY', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
const dolares = prompt('¿Cuántos dólares desea comprar?');
const compra = selectorToFloat('table > tbody > tr:nth-child(2) > td:nth-child(3)');
const venta = selectorToFloat('table > tbody > tr:nth-child(2) > td:nth-child(5)');
const media = parseFloat(((compra + venta) / 2).toFixed(2));
const pesos = parseFloat((dolares * media).toFixed(2));
document.addEventListener('DOMContentLoaded', function() {
console.log('loading zendesk form builder');
let REPORT_BUG_ARTICLE_ID = '6509556532759';
let REPORT_BUG_TICKET_ID = '6504444995991';
let CONTACT_US_ARTICLE_ID = '6510266315671';
let CONTACT_US_TICKET_ID = '5754824917015';
let FORM_PARENT_ID = 'request-form';