Skip to content

Instantly share code, notes, and snippets.

@tonysneed
tonysneed / vs-code-ts-version.md
Created October 23, 2016 07:09
Use Specific Version of TypeScript with VS Code

NOTE: These steps are only required if you want to use a version of TypeScript that is not the same as the version that is bundled with Visual Studio Code.

  • Install the latest version of TypeScript

    npm install -g typescript@version
    
  • Configure VS Code to use installed version of TypeScript by opening Preferences, User Settings.

@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 / nano-docker.md
Last active August 20, 2019 20:45
Install Docker on Windows Nano Server

Install Docker on Windows Nano Server

Connect remotely to the nano server

  1. Open PowerShell as Administrator
  2. Test-WSMan xx.xxx.xxx.xx
  3. Enable-PSRemoting
  4. Enter public IP address of nano server: $ip = "xx.xxx.xxx.xx"
    Set-Item WSMan:\localhost\Client\TrustedHosts "$ip" -Force
  5. Enter-PSSession -ComputerName $ip -Credential "~\Administrator"
@tonysneed
tonysneed / vs-code-links.md
Last active March 9, 2017 09:19
Helpful Links on Visual Studio Code and TypeScript
@tonysneed
tonysneed / launch.json
Last active May 22, 2018 12:18
Chrome Debugging with VS Code and Angular CLI
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "ng serve",
"url": "http://localhost:4200/#",
"webRoot": "${workspaceRoot}"
},
@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 / tasks.json
Last active December 15, 2018 02:46
Angular CLI VS Code Tasks
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "serve",
"type": "npm",
"script": "start",
"presentation": {
@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",
@tonysneed
tonysneed / open-in-buttons-for-finder-toolbar.md
Created August 9, 2017 16:12
open-in-buttons-for-finder-toolbar

open-in-buttons-for-finder-toolbar