Skip to content

Instantly share code, notes, and snippets.

View reysmerwvr's full-sized avatar
:electron:
Making a cup of coffee 💻📲

Reysmer Valle reysmerwvr

:electron:
Making a cup of coffee 💻📲
View GitHub Profile
@seidme
seidme / puppies-store.service.ts
Created April 5, 2020 01:55
An example of simple immutable RxJs store in Angular.
import { Injectable } from '@angular/core';
import { BehaviorSubject, Subject } from 'rxjs';
import { PuppiesModule } from './puppies.module';
import { Puppy } from './puppy.model';
@Injectable({ providedIn: PuppiesModule })
export class PuppiesStoreService {
// Make _puppiesSource private so it's not accessible from the outside,
// expose it as puppies$ observable (read-only) instead.
@slikts
slikts / react-memo-children.md
Last active November 7, 2024 04:59
Why using the `children` prop makes `React.memo()` not work

nelabs.dev

Why using the children prop makes React.memo() not work

I've recently ran into a pitfall of [React.memo()][memo] that seems generally overlooked; skimming over the top results in Google just finds it mentioned in passing in a [React issue][regit], but not in the [FAQ] or API [overview][react-api], and not in the articles that set out to explain React.memo() (at least the ones I looked at). The issue is specifically that nesting children defeats memoization, unless the children are just plain text. To give a simplified code example:

const Memoized = React.memo(({ children }) => (<div>{children}</div>));
// Won't ever re-render
<Memoized>bar</Memoized>
// Will re-render every time; the memoization does nothing
@natterstefan
natterstefan / README.md
Created February 18, 2020 14:47
Jest | Mock useState

Jest - mock useState

When using import React, { useState } from 'react' in your components, this is how you can mock useState with jest.

@Jagathishrex
Jagathishrex / main.js
Last active February 24, 2023 17:11
converting string to camel case
// util function to convert the input to string type
function convertToString(input) {
if(input) {
if(typeof input === "string") {
return input;
}
@Klerith
Klerith / plugins.md
Last active August 26, 2024 00:18
Flutter: Curso de Flutter - Instalaciones recomendadas

Programas

git config --global user.name "Tu nombre"
git config --global user.email "Tu correo"
@docwhat
docwhat / Jenkinsfile
Last active December 16, 2023 13:53
Example pipeline usage of the Jenkins Mask Passwords plugin
// Requires https://plugins.jenkins.io/mask-passwords to run
/**
* Runs code with secret environment variables and hides the values.
*
* @param varAndPasswordList - A list of Maps with a 'var' and 'password' key. Example: `[[var: 'TOKEN', password: 'sekret']]`
* @param Closure - The code to run in
* @return {void}
*/
def withSecretEnv(List<Map> varAndPasswordList, Closure closure) {

If .DS_Store was never added to your git repository, simply add it to your .gitignore file.

If you don't have one, create a file called

.gitignore

In your the root directory of your app and simply write

@greyscaled
greyscaled / README.md
Last active September 19, 2022 08:59
Sequelize + Express + Migrations + Seed Starter
@nackjicholson
nackjicholson / create_example_stack.sh
Created February 8, 2018 16:43
awscli shell script to create a cloudformation stack
#!/usr/bin/env bash
STACK_NAME=$1
if [ -z "$1" ]
then
echo "No STACK_NAME argument supplied"
exit 1
fi
@Villanuevand
Villanuevand / README-español.md
Last active November 10, 2024 23:00
Una plantilla para hacer un buen README.md. Inspirado en el gist de @PurpleBooth => https://gist.github.com/PurpleBooth/109311bb0361f32d87a2

Título del Proyecto

Acá va un párrafo que describa lo que es el proyecto

Comenzando 🚀

Estas instrucciones te permitirán obtener una copia del proyecto en funcionamiento en tu máquina local para propósitos de desarrollo y pruebas.

Mira Deployment para conocer como desplegar el proyecto.