Skip to content

Instantly share code, notes, and snippets.

View felipekm's full-sized avatar
🦈

Felipe Kautzmann felipekm

🦈
View GitHub Profile
@felipekm
felipekm / README.md
Created April 13, 2023 17:44
NodeJS - How to fix Intellisense for module-alias Package

If you are not using CommonJS on NodeJS and having problems with the intellisense for getting into modules.

  1. Install module-alias and module-alias-jest
  2. Configure your package.json file with your aliases:
{
  "_moduleAliases": {
    "$root": ".",
    "$src": "./src",
@felipekm
felipekm / HOWTO.md
Created September 20, 2023 17:20
How to install Shopify CLI for NodeJS

Make sure to install these packages:

  • npm install -g @shopify/cli
  • npm install -g @shopify/app
@felipekm
felipekm / pm2_rust.md
Last active May 25, 2023 16:12
Use PM2 with RUST

Make a Rust project: cargo init foo

Install PM2:

  1. npm init
  2. npm install pm2

Create a script entry in your package.json to launch pm2:

@felipekm
felipekm / startec2.py
Created November 18, 2019 14:22
start ec2 instance python
import boto3
# defines ec2
ec2 = boto3.resource('ec2')
# lambda handler
def lambda_handler(event, context):
# builds an array filter to get EC2 instances with TAG `LIGAR`
arrOffInstancesFilter = [
@felipekm
felipekm / jest-mock-class.js
Created April 20, 2023 15:21
Jest Mock Class
const mock = jest.mock('@services/plaid', () => {
const PlaidService = jest.requireActual('@services/plaid');
return class PlaidServiceMock extends PlaidService {
constructor() {
super();
this.somefn = jest.fn(() => {
return { token: 'test' };
});
}
};
@felipekm
felipekm / fix-vim-fugitive.sh
Created March 29, 2023 17:59
Error detected while processing /.vim/bundle/vim-fugitive/plugin/fugitive.vim:
# Error detected while processing .vim/bundle/vim-fugitive/plugin/fugitive.vim:
cd && cd /.vim/bundle/vim-fugitive/plugin/
git pull --rebase
@felipekm
felipekm / pull-request.md
Created January 22, 2023 17:17
Pull Request Template

Description:

  • Detailed description to give context to reviewers and for historical reference.
  • Task URL (JIRA, Linear).

Screenshots

[Before]

[After]

@felipekm
felipekm / express.js
Created January 9, 2023 00:16
Express Gist
import express 'express';
const app = express();
app.use(express.json());
app.use(express.bodyParser());
// Using Middlewares
// app.use(express.myMiddleWare())
app.post('/', (req, res) => {
@felipekm
felipekm / jwt.js
Created January 8, 2023 23:52
JWT basic implementation
import * as jwt from 'jsonwebtoken';
const encData = jwt.sign({ name: 'Kautzmann', process.env.SECRET_KEY });
const decData = jwt.verify(encData, process.env.SECRET_KEY);
console.log(encData, decData);
@felipekm
felipekm / SOLUTION.md
Created August 1, 2022 16:00
Fixes nvm ls-remote "N/A".

Tested in MacOS

  • Creates a file on your root: ~/.curlrc
  • Adds -k inside of it.

This option allows curl to proceed and operate even for server connections otherwise considered insecure. The server connection is verified by making sure the server's certificate contains the right name and verifies successfully using the cert store.

See this online resource for further details: http://curl.haxx.se/docs/sslcerts.html