Survival Kit

#01. .CMD for Running Web Apps Disabling Chrome Security

launchme.cmd (this will open 2 prompts)

start cmd /k cd WS\my-app
cd "C:\Program Files (x86)\Google\Chrome\Application"
chrome.exe --user-data-dir="C:/chme temp" --disable-web-security

#02 | Install a node module as dev dependency

npm install --save-dev {package@ver}

#03 | Serve a local folder with Python

python -m SimpleHTTPServer 8000
#find your ip:
$ ifconfig | grep "inet " | grep -v 127.0.0.1

#04 | Create a File with Content

echo "Hello World" > labs.html && open labs.html

#05 | Git reset and commit locally

git reset --hard HEAD
git add .
git commit -m "messsage"

#06 | tslint setup issue

npm install -g tslint typescript

#07 | Angular2; Form Values in Template-Driven Forms

#f="ngForm", and print f.value in the DOM to check our form out, we do the opposite with reactive forms, as the [formGroup] is a directive that we bind to, passing the public user Object in:

// { name: '', account: { email: '', confirm: '' } }
{{ user.value | json }}

#08 | Batch Scripting

@echo off
start cmd /k webdriver-manager start --versions.chrome=2.24
echo Selemium Server Started & echo.

timeout 6
SET filename=spec-run.js
echo running protractor test: "%filename%" & echo.
set HTTP_PROXY=http://proxy.lk.com:8080/
protractor "%filename%"

#09 | read time, using word count

Example
jquery word count

ToDo: write lib time required to read=>
time = words in post[200words]/ words per min[60wpm]
ex => 3 min when words = 180 & wpm = 60;

#10 | Free Stock Photos

UnSplash
PicJumbo
Negative Space
List

#11 | Jasmine Introduction

Jasmine Intro from Pivotal Labs

#12 | Portable Node

  1. Get node zip from http://nodejs.org/download/ & extract
  2. Add the the node folder above & the ../node_modules/npm/bin folder to PATH
  3. Open CMD & execute ‘npm install -g npm’ to update npm to the latest version

#13 | More than 1 Node?

launchme.cmd

@echo off
set PATH=%PATH:C:\Program Files (x86)\nodejs\;=%
color 0a

cmd.exe /k cmd /c 
echo on
where node

#14 | A simple node Server

install

npm install connect serve-static

server.js

var connect = require('connect');
var serveStatic = require('serve-static');
connect().use(serveStatic(__dirname)).listen(8080, function(){
    console.log('Server running on 8080...');
});

execute:

node server.js

#15 | List Global NPM Packages

npm list -g --depth 0

#16 | HR Interview

a good source

Advertisements