Skip to content

Instantly share code, notes, and snippets.

@Hoang-Minh
Hoang-Minh / nvmCommands.js
Created April 19, 2023 03:45 — forked from chranderson/nvmCommands.js
Useful NVM commands
// check version
node -v || node --version
// list installed versions of node (via nvm)
nvm ls
// install specific version of node
nvm install 6.9.2
// set default version of node
@Hoang-Minh
Hoang-Minh / RestSharpExtensions.cs
Created October 7, 2022 05:05 — forked from lkaczanowski/RestSharpExtensions.cs
RestSharp extensions for error handling
using System;
using System.Net;
using System.Text;
using RestSharp;
namespace RestSharpExtensions
{
internal static class RestSharpExtensions
{
Create.Table("AspNetRoles")
.WithColumn("Id").AsString().PrimaryKey("PK_AspNetRoles").NotNullable()
.WithColumn("ConcurrencyStamp").AsString().Nullable()
.WithColumn("Name").AsString(256).NotNullable()
.WithColumn("NormalizedName").AsString(256).Nullable()
.Indexed("RoleNameIndex");
Create.Table("AspNetUserTokens")
.WithColumn("UserId").AsString().PrimaryKey("PK_AspNetUserTokens").NotNullable()
@Hoang-Minh
Hoang-Minh / gist:a108a71266dc2606625bb0168396fef3
Created August 19, 2021 18:01
Stripe Testing Credit Card Scenario
https://stripe.com/docs/testing
#Test credit card numbers to use when developing with Stripe
4242424242424242 Visa
4012888888881881 Visa
4000056655665556 Visa (debit)
1. Open bash under admin
2. npm config set cache C:\tmp\nodejs\npm-cache --global
3. npm config set cache "C:\Users\SABAHA~1\AppData\Roaming\npm-cache" --global
4. After you change the path, uninstall the global create-react-app npm uninstall -g create-react-app, and try using npx again.
@Hoang-Minh
Hoang-Minh / gist:87629b2d16296704b6c538846ebd546c
Created July 17, 2020 06:31
Plus floating button - purely html and css
<div class="fab"> + </div>
.fab {
width: 70px;
height: 70px;
background-color: red;
border-radius: 50%;
box-shadow: 0 6px 10px 0 #666;
transition: all 0.1s ease-in-out;
Create a file history.js
import { createBrowserHistory } from 'history';
export const history = createBrowserHistory();
Import this file to any component that you want to access history
import { history } from '../_helpers';
1. In the server folder, package.json folder, add these node values:
"engines": {
"node": "12.13.0",
"npm": "6.12.0"
},
and
2. "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm i --prefix client && npm run build --prefix client"
3. if (process.env.NODE_ENV === "production") {
// Express will serve up production assets
@Hoang-Minh
Hoang-Minh / Git
Last active April 15, 2024 21:59
Create a new branch on local and push into remote repo
git checkout -b <branch>
//Edit files, add and commit. Then push with the -u (short for --set-upstream) option:
git push -u origin <branch>
### How to create a local branch and check it to remote repository:
1. git checkout -b <nameofYourBranch>
2. git add .
3. git commit -m "your message here"
4. git push -u <yourRemoteName> <nameofYourBranch>
@Hoang-Minh
Hoang-Minh / bat
Created June 19, 2019 07:41
mongo db startup
@echo off
cd "C:\Program Files\MongoDB\Server\4.0\bin"
start mongod.exe
timeout 4
start mongo.exe
exit