Skip to content

Instantly share code, notes, and snippets.

View niisar's full-sized avatar

Mohammed Nisar Ansari niisar

View GitHub Profile
niisar / Git
Created January 31, 2019 13:23
Git Helper

If you accidentally mistype a commit message, you can change it using git commit --amend - m "new message"

niisar / SessionExtensions.cs
Last active June 20, 2020 10:07
SessionExtensions in core 1.0
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
public static class SessionExtensions
public static void Set<T>(this ISession session, string key, T value)
session.SetString(key, JsonConvert.SerializeObject(value));
massahud / Portable Node.js andNPM on
Last active February 8, 2024 14:30
Portable Node.js and NPM on windows
  1. Get node binary (node.exe) from
  2. Create the folder where node will reside and move node.exe to it
  3. Download the last zip version of npm from
  4. Unpack the zip inside the node folder
  5. Download the last tgz version of npm from
  6. Open the tgz file and unpack only the file bin/npm (without extension) directly on the node folder.
  7. Add the the node folder and the packages/bin folder to PATH
  8. On a command prompt execute npm install -g npm to update npm to the latest version

Now you can use npm and node from windows cmd or from bash shell like Git Bash of msysgit.