Skip to content

Instantly share code, notes, and snippets.

View renaco's full-sized avatar

Renán Romero renaco

View GitHub Profile
@renaco
renaco / MyContextProvider.tsx
Last active September 22, 2023 20:53
MyContextProvider by AI
import React, { createContext, useContext, useMemo } from "react";
interface MyContextProps {
param1: string;
param2: number;
children: React.ReactNode; // Add children property to the interface
}
const MyContext = createContext<MyContextProps | undefined>(undefined);
@renaco
renaco / gist:e73fe33aa214c9e464d7fcb4b5b7d0a2
Created April 20, 2023 23:34
Is possible integrate stenciljs into .Net view

Yes, it is possible to integrate Stencil.js into a .NET view. Stencil.js is a web component compiler that allows you to create reusable web components using modern web standards. .NET is a popular framework for building web applications, and integrating Stencil.js components into .NET views can provide a seamless and modular way to create UI components.

Here are the general steps to integrate Stencil.js into a .NET view:

Install Stencil.js: First, you need to install Stencil.js in your project. You can do this using npm (Node Package Manager) or yarn, which are popular package managers for JavaScript. You can run the following command in your project's root directory to install Stencil.js: bash Copy code npm install @stencil/core Create Stencil.js components: Next, you can create your custom Stencil.js components. You can define your components using TypeScript, which is a statically-typed superset of JavaScript. You can define the UI structure, behavior, and style of your components using Stencil.js decora

@renaco
renaco / Avoid vue model by chatgtp
Created February 27, 2023 14:07
How to avoid vue model
How to avoid refresh data with v-model vue?
When you use v-model in Vue, it automatically updates the data whenever the input value changes. This behavior can be useful in many cases, but in some situations, you may want to avoid refreshing the data. Here are some approaches to achieve that:
Use a computed property:
You can create a computed property that calculates the value based on the input value, instead of directly binding the input to the data property. This way, the data property won't be updated every time the input changes.
Example:
@renaco
renaco / settings.json
Last active November 3, 2022 15:35
.vscode/settings.json
// Settings vscode
{
"editor.codeActionsOnSave": [
"source.addMissingImports",
"source.fixAll.eslint"
],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
@renaco
renaco / register_webinar.spec.js
Created September 27, 2019 04:25
Regiter to cypress webinars
describe('test_name', function () {
it('register_webinar', function () {
let nameToRegister = 'Renan'
let lastNameToRegister = 'Romero'
let emailToRegister = 'renanromero@gmail.com'
let questionOrg = 'romeroruiz.com'
let urlWebinar = 'https://zoom.us/webinar/register/7015681491757/WN_MUIJzTKCQQujUeUg6-IUXg?utm_campaign=Cypress%20CI%20Webcast&utm_source=hs_email&utm_medium=email&utm_content=76878149&_hsenc=p2ANqtz-_Ryz1IocUsHhlkp-U2iH0SDWDJPJ5Tj-bmIx4jH384fh449Ofxdzgvckf_NWPC6ramnTmiU2g1pCNcj9GMecfmF_bK1g&_hsmi=76878149'
cy.viewport(1366, 625)
@renaco
renaco / send to apple .inc
Last active July 16, 2019 15:34
Slee Wake Failure exerience a roblem
Date/Time: 2019-06-18 18:43:44 -0500
OS Version: Mac OS X 10.12.6 (Build 16G2016)
Architecture: x86_64h
Report Version: 25
Data Source: Stackshots
Event: Sleep Wake Failure
Duration: 0.10s
Steps: 9
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
# Add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Set up the repository
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# Update source lists
sudo apt-get update
# Install Docker
sudo apt-get install docker-ce
@renaco
renaco / test.md
Created August 29, 2018 23:08 — forked from VictorJSV/test.md
@renaco
renaco / sunat-ruc.js
Created January 11, 2018 23:09
Improvement consult sunat ruc
var getFrame = document.getElementsByName('leftFrame')[0];
var getImage = getFrame.contentWindow.document.querySelectorAll("[name='imagen']")[0];
var getButton = getFrame.contentWindow.document.querySelectorAll(".form-button")[0];
var getInput = getFrame.contentWindow.document.querySelectorAll("input[name='codigo']")[0];
getImage.parentElement.align = 'right';
getInput.parentElement.width = '';
getInput.style.fontSize = 15 + 'px';
getInput.style.width = 95 + '%';
var fullName = 'Sergio Brito';
console.log(fullName);
function setName(name: string): void {
this.fullName = name;
}
setName('Chicharito');