Skip to content

Instantly share code, notes, and snippets.

@kensaaa
kensaaa / fix_authenticity_of_github_problem.md
Created November 23, 2023 23:23 — forked from vikpe/fix_authenticity_of_github_problem.md
FIX: The authenticity of host github.com can't be established.

Error

The authenticity of host 'github.com (140.82.113.4)' can't be established.

Fix

ssh-keyscan github.com >> ~/.ssh/known_hosts
@kensaaa
kensaaa / multiple-ssh-keys-git.adoc
Created November 23, 2023 23:17 — forked from alejandro-martin/multiple-ssh-keys-git.adoc
Configure multiple SSH Keys for Git

Use Multiple SSH Keys for Git host websites (Github, Gitlab)

This is guide about how to configure multiple SSH keys for some Git host websites such as Github, Gitlab, among others.

Creating SSH keys

  1. Create SSH directory:

local packer = require('packer')
-- configuraciones vim
require('settings')
Cmd [[ packadd packer.nvim ]]
packer.startup(function(use)
use 'wbthomason/packer.nvim'
-- visual
~/dotfiles/..
  ★ code-editor
  gestor-ventana
  git
  ✗ shell
  terminal
  tmux
 generate-links.sh
 install-programs.sh
 README.md
@kensaaa
kensaaa / downloadFile.ts
Created July 4, 2022 12:58
Typescript: helper download file
export const downloadFile = (nameFile: string, path: string): void => {
const downIntance = document.createElement('a');
downIntance.href = path;
downIntance.target = '_blank';
downIntance.download = nameFile;
document.body.appendChild(downIntance);
downIntance.click();
document.body.removeChild(downIntance);
@kensaaa
kensaaa / templateSlice.js
Created June 24, 2022 15:18 — forked from Klerith/templateSlice.js
Cascaron para crear Redux Slices rápidamente
import { createSlice } from '@reduxjs/toolkit';
export const templateSlice = createSlice({
name: 'name',
initialState: {
counter: 10
},
reducers: {
increment: (state, /* action */ ) => {
//! https://react-redux.js.org/tutorials/quick-start
@kensaaa
kensaaa / useForm.ts
Created June 15, 2022 21:13
React Typescript: custom hook useForm
import { useState } from 'react';
interface useFormReturn {
formState: any;
onInputChange(e: any): void;
onResetForm(): void;
}
export const useForm = (initalForm = {}): useFormReturn => {
const [formState, setFormState] = useState(initalForm);
@kensaaa
kensaaa / CounterWithCustomHook.tsx
Created June 15, 2022 19:46
React Typescript: custom hook useCounter
import { useCounter } from "../hooks/useCounter";
const CounterWithCustomHook = () => {
const { counter, increment, decrement, reset } = useCounter(10);
return (
<>
<h1>Counter With Hook: {counter}</h1>
<hr />
@kensaaa
kensaaa / vite-testing-config.md
Last active June 28, 2022 23:09 — forked from Klerith/vite-testing-config.md
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

# esto en caso de trabajar con typescript
yarn add --dev @babel/preset-typescript
@kensaaa
kensaaa / gitconfig
Created June 10, 2022 18:01
File Config: git , ubicacion: ~/.gitconfig
[user]
name = kensaaa
email = [email protected]
[core]
editor = nvim
[alias]
s = status -sb
lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
[github]
user = kensaaa