Skip to content

Instantly share code, notes, and snippets.

View aneudysamparo's full-sized avatar
🎯
Focusing

Aneudys Amparo aneudysamparo

🎯
Focusing
View GitHub Profile
@aneudysamparo
aneudysamparo / gist:5eb5006987ef979af162fa80d2180e7d
Last active December 19, 2020 15:05
Enable classPrivateMethods in ReactJS
First, Install this
npm i eslint @babel/core @babel/eslint-parser @babel/preset-env -D
Second, Create a .babelrc file
{
"presets": [
["@babel/preset-env",
{
"shippedProposals": true
@aneudysamparo
aneudysamparo / gist:30d0c4d7f82cd089753dcda56de040b0
Created August 24, 2020 16:43
NestJs authentication using JWT and private and public key
Since it's been days, I am guessing this was solved. I am just adding my two cents here for future readers.
The problem lies with the JwtModule and the JwtStrategy instantiation. They aren't configured properly.
You need to pass in the algorithms you'd use for signing and verifying the tokens, along with the keys.
To verify whether the tokens are actually getting generated with the RS256 algo, check the header in the token at https://jwt.io/.
It would probably show HS256, and since your code didn't use the correct algorithm to sign the token.
And it fails while token gets verified using the public key.
To generate signed tokens properly with the RSA key pair:
@aneudysamparo
aneudysamparo / Working behind a proxy, Nudget, NPM, Git.txt
Last active April 14, 2020 18:07
Working behind a proxy, Nudget, NPM, Git
Working behind a proxy Windows Env.
The following steps can be used for those working behind proxies that require authentication. All these methods will store your password in plain text, so use caution when doing this.
Setting the proxy for Nudget
Install the nuget.exe CLI by downloading it from nuget.org, saving that .exe file to a suitable folder, and adding that folder to your PATH environment variable, so that you can run nuget command from terminal.
nuget.exe config -set http_proxy=http://my.proxy.address:port
nuget.exe config -set http_proxy.user=mydomain\myUserName
nuget.exe config -set http_proxy.password=mySuperSecretPassword
@aneudysamparo
aneudysamparo / Deploy NestJS (Node-Express) on Plesk
Created April 2, 2020 22:18
How to deploy a NestJS app on Plesk
-Copy files to web directory ex: app.js and folders
-copy packages.json to webdirectory
-npm install
-change permision to all files and folders to only owner read
pase this on top of your app.js file
if (typeof(PhusionPassenger) !== 'undefined') {
PhusionPassenger.configure({ autoInstall: false });
}
@aneudysamparo
aneudysamparo / how-to-setup-mac-elasticsearch.md
Created November 17, 2019 21:49 — forked from jpalala/how-to-setup-mac-elasticsearch.md
setting up elasticsearch on your mac with brew

Install va homebrew

If you don't have homebrew installed - get homebrew here

Then run: brew install elasticsearch

Configuration

Update the elasticsearch configuration file in /usr/local/etc/elasticsearch/elasticsearch.yml.

@aneudysamparo
aneudysamparo / MySQL_5-7_macOS.md
Created September 24, 2019 15:51 — forked from robhrt7/MySQL_5-7_macOS.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@aneudysamparo
aneudysamparo / 0000_00_00_000000_create_user_table.php
Created September 18, 2019 15:37 — forked from safoorsafdar/0000_00_00_000000_create_user_table.php
Multiple Tenancy (with separate database) Migration Management for Laravel 5.*
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Migration type to syncronized with multiple/single database connection
*/