Skip to content

Instantly share code, notes, and snippets.

View jchandra74's full-sized avatar

Jimmy Chandra jchandra74

  • Sydney, NSW, Australia
View GitHub Profile
@jchandra74
jchandra74 / NullifyEmptyProperties.cs
Created September 7, 2016 03:53
Object graph walker that will clean up empty array, generic collection and string
using System;
using System.Collections.Generic;
using System.Reflection;
namespace Foo
{
public static class ObjectExtensions
{
public static void NullifyEmptyProperties(this object o)
{
@jchandra74
jchandra74 / PowerShell Customization.md
Last active March 1, 2024 01:02
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

PowerShell GUID Generator

From time to time, I need to generate GUID to be used as Unique Id for whatever reason. When I have Visual Studio opened, I usually use the GUID tool that comes with it.

But sometimes I am developing in VS Code and opening Visual Studio just to get access to the GUID tool is a pain.

So why not add the functionality to PowerShell instead? You can have PowerShell available from inside VS Code Terminal. It's the perfect thing to add.

So how do we go about that?

@jchandra74
jchandra74 / openssl.MD
Last active February 16, 2024 21:23
HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

Overview

My main development workstation is a Windows 10 machine, so we'll approach this from that viewpoint.

Recently, Google Chrome started giving me a warning when I open a site that uses https and self-signed certificate on my local development machine due to some SSL certificate issues like the one below:

Self-Signed SSL Issue in Chrome

@jchandra74
jchandra74 / index.html
Created February 7, 2020 17:04
JS Bin Implementation of Find First Non Repeatable Character in a String // source https://jsbin.com/gomukah
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Implementation of Find First Non Repeatable Character in a String">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>