Skip to content

Instantly share code, notes, and snippets.

@yesiddg
yesiddg / Android-variables-configuration.txt
Created August 26, 2025 21:55
Steps to configure android SDK variables and Emulator.
1. On Mac/Linux (edit ~/.zshrc or ~/.bashrc):
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$PATH
2. List available emulators (AVDs)
emulator -list-avds
3. Open an emulator
@yesiddg
yesiddg / fork-an-open-source-repository-workflow.md
Last active August 22, 2023 16:23
Fork a repository flow

Implementing a Fork of an Open-Source Library: Workflow

Implementing a fork of an open-source library involves several steps to ensure a smooth development process. Here's a general flow to consider when implementing a fork:

  1. Clone the Original Repository:

    • Start by cloning the original open-source repository to your local machine. This will serve as the basis for your fork.
  2. Create Your Fork:

    • On the platform where the original repository is hosted (e.g., GitHub), fork the repository to your account. This will create a copy of the repository under your account.
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
import { initializeApp } from 'firebase/app';
export default defineNuxtPlugin(() => {
const firebaseConfig = {
apiKey: 'XXXXXXXXXXXXXXXXXXXXXXXX',
authDomain: 'XXXXXX-XXXX.firebaseapp.com',
projectId: 'XXXXXXX',
storageBucket: 'XXXXXXXXX.appspot.com',
@yesiddg
yesiddg / firebase-auth.vue
Created July 14, 2023 02:59
firebase-auth.vue
<template>
<div id="auth-container">
</div>
</template>
<script setup>
import { onMounted } from 'vue'
import { getAuth, ProviderId } from 'firebase/auth'
import * as firebaseui from 'firebaseui'
import 'firebaseui/dist/firebaseui.css'
@yesiddg
yesiddg / ObjectUtils.js
Created June 3, 2022 21:38
ObjectUtils for JS
export default class ObjectUtils {
static equals(obj1, obj2, field) {
if (field)
return (this.resolveFieldData(obj1, field) === this.resolveFieldData(obj2, field));
else
return this.deepEquals(obj1, obj2);
}
static deepEquals(a, b) {
if (a === b) return true;
@yesiddg
yesiddg / automatic-focus-all-markers-gmap.js
Created May 12, 2022 14:56
Automatic focus all markers in a google map.
const latLngBounds = new this.google.maps.LatLngBounds();
this.markers.forEach(marker => {
// Position is an object with this shape { lat, lng }
latLngBounds.extend(marker.position);
});
// Update map bounds with bounding entity
map.fitBounds(latLngBounds);
version: "3.9"
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
@yesiddg
yesiddg / woo-events.js
Created May 10, 2021 01:41 — forked from bagerathan/woo-events.js
Woocommerce Javascript events #woocommerce
//Woocommerce Checkout JS events
$( document.body ).trigger( 'init_checkout' );
$( document.body ).trigger( 'payment_method_selected' );
$( document.body ).trigger( 'update_checkout' );
$( document.body ).trigger( 'updated_checkout' );
$( document.body ).trigger( 'checkout_error' );
//Woocommerce cart page JS events
$( document.body ).trigger( 'wc_cart_emptied' );
$( document.body ).trigger( 'update_checkout' );
@yesiddg
yesiddg / honeybadger.liquid
Created April 7, 2021 17:22
Honeybadger shopify integration
{%- comment -%}
Honeybadger Integration
------------------------------------------------------------------------------------------
Honeybadger es una herramienta que nos permite trackear los errores que ocurren
en la ejecución de la página web.
DOCUMENTACION:
https://docs.honeybadger.io/lib/javascript/integration/browser.html
https://docs.honeybadger.io/lib/javascript/guides/reporting-errors.html
/**
* Format a number value to USD.
*
* @param {*} value
*/
export function toUSD(value) {
value = parseFloat(value);
if (isNaN(value)) {
value = 0;