Skip to content

Instantly share code, notes, and snippets.

View onel0p3z's full-sized avatar
🏠
Working from home

Juan Lopez onel0p3z

🏠
Working from home
View GitHub Profile

Configure prettier, eslint, husky (pre commit hook), lint-staged in react + typescript project

Steps to configure prettier, eslint, husky (pre commit hook), lint-staged in react + typescript project created using create-react-app. This is opinionated configuration with airbnb's style guide as the base style guide.

Step 1 :: Setup prettier

1.1) Install prettier as dev dependency.

npm install --save-dev --save-exact prettier
@sjlu
sjlu / Migrating from Amazon Linux to Amazon Linux 2 with Elastic Beanstalk and Node.js.md
Last active September 12, 2023 08:56
Migrating from Amazon Linux to Amazon Linux 2 with Elastic Beanstalk and Node.js

This file is a log of everything I've encountered when trying to migrate a Node.js, Elastic Beanstalk application from the Amazon Linux platform to the Amazon Liunx 2 platform. Here's why you should migrate:

  1. LTS support up to 2023 source
  2. The Amazon Linux AMI's end-of-life is December, 2020 source
  3. Amazon Linux 2 has some big package upgrades (GCC, Glibc, etc.)
  4. Elastic Beanstalk also has some upgrades on top of Amazon Linux 2 (e.g. faster deploys)

Challenges

Disabling NPM install

@buritica
buritica / sancocho.md
Created August 6, 2018 23:19
receta de sancocho

Receta del sancocho para 4-6 personas.

Ingredientes

  • 1 1/2 libra de costilla de res magra o asado de tira. Tiene mejor sabor la costilla.
  • 6 perniles de pollo
  • 4 gajos de cebolla larga
  • 1 cabeza de ajo
  • 1 cebolla blanca
  • 1 cubo de caldo rico
  • 2 plátanos verdes
@bmeck
bmeck / chatting.js
Last active April 1, 2017 00:48
a chat server using generators to manage connection state.
'use strict';
/*::
type Client = Object;
type Channel = string;
*/
const channels/*: Map<Channel, Set<Client>> */ = new Map;
const clients/*: Map<Client, Set<Channel>> */ = new WeakMap;
const join = (name, client) => {
if (!channels.has(name)) {
go-audit repo:
https://github.com/slackhq/go-audit
go-audit example configurations:
https://github.com/slackhq/go-audit/tree/master/examples
Blog post: Ryan Huber - Distributed Security Alerting
https://medium.com/several-people-are-coding
Video: NSA TAO Chief on Disrupting Nation State Hackers
@AsaAyers
AsaAyers / you_dont_need_coffeescript.md
Created September 20, 2016 15:52
You Don't Need CoffeeScript

You Don't Need CoffeeScript

It's time to replace CoffeeScript with Babel and CoffeeLint with eslint.

CoffeeScript was useful a few years ago. It provided many features that JavaScript was lacking. It gave us the fat arrow (lexical this functions), default parameters, destructuring assignments, splats (spread operator), a class keyword, block strings, and more. Everything in the list above is now part of the JavaScript standard. JavaScript is moving forward and gaining

@ernie58
ernie58 / passport-user-credential.js
Last active May 7, 2018 08:12
Loopback Passport Component: keep UserIdentity in sync with UserCredentials
module.exports = function (PassportUserCredential) {
/*
* Check if credentials already exist for a given provider and external id
* Enable this hook if credentials can be linked only once
*
* @param Loopback context object
* @param next middleware function
* */
PassportUserCredential.observe('before save', function checkPassportUserCredentials(ctx, next){
@ericelliott
ericelliott / gitclean.sh
Created January 31, 2016 04:57
gitclean.sh - cleans merged/stale branches from origin
git remote prune origin
git branch -r --merged master | egrep -iv '(master|develop)' | sed 's/origin\///g' | xargs -n 1 git push --delete origin
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active October 1, 2024 17:10
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@nolanlawson
nolanlawson / citizen.md
Last active February 19, 2019 12:38
How to be a good open-source citizen

How to be a good open-source citizen

A short list of tips and recommendations, for those who use OSS and/or want to contribute to it.

  1. Give feedback

Before I get into the wrong ways to give feedback, let me be clear: the worst thing you can do is give no feedback at all.