What not to do in a remote job interview

  • Wear a t-shirt
  • Not wearing pants even if you are not standing up
  • Show up with messy hair
  • Be sick and not mention it
  • Close the door behind you
  • Make sure the lighting is good
  • Join late for the call
  • Making sure the mic is working
  • Saying “like” and “um” more than once a minute
  • Pronounce the name wrong
  • Know nothing about the company
  • Know nothing about the position
  • Play with your phone – Unless it’s your mom from the hospital
  • Forget to mute your phone and notifications – Stop the buzz
  • Pick your nose – either one would do
  • Not knowing the basics (like the difference between abstract class and interfaces)
  • Spout bullshit – You will be surprised how many people can detect that
  • Lie
  • Talk too much – especially when it’s not related
  • Going off on a tangent – talking about bitcoins when asked about the weather
  • Show magic tricks
  • Brag about materials
  • Talk about how you hacked into (read copy pasted/ stolen code/data) from someone

How to get a custom subdomain for your Sitecore Content Hub instance.

You have a baby girl at home, but you want her to be potty trained?

You have a narrow garage and don’t have space to get out of your car after you park?

You just got a new phone but now you have to use Bluetooth headphones and they don’t fit inside your ear hole?

These are the problems I can’t help you with today. But I can help you by letting you know how to get a subdomain for your Content Hub instance.

  • you want to get a custom subdomain name for your content hub instance. so that it looks nicer and branded and easier to remember. Let’s say you want https://topaz.sitecorecontenthub.cloud
  • It’s a simple process. Create a Sitecore ticket. Follow the below screenshot when creating and Hank wil be your uncle.
  • That should be it. if there is anything I will come back here and edit the post.

~ If you put all your junk in your garage, you will have no room left for your cars. ~

How to survive remote work?

I am a people person. I love being around new people. I love mingling, talking to strangers, saying hi, and nodding to passersby. But I have missed that since I started working remotely from my home office.

Here are some things I do to keep myself sane.

  • Keep my video on when having meetings.
  • Whenever I have a question, rather than asking in a chat message I book a 10 minutes call. I spend three minutes talking about random things, and the other seven about work.
  • Move my office around the house, I have one room as my regular office, but I have a smaller desk in my living room, another in my basement and my kitchen dining table is my fourth office location.
  • Do groceries more often.
  • Go for coffee with friends after work if life allows.
  • Take long drives on weekends and get out of the house.
  • I take regular breaks, go to my backyard, and check my mailbox once or twice a day during work just to see my neighbors and get some sun.

~ Don’t work for someone else. Work to make money for yourself. ~

Visual studio Code + Mac + Terminal + NodeJS + Express + Heroku = free API hosting FTW

> mkdir testapi
> cd testapi/
> npm init
> npm init -y
> npm i express --save
> touch server.js
> git init
> git add -a -m "initial commit"
> heroku login
> heroku create
> git push heroku master
> git add .
> git commit -m "initial commit"
> heroku open

Some gotchas:

  • I was trying to run these from visual studio terminal which should work but using the system terminal was better, less prone to error
  • “npm init -fy” didnt work on my computer
  • Only doing “npm init” was asking for package, so I did -y
  • server.js looks like
var express = require('express');
var port = process.env.PORT || 3000;
var app = express();
app.get('/', function (req, res) {
    res.send(JSON.stringify({ Hello: 'World' }));
});
app.listen(port, function () {
    console.log('Example app listening on port !');
});
  • of course, make sure you have Heroku account beforehand
  • don’t forget to add a favicon.ico file on the root, Heroku app will crashe without it.
  • Package.json looks like this
{
  "name": "testapi",
  "version": "1.0.0",
  "description": "",
  "main": "server.js", //make sure this is right
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js" //this will be the same as main
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.17.1"
  }
}
  • That’s it
  • REALLY!!

~ Failure is not the pillar of success, trying is. ~

Visual Studio’s Live Share tool is a lifesaver when working from home…

Everyone knows It’s Corona Time. Like many others, I am working from home.

Here is a new tool that I always ignored that has changed our lives lately.

It’s called LIVE SHARE, a Visual Studio add-on.

Get it from https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsls-vs

This will adda button to the bottom right corner of your VS. You will need an account to login to VS as well. Once setup just start the share. The url will be automatically copied to your clipboard as well!

We have also been using Loom a lot for recording and sharing screens.

 

~ The only difference between monkeys and us are that we know how to use tools. Once they learn how to do that, we are doomed. ~

 

Make sure all your config file’s build action is set properly in Visual Studio.

One late afternoon, I was working on a client’s Sitecore and trying to deploy some changes through their azure DevOps pipeline.

I had some changes to a config file. But it was not pushing thru to the server. Files were checked in. It was showing up on the repo on the right branch. But the reason the updated changes were not showing up because the config file’s “build action” was set to “none”. In Visual Studio this needs to be set to “Content”.

Visual Studio 2010 : Build Action详解-流o氓的小窝

Another day: Sitecore helix was my new best friend. I was working with 20+ projects in the solution. A big clump of features, foundation, and other things. All of them having their own web.config.

I am sure you had at least one bad day when you left the web.config as content and it overwrote the main config on the root when it’s not supposed to. It was the same issue. Build action has to be set to none.

Remember this. It will come in handy.

Here are the details for all the values:

Build action values

Some of the more common build actions for C# and Visual Basic project files are:

 
Build Action Project types Description
additional files C#, Visual Basic A non-source text file that’s passed to the C# or Visual Basic compiler as input. This build action is mainly used to provide inputs to analyzers that are referenced by a project to verify code quality. For more information, see Use additional files.
ApplicationDefinition WPF The file that defines your application. When you first create a project, this is App.xaml.
CodeAnalysisDictionary .NET A custom word dictionary, used by Code Analysis for spell checking. See How to: Customize the Code Analysis Dictionary
Compile any The file is passed to the compiler as a source file.
Content .NET A file marked as Content can be retrieved as a stream by calling Application.GetContentStream. For ASP.NET projects, these files are included as part of the site when it’s deployed.
design data WPF Used for XAML ViewModel files, to enable user controls to be viewed at design time, with dummy types and sample data.
DesignDataWithDesignTimeCreateable WPF Like DesignData, but with actual types.
Embedded Resource .NET The file is passed to the compiler as a resource to be embedded in the assembly. You can call System.Reflection.Assembly.GetManifestResourceStream to read the file from the assembly.
EntityDeploy .NET For Entity Framework (EF) .edmx files that specify deployment of EF artifacts.
Fakes .NET Used for the Microsoft Fakes testing framework. See Isolate code under test using Microsoft Fakes
None any The file isn’t part of the build in any way. This value can be used for documentation files such as “ReadMe” files, for example.
Page WPF Compile a XAML file to a binary .baml file for faster loading at run time.
Resource WPF Specifies to embed the file in an assembly manifest resource file with the extension .g.resources.
Shadow .NET Used for a .accessor file that contains a list of built assembly filenames, one per line. For each assembly on the list, generate public classes with the names that are just like the originals, but with public methods instead of private methods. Used for unit testing.
Splash Screen WPF Specifies an image file to be displayed at run time when the app is starting up.
XamlAppDef Windows Workflow Foundation Instructs the build to build a workflow XAML file into an assembly with an embedded workflow.

 

~ When life gives you a lemon, add sugar to it. ~

All the Redirect Rules you will ever need in web.config

Force HTTPS redirect (Permanently)

<rule name="Root Hit Force HTTPS Redirection" enabled="false" stopProcessing="true">
    <match url="^$" ignoreCase="false" />
    <conditions>
        <add input="{HTTPS}" pattern="^OFF$" />
        <add input="{HTTP_METHOD}" pattern="GET" />
    </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}/" redirectType="Permanent" />
</rule>

Sitecore Login & Admin Site Force HTTPS Redirection

<rule name="Sitecore Login or Admin Force HTTPS Redirection" enabled="true" stopProcessing="true">
    <match url="^(sitecore/(login|admin))$" />
    <conditions>
        <add input="{HTTPS}" pattern="^OFF$" />
        <add input="{HTTP_METHOD}" pattern="GET" />
    </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>

Match a pattern and redirect somewhere else

<rule name="Forbidden" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
     <match url="(.*)" />
     <conditions logicalGrouping="MatchAny">
         <add input="{HTTPS}" pattern="^OFF$" />
         <add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" />
     </conditions>
     <action type="Redirect" url="https://destination.com{REQUEST_URI}" appendQueryString="false" />
</rule>

Redirect to non-www site url

<rule name="RedirectWwwToNonWww" stopProcessing="false">
   <match url="(.*)" />
   <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
       <add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" />
   </conditions>
   <action type="Redirect" url="https://{C:2}{REQUEST_URI}" redirectType="Permanent" />
</rule>

Redirect some domains to another domain

<rule name="all domains to destination" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^destination1.com$" ignoreCase="true" />
<add input="{HTTP_HOST}" pattern="^destination2.com$" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://destination.com/{R:1}" />
</rule>

Am I missing some? Let me know and I can add more…

 

~ Delayed gratification is my type of happiness only if I am alive that long. ~

Move old code into new GitHub repo

I am sure you found an old code in your backup hard-drive from 10 years ago. And you trying to remember what you were thinking when you backed up the code off-grid under ground but not leave it in a repo in GitHub. Even if it’s top secret PRISM code, you could still upload it in to a private GitHub repo.

Open git back on the code base root.

To remove a remote:  git remote remove origin

To add a remote:  git remote add origin yourRemoteUrl

then  git push -u origin master

 From there, you can run git init to create a fresh repository.

BADA BING BADA BOOM!