Skip to content

Instantly share code, notes, and snippets.

@javiergomezve
javiergomezve / vite-testing-config.md
Created September 5, 2022 02:45 — 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
  1. Opcional: Si usamos Fetch API en el proyecto:
@javiergomezve
javiergomezve / index.js
Created November 4, 2021 00:49 — forked from codigoconjuan/index.js
Guía para instalar React Navigation 5
// Instalar react-navigation/native
npm install @react-navigation/native
// Instalar las dependencias
npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view
// Instalar navegación en Stack
npm i @react-navigation/stack
@javiergomezve
javiergomezve / create-zip.js
Created July 30, 2021 20:59 — forked from branneman/create-zip.js
Node.js script to create a zip file from a list of files and directories
const stat = require('fs').statSync;
const AdmZip = require('adm-zip');
/**
* Example usage
*/
newArchive(`test-${+new Date}.zip`, [
'index.js',
'package.json',
'node_modules'
@javiergomezve
javiergomezve / pipenv_cheat_sheet.md
Created May 10, 2021 13:08 — forked from bradtraversy/pipenv_cheat_sheet.md
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
{{-- You do not need to add this component if you are using the permanent option in the head component --}}
<script>
if (!window.sessionTimerPermanent && window.Livewire) {
window.livewire.hook('afterDomUpdate', startSessionTimer)
}
// if you are on livewire > 1.3.1 and want to avoid the default error alert
// https://github.com/livewire/livewire/pull/1146
window.livewire.onError(statusCode => {
if (statusCode === 419) {
@javiergomezve
javiergomezve / BlogForm.jsx
Created May 13, 2020 14:55
Laravel and react
import React, {useState} from 'react';
import ReactDOM from 'react-dom';
import { Editor } from '@tinymce/tinymce-react';
const BlogForm = (props) => {
const blogTypes = JSON.parse(props.blogTypes);
const categories = JSON.parse(props.categories);
@javiergomezve
javiergomezve / Annotation.js
Created March 5, 2020 14:58 — forked from SerafimArts/Annotation.js
JavaScript Annotations example
import Reader from './Reader';
import Target from './Target';
/**
* This is default annotation property for automatic type casting:
* <code>
* @Annotation({ some: any })
* // => will be casts "as is" {some: any}
*
* @Annotation("any")
protected function apiAs($user, $method, $uri, array $data = [], array $headers = [])
{
$headers = array_merge([
'Authorization' => 'Bearer '.\JWTAuth::fromUser($user),
], $headers);
return $this->api($method, $uri, $data, $headers);
}
@javiergomezve
javiergomezve / react-file-upload.js
Created November 20, 2019 02:24 — forked from AshikNesin/react-file-upload.js
Simple React File Upload
import React from 'react'
import axios, { post } from 'axios';
class SimpleReactFileUpload extends React.Component {
constructor(props) {
super(props);
this.state ={
file:null
}
@javiergomezve
javiergomezve / django_crash_course.MD
Created September 28, 2019 22:36 — forked from bradtraversy/django_crash_course.MD
Commands for Django 2.x Crash Course

Django Crash Course Commands

# Install pipenv
pip install pipenv
# Create Venv
pipenv shell