Skip to content

Instantly share code, notes, and snippets.

View IEvangelist's full-sized avatar
:octocat:
Coding for a better world 🤓

David Pine IEvangelist

:octocat:
Coding for a better world 🤓
View GitHub Profile

👨🏿‍💻 👩🏿‍💻 👨🏾‍💻 👩🏾‍💻 👨🏽‍💻 👩🏽‍💻 👨🏼‍💻 👩🏼‍💻 👨🏻‍💻 👩🏻‍💻

public void Write(object o)
{
if (o ! is string)
{
Console.WriteLine("WTF?");
}
else
{
Console.WriteLine("OMG!");
}

Visual Studio Code: Authoring extensions

In less than five years, Visual Studio Code (VS Code) has become the most popular integrated development environment (IDE) in the world. It's built with love and in the open on GitHub, and runs on Chromium (a tip of the hat to Google). VS code is extendable and in this talk we'll cover how to author your very own extension.

You can expect to learn how to:

  • Debug your extension
  • Target specific languages
  • Expose settings to users
  • Provide statement completion
  • Handle user interactions
@IEvangelist
IEvangelist / emoji.md
Last active August 28, 2019 18:03 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
public static Dictionary<TKey, TElement> ToDistinctDictionary<TSource, TKey, TElement>(
this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector,
Func<TSource, TElement> elementSelector,
IEqualityComparer<TKey> comparer)
{
if (source is null) throw new ArgumentNullException(nameof(source));
if (keySelector is null) throw new ArgumentNullException(nameof(keySelector));
if (elementSelector is null) throw new ArgumentNullException(nameof(elementSelector));

This relies on the Newtonsoft.Json package. Once added as a package reference to your C# project, add the following class. This is an extension methods class, containing two convenience-centric extension methods:

using static Newtonsoft.Json.JsonConvert;

namespace IEvangelist.Extensions
{
    public static class ObjectExtensions
    {
        public static T FromJson<T>(this string json)
@IEvangelist
IEvangelist / airport-distance-map.markdown
Created October 19, 2018 01:32
Airport Distance Map

Airport Distance Map

Get the distance between two airports "as the crow flies".

Built with SVG, Vue, D3, GSAP, and love.

One of the first pieces I made with Vue in 2016, now presented in an updated & cleaned up format.

A Pen by Shaw on CodePen.

@IEvangelist
IEvangelist / deconstructs.md
Last active August 30, 2018 18:29
Notice that there is no concern, no breaking changes whatsoever... Just additions.
public class Coordinates
{
    internal int X { get; }
    internal int Y { get; }
    internal int Z { get; }
    
    public Coordinates(int x, int y)
    {
 X = x;

Tuple Extensions

public static class TupleExtensions {
    public static async Task<T> TryAwaitOrLogAsync<T>(
        this (Task<T> task, ILogger logger) t,
        T defaultValue = default) {
        try {
            var result = await t.task;
            return result == default ? defaultValue : result;

WebAssembly: The New Endgame?

You may have heard of WebAssembly, like myself you probably asked "why"? Why have another way of doing web? Why introduce another standard or technology? In a world of technology saturation, what good can this do? All these questions will be answered in this session. We will explore Microsoft's experimental .NET web framework using C#/Razor and HTML that runs in the browser with WebAssembly. We will uncover the capabilities and limitations. We will see this in action and debug C# code in the web dev tools, and more. Is this the next major web innovation for the developer community? I hope you join me to find out.