Sunday, June 13, 2021

Git: How to set Git User Name and User email Globally & repository specific

Usually when we install Git, we typically configure your global username and email address after installing Git. However, you can do so now if you missed that step or want to make changes. After you set your global configuration, repository-specific configuration is optional.

Git configuration works the same across Windows, macOS, and Linux.

To set your global username/email configuration:

Open the command line.

-- set user name
$ git config --global user.name "First Name Last Name"
-- set user email
$ git config --global user.email "useremail@gmail.com"

To set repository-specific username/email configuration:

From the command line, change into the repository directory.

--Set your username
$ git config user.name "FIRST_NAME LAST_NAME"

--Set your email address
$ git config user.email "useremail@gmail.com"

--Verify your configuration by displaying your configuration file
$ cat .git/config

Hope this helps!

How to get list of column names from Table Variable @table

A table variable is a variable data type which can be used to store temporary data. It's defined using the DECLARE keyword and the table's structure is defined in the declaration as shown below:

declare @ns_source table
(
  col1_id int, 
  col2_name varchar(50),
  col3_desc varchar(50)
)    

Unlike temporary tables, table variables are not affected by a rollback. As regular variables, they keep the data which was modified during the transaction even if the transaction is rolled back.

Coming to get columns from table varaiable, here is how we can get using below query.

declare @ns_source table
(
  col1_id int, 
  col2_name varchar(50),
  col3_desc varchar(50)
)

select DP.N.value('local-name(.)', 'sysname') as ColumnName
from 
  (
  select NS.*
  from (select 1) as D(N)
    outer apply (
                select top(0) *
                from @ns_source
                ) as NS
  for xml path(''), elements xsinil, type
  ) as LV(X)
cross apply LV.X.nodes('*') as DP(N)

Result looks like below





Wednesday, June 02, 2021

How can we bulk close issues on JIRA?

Here is how we can bulk close JIRAs

Step 1: Search all the issues/stories you wan to close (Using JQL or predefined filter of your own),  something like below.




Step 2: Choose the issues that needs to be closed.

Step 3: Choose Operation, Since we are closing, we need to select transition issues and go to next. 

Step 4: Choose the operation from available workflow actions







Step 5: Here I have choosed Resolved as i am closing these issues.

Step 6: Select Resolved and proceed further.









Step 7: Add comments (optional) and choose resolution













Step 8: Choose confirm to bulk close all the tickets.










Easy right!!

Tuesday, June 01, 2021

Visual Studio 2019 Tips and Tricks

Visual Studio 2019 has a new feature with visibility into how an external library or dependency resource is handling the data you are giving it can provide valuable insight. Debugging decompiled resources is a great feature that allows to step into external libraries.

Select Tools > Options. Type “decompile” into the search bar. The Advanced section of Text Editor for C# will appear. Click on Advanced.
  

Check the box that says Enable navigation to decompiled sources (experimental).

Now you can debug and step into the external packages you pull in from Nuget and elsewhere! 

Happy Debugging!!

Saturday, May 29, 2021

How to Get Columns details from SQL Tables

Here is how you can get column names from specified table

SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns 
WHERETABLE_NAME = 'MobilityOrders'

Here is how you can get column count from specified table

SELECT COUNT(COLUMN_NAME) as COUNT FROM INFORMATION_SCHEMA.Columns 
WHERE TABLE_NAME = 'MobilityOrders'

Here is how you can get column count from temp table

 SELECT COUNT(*) as Cnt FROM tempdb.sys.columns
 WHERE object_id = object_id('tempdb..#temp2')

Hope this helps 😀