Skip to content

Instantly share code, notes, and snippets.

<connectionStrings>
<!--<add name="NorthwindSlimContext" connectionString="Data Source=.\sqlexpress;Initial Catalog=NorthwindSlim;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />-->
<add name="NorthwindSlimContext" connectionString="Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\NorthwindSlim.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
using System.Collections.Generic;
using System.Threading.Tasks;
using HelloMvcWithDI.Entities;
using HelloMvcWithDI.Patterns;
namespace HelloMvcWithDI.Tests
{
public class FakeProductRepository : IProductRepository
{
private List<Product> _products = new List<Product>
@tonysneed
tonysneed / git-add-remote
Last active April 27, 2016 15:12
Command to add a remote git repository
# Sets the new remote
git remote add origin <remote repository URL>
# Verifies the new remote URL
git remote -v
# Pushes the changes
git push origin master
@tonysneed
tonysneed / settings.json
Last active October 23, 2016 07:06
VS Code User Settings
// Place your settings in this file to overwrite the default settings
{
"window.reopenFolders": "none",
"editor.fontSize": 15
}
@tonysneed
tonysneed / keybindings.json
Last active October 23, 2016 13:55
VS Code Keyboard Shortcuts
// Place your key bindings in this file to overwrite the defaults
[
{ "key": "shift+cmd+g", "command": "workbench.view.git" },
{ "key": "shift+cmd+x", "command": "workbench.action.tasks.terminate" },
{ "key": "cmd+.", "command": "editor.action.quickFix", "when": "editorTextFocus" }
]
@tonysneed
tonysneed / server.ts
Created November 13, 2016 13:52
Express server with static files support
import * as express from "express";
import { Request, Response, NextFunction } from "express";
import * as bodyParser from "body-parser";
import * as path from "path";
import { productsRouter } from "./routes/products";
namespace express_router {
let app = express();
@tonysneed
tonysneed / vs-code-links.md
Last active March 9, 2017 09:19
Helpful Links on Visual Studio Code and TypeScript
@tonysneed
tonysneed / git-pr-ready.md
Last active June 30, 2017 11:08
Git: Pull Request Ready to Merge

Git Commands After Pull Request Is Ready to Merge

After a PR is ready to merge you should:

  • Pull in other people's commits
  • Rebase your commit on top of theirs
  • Squash your commits into a final commit
  • Force push your commit to origin  
  1. Pull upstream commits from staging and rebase so that the final commit comes after them.
@tonysneed
tonysneed / convert-objects.ts
Last active July 4, 2017 14:45
Function to convert array of object literals to strongly typed objects
export function convertObjects<Target>(objects: Object[], types: Target[]) {
for (let i = 0; i < objects.length; i++) {
Object.assign(types[i], objects[i])
}
}
@tonysneed
tonysneed / keybindings.json
Created July 14, 2017 14:57
Angular CLI VS Code Keyboard Shortcuts
// Place your key bindings in this file to overwrite the defaults
[
// End a running background task
{
"key": "shift+cmd+x",
"command": "workbench.action.tasks.terminate"
},
// Show Source Control
{
"key": "shift+cmd+g",