Select current file in project view
The current version of IntelliJ has renamed this to “Select In” under the Navigate category. The default shortcut is still ALT-F1
Source: keyboard shortcuts – Locate current file in IntelliJ – Stack Overflow
My bookmarks and blogposts regarding Software Development in .NET, C#, Angular, JavaScript, CSS, Html
Select current file in project view
The current version of IntelliJ has renamed this to “Select In” under the Navigate category. The default shortcut is still ALT-F1
Source: keyboard shortcuts – Locate current file in IntelliJ – Stack Overflow
This looks great, VS Code Dark+ theme:
lenny1882/vscode-dark-plus-webstorm: VSCode Dark+ theme and colourings for WebStorm
Another alternative (not tested) :
http://color-themes.com/?view=theme&id=57b63a1c849f3a1800dc1a1f
This one might be a good alternative (Dracula theme):
https://draculatheme.com/visual-studio-code/
https://draculatheme.com/jetbrains/
Step 1. install type definitions (e.g. vs code intellisense) to project:
npm install –save @types/underscore
(https://www.npmjs.com/package/@types/underscore)
Step 2. import to ts file:
import * as _ from “underscore”;
Source: How to use underscore lib from DefinitelyTyped with typescript? – Stack Overflow
TypeScript counterparts for C# LINQ.
Source: TypeScript vs. C#: LINQ
All of below are copied from https://decembersoft.com in case that blog post disappears in future, I save it here for time keeping. Let me know if its a problem.
TypeScript has no equivalent for the language-integrated-natural-query aspect of LINQ. (hey, isn’t that literally the whole acronym?)
True, you can’t write the following LINQ statement in TypeScript
var adultUserNames = from u in users where u.Age >= 18 select u.Name;
However, the IEnumerable<T> extension methods, which are at the heart of LINQ, have equivalents in TypeScript (or can be emulated).
// C#var leftToRight = users.Aggregate(initialValue, (a, u) => /* ... */);
// TypeScriptconst leftToRight = users.reduce((a, u) => /* ... */, initialValue);const rightToLeft = users.reduceRight((a, u) => /* ... */, initialValue);
// C#var allReady = users.All(u => u.IsReady);
// TypeScriptconst allReady = users.every(u => u.isReady);
// C#var isDirty = users.Any(u => u.IsDirty);
// TypeScriptconst isDirty = users.some(u => u.isDirty);
// C#var allUsers = users.Append(oneMoreUser);
// TypeScriptconst allUsers = [ ...users, oneMoreUser ];
// C#var avgAge = users.Average(u => u.Age);
// TypeScriptif (users.length < 1) { throw new Error('source contains no elements');}const avgAge = users.reduce((a, u) => a + u.age, 0) / users.length;
// C#var people = users.Cast<Person>();
// TypeScriptconst people = users as Person[];// Note: not semantically the same. The C# version throws an exception// if any of the users can't be cast to type Person.
// C#var allUsers = users.Concat(moreUsers);
// TypeScriptconst allUsers = [ ...users, ...moreUsers ];
// C#var hasAdmin = users.Contains(admin);
// TypeScriptconst hasAdmin = users.includes(admin); // Use a polyfill for IE support
// C#var n = users.Count();
// TypeScriptconst n = users.length;
// C#var nonEmptyUsers = Enumerable.DefaultIfEmpty(users);
// TypeScriptconst nonEmptyUsers = users.length ? users : [ null ];
// C#var uniqueNames = users.Select(u => u.Name).Distinct();
// TypeScriptconst uniqueNames = Object.keys( users.map(u => u.name).reduce( (un, u) => ({ ...un, n }), {} ));
// C#var nth = users.ElementAt(n);
// TypeScriptif (n < 0 || n > users.length) { throw new Error('Index was out of range');}const nth = users[n];
// C#var nth = users.ElementAtOrDefault(n);
// TypeScriptconst nth = users[n];
// C#var noUsers = IEnumerable.Empty<User>();
// TypeScriptconst noUsers: User[] = [];const noUsers = [] as User[];
// C#var maleUsers = users.Except(femaleUsers);
// TypeScriptconst maleUsers = users.filter(u => !femaleUsers.includes(u) // Use a polyfill for IE support);
// C#var first = users.First();
// TypeScriptif (users.length < 1) { throw new Error('Sequence contains no elements');}const first = users[0];
// C#var first = users.FirstOrDefault();
// TypeScriptconst first = users[0];
// C#users.ToList().ForEach(u => /* ... */);
// TypeScriptusers.forEach(u => /* ... */);
// C#var usersByCountry = users.GroupBy(u => u.Country);
// TypeScriptconst usersByCountry = users.reduce((ubc, u) => ({ ...ubc, [u.country]: [ ...(ubc[u.country] || []), u ],}), {});
// C#var targetUsers = usersWhoClicked.Intersect(usersBetween25And45);
// TypeScriptconst targetUsers = usersWhoClicked.filter(u => usersBetween25And45.includes(u) // Use a polyfill for IE support);
// C#var last = users.Last();
// TypeScriptif (users.length < 1) { throw new Error('Sequence contains no elements');}const last = users[users.length - 1];
// C#var last = users.LastOrDefault();
// TypeScriptconst last = users[users.length - 1];
// C#var oldestAge = users.Max(u => u.Age);
// TypeScriptif (users.length < 1) { throw new Error('source contains no elements');}const oldestAge = users.reduce((oa, u) => Math.max(oa, u.age), 0);
// C#var youngestAge = users.Min(u => u.Age);
// TypeScriptif (users.length < 1) { throw new Error('source contains no elements');}const youngestAge = users.reduce((ya, u) => Math.min(ya, u.age), Number.MAX_VALUE);
// C#var bots = users.OfType<Bot>();
// TypeScript// No equivalent
// C#var sorted = users.OrderBy(u => u.Age).ThenBy(u => u.Name);
// TypeScriptconst sorted = users.sort((a, b) => { const ageDiff = b.age - a.age; if (ageDiff) return ageDiff; return a.name.localeCompare(b.name); // Use a polyfill for IE support});
// C#var backwards = users.Reverse();
// TypeScriptconst backwards = users.reverse();// Caution: users is also reversed!
// C#var names = users.Select(u => u.Name);
// TypeScriptconst names = users.map(u => u.name);
// C#var phoneNumbers = users.SelectMany(u => u.PhoneNumbers);
// TypeScriptconst phoneNumbers = users.reduce((pn, u) => [ ...pn, ...u.phoneNumbers ], []);
// C#var user = users.Single();
// TypeScriptif (users.length > 1) { throw new Error('The input sequence contains more than one element');}else if (!users.length) { throw new Error('The input sequence is empty');}const user = users[0];
// C#var user = users.Single();
// TypeScriptconst user = users[0];
// C#var otherUsers = users.Skip(n);
// TypeScriptconst otherUsers = users.filter((u, i) => i >= n);
// C#var otherUsers = users.SkipWhile(predicate);
// TypeScriptlet i = 0;while (i < users.length && predicate(users[i++]));const otherUsers = users.slice(i - 1);
// C#var totalYears = users.Sum(u => u.Age);
// TypeScriptif (users.length < 1) { throw new Error('source contains no elements');}const totalYears = users.reduce((ty, u) => ty + u, 0);
// C#var otherUsers = users.Take(n);
// TypeScriptconst otherUsers = users.filter((u, i) => i < n);
// C#var otherUsers = users.TakeWhile(predicate);
// TypeScriptlet i = 0;while (i < users.length && predicate(users[i++]));const otherUsers = users.slice(0, i - 1);
// C#var allUsers = someUser.Union(otherUsers);
// TypeScriptconst allUsers = otherUsers.reduce((au, u) => au.includes(u) // Use a polyfill for IE support ? au : [ ...au, u ]}), someUsers));
// C#var adults = users.Where(u => u.Age >= 18);
// TypeScriptconst adults = users.filter(u => u.age >= 18);
// C#var matches = buyers.Zip(sellers, (b, s) => new { Buyer = b, Seller = s });
// TypeScriptconst matches = [];for (let i = 0; i < buyers.length && i < sellers.length; i++) { matches.push({ buyer: buyers[i], seller: sellers[i], });}
Select text.
Ctrl+alt+j – surround with tag.
Source: Wrapping a Tag. Example of Applying Surround Live Templates – Help | PhpStorm
Robo 3T Robo 3T (formerly Robomongo) is the free lightweight GUI for MongoDB enthusiasts. MongoDB GUI with embedded shell
Source: Robo 3T – formerly Robomongo — native MongoDB management tool (Admin UI)
Gotchas from using Angular with Redux: