This file contains hidden or 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
- create a solution with a console project | |
- add a test project (right click on the solution) | |
- open NuGet Package Manager console | |
- in the console, change the active project to the test project | |
- type "Install-Package Moq" | |
- type "Install-Package Nunit" | |
- alternatively, just search for moq in the package manager ui |
This file contains hidden or 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
Pre-requisite: | |
- create a database | |
- create some tables in db | |
Steps: | |
1. start a console project (.net framework template) | |
2. once created go to solution explorer, right click on the project (not the solution) | |
3. add new item | |
4. in the add new item popup, select ADO.NET Entity Data Model | |
5. choose "code first from database" |
This file contains hidden or 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
Create CSV file using excel | |
Open studio 2022 | |
Open SQL Server Management Tool | |
In studio, start a project | |
Use “Integration Services Project” |
This file contains hidden or 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
function upperCaseFirst(inputStr) { | |
var valueOfFirstChar = inputStr.charCodeAt(0); | |
console.log('Value of first character:', valueOfFirstChar); | |
var upperCaseLetter = String.fromCharCode(valueOfFirstChar - 32); | |
console.log('Uppercase first character:', upperCaseLetter); | |
var restOfString = inputStr.slice(1); | |
console.log('Rest of the string:', restOfString); |
This file contains hidden or 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
{ | |
"type": "mysql", | |
"host": "db", // the image name. do not use localhost | |
"port": 3306, | |
"username": "root", | |
"password": "password", | |
"database": "", | |
... | |
} |
This file contains hidden or 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
var request = require ("request"); | |
var urlWebHook = "https://hooks.slack.com/services/abcdef"; //the URL you get on your "incoming web hooks" page. | |
function sendToSlack (s, theUsername, theIconUrl, theIconEmoji, theChannel) { | |
var payload = { | |
text: s | |
}; | |
if (theUsername !== undefined) { | |
payload.username = theUsername; |
This file contains hidden or 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
const boxes = [[2, 3, 4], [1, 1, 10]]; | |
// Calculates the total surface area of a box. | |
// includes allowance for wrapping a box (packagingBuffer) | |
function total(boxes) { | |
var total = 0; | |
for (var b of boxes) { | |
var side1 = b[0]*b[1]; | |
var side2 = b[1]*b[2]; |