Exotic Git Snippets
Some git commands and scripts that come in handy from time to time.
Some git commands and scripts that come in handy from time to time.
A free and open source Chrome Extension that adds Github stars badges to all links on a web page.
Before: https://github.com/sindresorhus/awesome
After: sindresorhus/awesome
A cheat sheet for the regex syntax in JavaScript.
TL&DR
''.test(/^$/);
'ok'.replace(/(.)(.)/g, '$2$1'); // $$, $&, $`, $'
const matchG = 'aaa'.match(/a/g);
matchG == ['a', 'a', 'a'];
const matchNoG = 'str'.match(/(st)r/);
matchNoG == Object.assign(['str', 'st'], {groups: undefined, index: 0, input: 'str'});
matchNoG == /(st)r/.exec('str');
When confronted with a problem, don’t ask the person next to you for help right away, he’s probably doing something important as well!
Instead, first tell the duck about it - out loud. If you don’t get to a solution, start explaining your problem in more and more detail until it hits you. If the mere explanation led to a solution, you avoid unwillingly turning your colleague into a CardboardProgrammer.
This is something for me (or anyone else really) because I keep forgetting all this stuff.
{: .hide-from-excerpt}
to do just that.img
size must be 360x300. bigimg
is 1400x262.—
The Array.prototype
functions have been available for a long time but
it’s since Arrow functions
that “Linq lambda syntax”-like functionality is available in JavaScript.
This blog post explains the most common functions by comparing them to their C# equivalents.
A basic example:
// JavaScript
const result = [0, 1, 2, 3, null]
.filter(x => x !== null)
.map(x => x * 10)
.sort((a, b) => b - a);
expect(result).toEqual([30, 20, 10, 0]);
// C#
var result = new int?[] {0, 1, 2, 3, null}
.Where(x => x != null)
.Select(x => x * 10)
.OrderByDescending(x => x)
.ToArray();
Pipes: Chainable, declarative display-value transformations to use in your Html.
This post covers:
An example:
<!-- This does exactly what you'd think -->
{{ value | uppercase }}
Last update on Jan 16, 2020
Published to the PowerShell Gallery
Last update on Dec 30, 2019
PS scripts to remap remote urls & create a PR
Last update on Jan 18, 2019
await/async is pretty standard now. Added expectAsync examples.
Last update on Jan 17, 2019
Added reporter plugins
Last update on Sep 4, 2018
Updated locations for PowerShell Core
Last update on Aug 30, 2018
Hijacking Windows + E