This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.npmjs.com/package/axios Version 0.19.2 | |
import Axios, { AxiosInstance } from 'axios' | |
export interface IEntity { | |
example: string | |
} | |
export interface ISdk { | |
getAllAsync: () => Promise<IEntity[]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PublicError from './PublicError'; | |
// Based catch-decorator by Enkot https://github.com/enkot/catch-decorator | |
// decorator factory function | |
export default (name: string, message?: string): any => { | |
return ( | |
target: any, | |
propertyKey: string, | |
descriptor: PropertyDescriptor, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://webpack.js.org/loaders/raw-loader/ | |
npm install raw-loader --save-dev | |
// In webpack.config.js | |
module.exports = { | |
... | |
module: { | |
rules: [ | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// package.json | |
{ | |
... | |
"scripts": { | |
"test": "NODE_ENV=test jest --ci --verbose", | |
}, | |
... | |
"devDependencies": { | |
"@types/jest": "^26.0.3", | |
"babel-jest": "^26.1.0", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Learn more about Standard JS: https://standardjs.com/index.html | |
// package.json | |
{ | |
... | |
"scripts": { | |
"validate:ci": "tsc --noEmit && eslint . --fix", | |
} | |
... | |
"devDependencies": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Project –All | Add-BindingRedirect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
TableName = t.name, | |
IndexName = ind.name, | |
IndexId = ind.index_id, | |
ColumnId = ic.index_column_id, | |
ColumnName = col.name, | |
ind.*, | |
ic.*, | |
col.* | |
FROM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Missing Index Script | |
-- Original Author: Pinal Dave | |
SELECT TOP 25 | |
dm_mid.database_id AS DatabaseID, | |
dm_migs.avg_user_impact*(dm_migs.user_seeks+dm_migs.user_scans) Avg_Estimated_Impact, | |
dm_migs.last_user_seek AS Last_User_Seek, | |
OBJECT_NAME(dm_mid.OBJECT_ID,dm_mid.database_id) AS [TableName], | |
'CREATE INDEX [PERF_' + OBJECT_NAME(dm_mid.OBJECT_ID,dm_mid.database_id) + '_' | |
+ REPLACE(REPLACE(REPLACE(ISNULL(dm_mid.equality_columns,''),', ','_'),'[',''),']','') | |
+ CASE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestClass] | |
public class Initalize | |
{ | |
[AssemblyInitialize] | |
public static void InitializeDbContext(TestContext context) | |
{ | |
// Connection string in app.config should use LocalDb, EG: | |
// <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\DefaultConnection.mdf;Initial Catalog=DefaultConnection;Integrated Security=True" providerName="System.Data.SqlClient" /> | |
AppDomain.CurrentDomain.SetData("DataDirectory", context.TestDeploymentDir); | |
Database.SetInitializer(new DropCreateDatabaseAlways<ApplicationDbContext>()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Extension methods for the system MVC controller and related classes | |
/// </summary> | |
public static class ControllerExtensions | |
{ | |
/// <summary> | |
/// Renders a view to string using the given model | |
/// </summary> | |
/// <param name="controller"></param> | |
/// <param name="viewName"></param> |