Quick tip with Typescript, Use moduleResolution

Module Resolution

https://www.typescriptlang.org/docs/handbook/module-resolution.html

One of the first items to not miss or be confused about when starting a typescript project is to set up the tsconfig.json to contain how to resolve the paths for inclusion in the app being built.

In my case, being reminded to use the node resolution strategy for importing from the node_modules folder was a requirement.

1
2
3
4
5
6
7
8
{
"compilerOptions": {
"target": "es2017",
"module": "es2015",
"sourceMap": true,
"moduleResolution": "node"
}
}

Also see some further examples here.
https://github.com/chanon/typescript_module_example

Using AutoHotkey with Surface Pen

AutoHotkey

https://autohotkey.com/

This is a scripting language designed for Windows to automate some usage. A lot can be accomplished by re-mapping the inputs.
While Windows 10 does allow apps to be loaded by the surface pen, however, these can be messed up and are very limited. What if the pen’s single click was “Copy” and the double-click was “Paste”? Something like this is easily achieved with AutoHotkey.

1
2
; remap surface pen button to copy to clip-board
#F20::^z

Simple mappings can be achieved with short-syntax, however the surface pen tends to have some problems with this when turing off the hotkeys. More success can be had by using the full syntax and applying the down and off state.

1
2
3
#F20::Run Onenote ; Single click, Open OneNote
#F19::Send, {Shift down}{LWin down}s{Shift up}{LWin up} ; Double click, Take a screenshot into onenote (hotkey created by onenote)
#F18::Send, {Control down}{Shift down}{Alt down}x{Control up}{Shift up}{Alt up} ; Hold button to trigger snippet tool (hotkey created within Windows)

This is the beginning of using AutoHotkey. It’s been around for many years and has thousands of options that can be scripted including mouse moving and deep Windows interactions. Check out https://github.com/dantheuber/WinTop-AutoHotKey for one of my favorite ways to keep a window on top with a transparency.

Displaying and escaping characters in Hexo

Hexo has a simple method for displaying characters that need to be escaped; using the raw and endraw tags. It’s possible to use the backtick character provided by Markdown to display the special characters and Hexo provides the {% raw %} {% endraw %} option to capture raw information not to be interpreted by Hexo, but hexo cannot support all strings. Like in the case of mixing the backtick ` statements provided by Markdown. The trick to be able to display any backticks (`) is a combination of the raw and endraw as well as using multiple backticks.

1
2
3
4
5
6
7
# Here is a codeblock using 3 backticks
# Render a backtick in Hexo
``{% raw %} `{% endraw %}``
# Rendering {% raw %} and {% endraw %} in Hexo
`{% raw %} {% {% endraw %}{% raw %}raw %} {% {% endraw %}{% raw %}endraw %}{% endraw %}`