Skip to content

Instantly share code, notes, and snippets.

@khalidx
khalidx / node-typescript-esm.md
Last active April 22, 2024 15:40
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

class Konsole : IDisposable
{
ConsoleColor _orig_fg;
public static IDisposable Color(ConsoleColor fg)
{
var k = new Konsole()
{
_orig_fg = Console.ForegroundColor
};
#include <windows.h>
#include <pathcch.h>
#include <string>
#pragma comment(lib, "pathcch")
namespace impl
{
void check(HRESULT const result)
{
@devhawk
devhawk / buildcpp.xml
Last active February 17, 2016 15:50
Fix VC++ broken build folder structure
<!-- Add to .vcxproj file after line importing $(VCTargetsPath)\Microsoft.Cpp.props to have sensible build output folders -->
<!-- have VC++ emit build artifacts into \bin and \obj folders like managed proejcts do -->
<PropertyGroup>
<!--
The VC++ build scripts automatically appends atrailing slash on OutDir, which annoys some tools,
so I added OutputDirectory w/o the slash. Also, I'm using "PlatformShortName" so x86 binaries don't
end up in the "win32" directory
-->
@davidfowl
davidfowl / dotnetlayout.md
Last active May 3, 2024 08:40
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@devhawk
devhawk / gist:5570128
Created May 13, 2013 17:55
VBA macro to delete sub folders from Deleted Items in OUtlook
Sub RemoveAllDeletedItemsSubFolders()
Dim oDeletedItems As Outlook.Folder
Dim oFolders As Outlook.Folders
Dim oItems As Outlook.Items
Dim i As Long
'Obtain a reference to deleted items folder
Set oDeletedItems = Application.Session.GetDefaultFolder(olFolderDeletedItems)
Set oFolders = oDeletedItems.Folders
For i = oFolders.Count To 1 Step -1
@CodesInChaos
CodesInChaos / ArrayHelpers.cs
Created July 25, 2012 12:43
Base58 encoding in C# (Used for BitCoin addresses)
using System;
using System.Diagnostics.Contracts;
using System.Linq;
namespace Merkator.Tools
{
public class ArrayHelpers
{
public static T[] ConcatArrays<T>(params T[][] arrays)
{