Skip to content

Instantly share code, notes, and snippets.

View gugadev's full-sized avatar
🌐
Web & Mobile

Gustavo García gugadev

🌐
Web & Mobile
View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active April 22, 2024 21:28
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@Klerith
Klerith / vite-testing-config.md
Last active May 4, 2024 15:59
Vite + Jest + React Testing Library - Configuraciones a seguir

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto:
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';
class NotiferChanges<T> {
final StreamController<T> _fetchDoneController = StreamController.broadcast();
changeNavigate(T data) {
_fetchDoneController.add(data); // send an arbitrary event
@gugadev
gugadev / flutter-setup-windows-guide.md
Created June 13, 2021 19:10
Guide to setup flutter and android on Windows 10

Flutter setup Windows guide

No requires Android Studio 🥳



// This function converts the byte to the corresponding amount, be it kilo, mega, GB, etc.
const convertWeightByte = (byte) => {
let sizekiloByte = (byte / 1024);
let sizeMega = (sizekiloByte / 1024);
let sizeGigabyte = (sizeMega / 1024);
let sizeTerabyte = (sizeGigabyte / 1024);
let sizePetabyte = (sizeTerabyte / 1024);
let sizeExabyte = (sizePetabyte / 1024);
if(sizekiloByte > 0 && sizekiloByte <= 1024){
// API key
// https://2captcha.com/enterpage
const API_KEY = "XXXX";
// Find site key of a website
const googleSiteKey = document
.getElementsByClassName("g-recaptcha")[0]
.getAttribute("data-sitekey");
// Helper parsing function
@skolhustick
skolhustick / next.config.js
Created February 15, 2020 07:50
next-js-pwa-setup
const withPWA = require('next-pwa')
module.exports = withPWA({
pwa: {
dest: 'public'
}
})
@gugadev
gugadev / ce-pragma.ts
Last active December 2, 2023 07:44
custom-elements-jsx-pragma
import React, { FunctionComponent, ReactChild } from 'react'
const listeners = Symbol('jsx-web-comp/event-listeners')
const eventPattern = /^onEvent/
const toKebabCase = (str: string): string => str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase()
export default function jsx (type: string | FunctionComponent, props: Record<string, any>, ...children: ReactChild[]) {
const isCustomElement = customElements.get(type as string)
const newProps = { ...props }
@mrk-han
mrk-han / emulator-install-using-avdmanager.md
Last active May 1, 2024 21:12
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"