Visual Studio 2017 JQuery, WebPack and .Core

http://leruplund.dk/2017/04/15/setting-up-asp-net-core-in-visual-studio-2017-with-npm-webpack-and-typescript-part-i/

 

The CLI moved into a separate package: webpack-cli.
Please install ‘webpack-cli’ in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D

https://github.com/FormidableLabs/webpack-dashboard/issues/97

 

(Make sure you deleted the bundle.js file to ensure your task runner is executing correctly)

If you configure the TASK RUNNER EXPLORER and you do NOT get your files in the DIST FOLDER…
Make sure that Visual Studio is using the global installed version of npm not it’s local.
In VS 2017 TOOLS | OPTIONS
In filter box type: External Web Tools

Move $(PATH) to the top of the list in the Locations of External tool

 

npm install jquery –save

Adding JQuery typings

https://www.npmjs.com/package/@types/jquery

Install d3 via npm then typings

npm install –save d3

npm install –save @types/d3

Dynamic Search Conditions in T‑SQL

I hate dynamic querys as they are not optimized and a query plan cannot be cached….

Example:

Sql = some dyanamic sql string built via if logic…

Exec(sql) – will not cache an query execution plan.

In MS Sql   sp_executesql caches query plans – very cool…

Really though, try to avoid them if possible….

 

Great read on the details…

Newest version of document:  http://www.sommarskog.se/dyn-search-2008.html

Older version

http://www.sommarskog.se/dyn-search-2005.html – Version for SQL 2005 and Earlier

 

Useful Tools for Development and UI stuff

Chrome Extensions

Photo by Caio Resende from Pexels

Now that I am a self-proclaimed web developer, I practically live in my Chrome console. Below are some tools that allow me to spend less time there:

  • WhatFont — The name says it all. This is an easy way of finding out the fonts that your favorite website is using, so that you can borrow them for your own projects.
  • Pesticide — Useful for seeing the outlines of your <div>s and modifying CSS. This was a lifesaver when I was trying to learn my way around the box-model.
  • Colorzilla — Useful for copying exact colors off of a website. This copies a color straight to your clipboard so you don’t spend forever trying to get the right RGBA combination.
  • CSS Peeper — Useful for looking at colors and assets used on a website. A good exercise, especially when starting out, is cloning out websites that you think look cool. This gives you a peek under the hood at their color scheme and allows you to see what other assets exist on their page.
  • Wappalyzer — Useful for seeing the technologies being used on a website. Ever wonder what kind of framework a website is using or what service it is hosted on? Look no further.
  • React Dev Tools — Useful for debugging your React applications. It bears mentioning that this is only useful if you are programming a React application.
  • Redux Dev Tools — Useful for debugging applications using Redux. It bears mentioning that this is only useful if you are implementing Redux in your application.
  • JSON Formatter — Useful for making JSON look cleaner in the browser. Have you ever stared an ugly JSON blob in the face, trying to figure out how deeply nested the information you want is? Well this makes it so that it only takes 2 hours instead of 3.
  • Vimeo Repeat and Speed — Useful for speeding up Vimeo videos. If you watch video tutorials like most web developers, you know how handy it is to consume them at 1.25 times the regular playback speed. There are also versions for YouTube.

VS Code Extensions

Photo Courtesy of Pexels

Visual Studio Code is my editor of choice.

People love their text editors, and I am no exception. However, I’m willing to bet most of these extensions work for whatever editor you are using as well. Check out my favorite extensions:

  • Auto Rename Tag — Auto rename paired HTML tags. You created a <p>tag. Now you want to change it, as well as its enclosing </p> tag to something else. Simply change one and the other will follow. Theoretically improves your productivity by a factor of 2.
  • HTML CSS Support — CSS support for HTML documents. This is useful for getting some neat syntax highlighting and code suggestions so that CSS only makes you want to quit coding a couple of times a day.
  • HTML Snippets — Useful code snippets. Another nice time saver. Pair this with Emmet and you barely ever have to type real HTML again.
  • Babel ES6/ES7 — Adds JavaScript Babel syntax coloring. If you are using Babel, this will make it much easier to differentiate what is going on in your code. This is neat if you like to play with modern features of JavaScript.
  • Bracket Pair Colorizer — Adds colors to brackets for easier block visualization. This is handy for those all-too-common bugs where you didn’t close your brackets or parentheses accurately.
  • ESLint — Integrates ESLint into Visual Studio Code. This is handy for getting hints about bugs as you are writing your code and, depending on your configuration, it can help enforce good coding style.
  • Guides — Adds extra guide lines to code. This is another visual cue to make sure that you are closing your brackets correctly. If you can’t tell, I’m a very visual person.
  • JavaScript Console Utils — Makes for easier console logging. If you are like most developers, you will find yourself logging to the console in your debugging flow (I know that we are supposed to use the debugger). This utility makes it easy to create useful console.log() statements.
  • Code Spell Checker — Spelling checker that accounts for camelCase. Another common source of bugs is fat-thumbing a variable or function name. This spell checker will look for uncommon words and is good about accounting for the way we write things in JavaScript.
  • Git Lens — Makes it easier to see when, and by whom, changes were made. This is nice for blaming the appropriate person when code gets broken, since it is absolutely never your fault.
  • Path Intellisense — File path autocompletion. This is super handy for importing things from other files. It makes navigating your file tree a breeze.
  • Prettier — Automatic code formatter. Forget about the days where you had to manually indent your code and make things human-legible. Prettier will do this for you much faster, and better, than you ever could on your own. I can’t recommend this one enough.
  • VSCode-Icons — Adds icons to the file tree. If looking at your file structure hurts your eyes, this might help. There is a helpful icon for just about any kind of file you are making which will make it easier to distinguish what you are looking at.

 

SOURCE:  https://medium.freecodecamp.org/tools-i-wish-i-had-known-about-when-i-started-coding-57849efd9248

FORCE NPM to use latest version of TYPESCRIPT

Re posted from: http://www.davevoyles.com/2016/02/14/how-to-force-npm-to-look-for-the-latest-version-of-typescript/

 

tsc-issue

I recently started using TypeScript for a new project, and hit a few snags along the way. The first of which, was that my local project was using an older version of TypeScript, specifically 1.0.3.0 . This was odd, because I had just installed the latest version of TypeScript, but globally and locally.

I searched around and found this answer on StackOverflow, which was identical to my own problem.

What it came down to was my PATH environment variable was wrong. Windows was constantly referencing an older version of TypeScript which was previously installed on the machine.

I used windows explorer (just hit the win key) and navigated to this address:

C:Program Files (x86)Microsoft SDKsTypeScript

From there, you’ll see several TypeScript folders. Simply rename the oldest version to 1.0.3.0-OLD.

tsc-solution

After that,check for the version of node you are using in your project, and it should reflect this change and now find the latest version installed.

tsc-latest-version