Skip to content

Instantly share code, notes, and snippets.

View morsh's full-sized avatar

Mor Shemesh morsh

  • Microsoft
  • Israel
View GitHub Profile
@morsh
morsh / template.base.json
Created March 6, 2016 14:07
ARM CI - Base
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {...},
"resources": [
{
"apiVersion": "2015-04-01",
"name": "[parameters('hostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[parameters('siteLocation')]",
@morsh
morsh / error.cmd
Created March 6, 2016 14:08
ARM CI - Error
npm WARN package.json NodeWorkersEditor@0.0.0 No repository field.
npm WARN package.json NodeWorkersEditor@0.0.0 No license field.
npm WARN deprecated graceful-fs@2.0.3: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.2.4\\node.exe" "D:\\Program Files (x86)\\npm\\2.14.12\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! node v4.2.4
npm ERR! npm v2.14.12
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read
@morsh
morsh / template.sourcecontrol.json
Created March 6, 2016 14:09
ARM CI - Source Control
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {...},
"resources": [
{
"apiVersion": "2015-04-01",
"name": "[parameters('hostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[parameters('siteLocation')]",
@morsh
morsh / ensure-folder-hierarchy.js
Last active May 19, 2016 14:47
ensure-folder-hierarchy.js
var fse = require('fs-extra');
var path = require('path');
// This will be the name that will appear in the Azure Portal
var workerName = 'worker';
console.info('Checking if should create web job folders');
// Making sure this is a web job in case we want this deployment to also
// contain web site roles
npm install tsd -g
tsd install node
@morsh
morsh / .deployment
Last active March 29, 2017 14:16
Deploying yarn using a deployment script
[config]
SCM_COMMAND_IDLE_TIMEOUT=300
command = azure-deploy.cmd
@morsh
morsh / multiprocess-server.js
Created October 17, 2018 10:17
Example on how to run multi-process node.js server
/**
* This is sample to show multiprocess programming in node.js
*/
const cluster = require('cluster');
const http = require('http');
const numberOfCPUs = require('os').cpus().length;
if (cluster.isMaster) {
@morsh
morsh / dog-picture.tsx
Created April 27, 2020 21:01
don't mock around
interface State {
dogImageUrl: string;
}
export class DogPicture extends React.PureComponent<{}, State> {
componentDidMount() {
const dogService = new DogService();
dogService.getRandomImageUrl()
.then(dogImageUrl => this.setState({ dogImageUrl }))
}