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
// FRONTEND (angular2) | |
// product-form.compontent.html | |
<input type="file" (change)="fileChangeEvent($event)" placeholder="Upload file..." /> | |
<button type="button" (click)="upload()">Upload</button> | |
// product-form.compontent.ts | |
import { Component, OnInit } from '@angular/core'; | |
import { Http } from '@angular/http'; | |
@Component({ |
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
#!/usr/bin/env node | |
// Script to update typings to their latest versions. | |
// Note that it should be executed in the folder where typings.json is. | |
const { exec, execSync } = require('child_process'); | |
const path = require('path'); | |
const typings = require(path.join(process.cwd(), 'typings.json')); | |
exec('typings ls', (error, _, stderr) => { | |
if (error) { |
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
(function () { | |
'use strict'; | |
var sinon = require('sinon'); | |
var keys = ['closest', 'addClass', 'children', 'parent', 'find', 'html', | |
'remove', 'text', 'ready', 'unveil', 'removeAttr', 'removeClass', 'scroll', | |
'val', 'height', 'css', 'delay', 'queue', 'dequeue', 'attr']; | |
function JQueryStub (args) { | |
var self = this; |
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
#Requires -version 4 | |
#Requires -RunAsAdministrator | |
#Requires -Module Hyper-V | |
# For detailed information on deploying and managing Nano Server, please go to this link: http://www.aka.ms/nanoserver | |
Function New-NanoServer { | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory)] |
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
// Restify Server CheatSheet. | |
// More about the API: http://mcavage.me/node-restify/#server-api | |
// Install restify with npm install restify | |
// 1.1. Creating a Server. | |
// http://mcavage.me/node-restify/#Creating-a-Server | |
var restify = require('restify'); |