git – How to prune local tracking branches that do not exist on remote anymore

One-liner, cross platform, doesn’t look like the cat slept on your keyboard:

npx git-removed-branches

(dry-run) or

npx git-removed-branches --prune

(removes for real).
You need to already have node.js installed.

Source: git – How to prune local tracking branches that do not exist on remote anymore – Stack Overflow

Oracle SQL-Developer: Show timestamp in date columns

You can decide how SQL-Developer display date and timestamp columns.

  1. Go to the “Tools” menu and open “Preferences…”
  2. In the tree on the left open the “Database” branch and select “NLS”
  3. Now change the entries “Date Format”, “Timestamp Format” and “Timestamp TZ Format” as you wish!

ISO formated output with date and time

  • Date Format: YYYY-MM-DD HH24:MI:SS
  • Timestamp Format: YYYY-MM-DD HH24:MI:SSXFF
  • Timestamp TZ Format: YYYY-MM-DD HH24:MI:SSXFF TZR

Source: SQL-Developer: How to change the date format of the result grid – “Why does my date column have no time?” | Oracle Deli

RepoZ: A git repository hub for Windows and macOS with Windows Explorer- & CLI-enhancements

RepoZ RepoZ is a zero-conf git repository hub with Windows Explorer- & CLI-enhancements. It uses the git repositories on your machine to create an efficient navigation widget and makes sure you’ll never lose track of your work along the way. It’s populating itself as you work with git. It does not get in the way and does not require any user attention to work. RepoZ will not compete with your favourite git clients, so keep them. It’s not about working within a repository: It’s a new way to use all of your repositories to make your daily work easier.

Keyboard shortcut in windows: Ctrl+Alt+R.
Runs as a taskbar application in Windows.

Source: awaescher/RepoZ: A zero-conf git repository hub for Windows and macOS with Windows Explorer- & CLI-enhancements

c# – How to read request body in a asp.net core webapi controller?

 

How to read request body in a asp.net core webapi controller?

A clearer solution, works in ASP.Net Core 2.1 / 3.1

Filter class

using Microsoft.AspNetCore.Authorization;
// For ASP.NET 2.1
using Microsoft.AspNetCore.Http.Internal;
// For ASP.NET 3.1
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Filters;

public class ReadableBodyStreamAttribute : AuthorizeAttribute, IAuthorizationFilter
{
public void OnAuthorization(AuthorizationFilterContext context)
{
// For ASP.NET 2.1
// context.HttpContext.Request.EnableRewind();
// For ASP.NET 3.1
// context.HttpContext.Request.EnableBuffering();
}
}

In an Controller

[HttpPost]
[ReadableBodyStream]
public string SomePostMethod()
{
//Note: if you're late and body has already been read, you may need this next line
//Note2: if "Note" is true and Body was read using StreamReader too, then it may be necessary to set "leaveOpen: true" for that stream.
HttpContext.Request.Body.Seek(0, SeekOrigin.Begin);

using (StreamReader stream = new StreamReader(HttpContext.Request.Body))
{
string body = stream.ReadToEnd();
// body = "param=somevalue&param2=someothervalue"
}
}

 

Source: c# – How to read request body in a asp.net core webapi controller? – Stack Overflow