.NET Portability Analyzer

The .NET Portability Analyzer is an open source tool that is utitlized to analyze assemblies, files or directory of files for compatibility across .NET implementations.

This tool reports on the compatibility of the current app across .NET implementations.

It comes as:

  1. Visual Studio Extension - analyzes individual assemblies/projects or the solution
  2. A console app (ApiPort) - analyzes assemblies/files/directories

References:





Shared by joubin on Fri Sep 06 2019

Debugging modes, VS Code

In VS Code, there are two core debugging modes, Launch and Attach.

  1. Starting in the browser
    • When you open DevTools in a browser, you are attaching DevTools to the open browser tab.
  2. Starting in the code editor
    • The editor launches your process, and it automatically attaches its debugger to the newly launched process.

References:

Shared by joubin on Fri Aug 09 2019

Launch Configuration, VS Code

A configuration file allows you to configure and save debugging setup details.

VS Code keeps debugging configuration information in a launch.json file located in a .vscode folder in your workspace (project root folder)

References:

Shared by joubin on Fri Aug 09 2019

Angular Framework app version

1. ng --version (or ng v)

2. Open Developer Tools in the browser. Under the 'Elements' tab, look for html/body/app-root[ng-version]

3. To render the Angular version on a page, import VERSION from @angular/cli.

const version = VERSION.full;







Shared by joubin on Wed Jul 31 2019

Prune/Cleanup the local references to remote branch

Dry-run: The command git remote prune origin --dry-run lists branches that can be deleted/pruned on your local.

To remove the local remove '--dry-run'.

References:

Shared by joubin on Mon Jun 03 2019

OData - Querying Data

$filter: The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response.

serviceRoot/People?$filter=FirstName eq 'Scott'

$orderby: The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc.

serviceRoot/People('scottketchum')/Trips?$orderby=EndsAt desc

$count: The $count system query option allows clients to request a count of the matching resources included with the resources in the response.

serviceRoot/People/$count

$select: The $select system query option allows the clients to requests a limited set of properties for each entity

serviceRoot/Airports?$select=Name, IcaoCode

$top & $skip: The $top system query option requests the number of items in the queried collection to be included in the result. The $skip query option requests the number of items in the queried collection that are to be skipped and not included in the result.

serviceRoot/People?$top=2

$expand: The $expand system query option specifies the related resources to be included in line with retrieved resources.

serviceRoot/People('keithpinckney')?$expand=Friends

Supporting multiple filters:

Use the and/or operators to apply multiple filters.

References:

http://www.odata.org/getting-started/basic-tutorial

Shared by joubin on Fri Jun 23 2017

Theory attribute, xUnit

Marks a test method as being a data theory.

Data theories are tests which are fed various bits of data from a data source, mapping to parameters on the test method.

If the data source contains multiple rows, then the test method is executed multiple times (once with each data row). Data is provided by attributes which derive from Xunit.Sdk.DataAttribute:

  • Xunit.InlineDataAttribute
  • Xunit.MemberDataAttribute

References:

https://github.com/xunit/xunit

Shared by joubin on Thu May 16 2019

Content-Disposition, Http Header

The Content-Disposition response-header field has been proposed as a means for the origin server to suggest a default filename if the user requests that the content is saved to a file.

Example:

Content-Disposition: attachment; filename="fname.csv"

Note: In the context of a CORS request, use the Access-Control-Expose-Headers Http header to expose Content-Disposition as a header value.

References:

https://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html

Shared by joubin on Thu May 16 2019

CORS related headers

All CORS related headers are prefixed with "Access-Control-".

Access-Control-Allow-Origin
Access-Control-Allow-Credentials
Access-Control-Expose-Headers

References:

https://www.html5rocks.com/en/tutorials/cors/

Shared by joubin on Thu May 16 2019

Azure Security Center

Azure Security Center (ASC) is a monitoring service that provides threat protection across all of your services both in Azure, and on-premises.

ASC is part of the Center for Internet Security (CIS) recommendations.

References:

https://docs.microsoft.com/en-us/learn/modules/top-5-security-items-to-consider/2-azure-security-center

Shared by joubin on Mon May 13 2019

Center for Internet Security

The Center for Internet Security (CIS) is a nonprofit organization, formed in October, 2000.

Its mission is to "identify, develop, validate, promote, and sustain best practice solutions for cyber defense and build and lead communities to enable an environment of trust in cyberspace".

The organization is headquartered in East Greenbush, New York, with members including large corporations, government agencies, and academic institutions.

References:

https://en.wikipedia.org/wiki/Center_for_Internet_Security

Shared by joubin on Mon May 13 2019

SIEM, Security

Security information and event management (SIEM) software products and services combine security information management (SIM) and security event management (SEM). They provide real-time analysis of security alerts generated by applications and network hardware.

Vendors sell SIEM as software, as appliances or as managed services; these products are also used to log security data and generate reports for compliance purposes.

See also:

SIM - Security Information Management

SEM - Security Event Management

References:

https://en.wikipedia.org/wiki/Security_information_and_event_management

Shared by joubin on Mon May 13 2019

Global Error Handling, Angular

Create a class that implements ErrorHandler.

It has one method needs implementing: handleError 

References:

https://angular.io/api/core/ErrorHandler

Shared by joubin on Mon May 13 2019

Http Interception, Angular

You declare a class as an interceptor in Angular by implementing the HttpInterceptor interface.

An interceptor will transform the client requests and responses from the server.

References:

https://angular.io/guide/http#intercepting-requests-and-responses

Shared by joubin on Wed May 08 2019

Anaconda

Anaconda is a Python distribution that comes pre-installed with many data science related libraries.

References:

Shared by joubin on Sat Jun 03 2017

DATEPART, TSql

Returns an integer from a 'date' string based on the argument of datepart abbreviation.

DATEPART ( datepart , date )

References:

Shared by joubin on Mon May 06 2019

DATEFROMPARTS, TSql

Returns a datetime type given integer year/month/day.

DATEFROMPARTS ( year, month, day )

References:

Shared by joubin on Mon May 06 2019

Bottom Sheets, Material design

Bottom sheets are surfaces containing supplementary content that are anchored to the bottom of the screen.

References:

Shared by joubin on Sun Apr 28 2019

New keybinding, Visual Studio Code

All keyboard shortcuts in VS Code can be customized via the keybindings.json file.

To customize Visual Studio Code with a new keyboard short:

  1. File -> Preferences -> Keyboard Shortcuts
  2. On this screen, click on the {} item on the top-right corner. This will open the keybindings.json file.
  3. Enter a custom command such as the following:
    1. { "key": "ctrl+up", "command": "workbench.action.toggleMaximizedPanel" }, // I wanted a command to maximize the terminal window
  4. Save

References:

Shared by joubin on Wed Apr 24 2019

npm commands

Update npm itself

npm install -g npm

Check npm version

npm --version

Install a package

# Local
npm install package-name

# Local + make an entry in package.json as dependency
npm install package-name --save

# Install specific version of a package
npm install package-name@1.2.3

# Global
npm install -g package-name

Un-install a package

# Local
npm uninstall package-name

# Global
npm uninstall package-name -g

Get package info

# Home page
npm home package_name
# Github repo
npm repo package_name

Check for outdated packages in package.json

# Local
npm outdated

# Global
npm outdated -g

# Production only
npm outdated --prod

Remove un-used packages from node_modules folder

npm prune

Update all packages listed in package.json

npm update

npm --depth 9999 update

Remove duplicate packages from node_modules

npm dedupe

References:

Shared by joubin on Fri Apr 12 2019