These are my notes. See also “[Compiling C to WebAssembly using clang/LLVM and WASI][fda]” by [Frank Denis], which was my starting point.
Assume the following example program in a file called example.c
:
#include
// This script is related the following blog entry by Mark Seeman titled, | |
// "Builder as a monoid": | |
// | |
// https://blog.ploeh.dk/2020/02/17/builder-as-a-monoid/ | |
// | |
// It demonstrates a simpler approach to avoid the ceremony of "explicit | |
// endomorphism" by using merely delegates. It does so by replacing | |
// "IEndomorphism<T>" with "Func<T, T>" and then using "+" in lieu of | |
// "AppendEndomorphism<T>" to achieve the same effect. | |
// |
@echo off | |
setlocal | |
for /f "usebackq" %%f in (`PowerShell -C "([datetimeoffset](git ls -1 --pretty=%%cI)).ToUniversalTime().ToString('yyyyMMdd''T''HHmm')"`) do set COMMIT_TIMESTAMP=%%f | |
if not %ERRORLEVEL%==0 exit /b %ERRORLEVEL% | |
call "%~dp0pack.cmd" priv-%COMMIT_TIMESTAMP% | |
exit /b %ERRORLEVEL% |
using System; | |
using System.IO; | |
using SharpLab.Runtime; | |
static class X | |
{ | |
public static bool HasFlag(this FileAttributes self, FileAttributes flag) => | |
(self & flag) == flag; | |
[JitGeneric(typeof(FileAttributes))] |
<# | |
MIT License | |
Copyright (c) 2019 Atif Aziz | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
Accelerator | Type | |
---|---|---|
adsi | System.DirectoryServices.DirectoryEntry | |
adsisearcher | System.DirectoryServices.DirectorySearcher | |
Alias | System.Management.Automation.AliasAttribute | |
AllowEmptyCollection | System.Management.Automation.AllowEmptyCollectionAttribute | |
AllowEmptyString | System.Management.Automation.AllowEmptyStringAttribute | |
AllowNull | System.Management.Automation.AllowNullAttribute | |
ArgumentCompleter | System.Management.Automation.ArgumentCompleterAttribute | |
array | System.Array | |
bigint | System.Numerics.BigInteger |
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Keywords> | |
<Keyword>linq</Keyword> | |
<Keyword>extensions</Keyword> | |
</Keywords> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> |
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>netcoreapp2.1</TargetFramework> | |
</PropertyGroup> | |
</Project> |
yellow=<DIR>.+$ | |
magenta=<(JUNCTION|SYMLINKD)>.+$ | |
yellow=(?<=<(JUNCTION|SYMLINKD)>.+)\[.+\]$ | |
cyan=(?<=\x20)(?i:[^\x20]+\.(cmd|bat|exe|com|ps1|wsh|wsf|vbs))$ | |
gray=\(([0-9][0-9]?|[0-9][0-9,'.][0-9]*)\) |
#region Copyright (c) 2018 Atif Aziz. All rights reserved. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a | |
// copy of this software and associated documentation files (the "Software"), | |
// to deal in the Software without restriction, including without limitation | |
// the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
// and/or sell copies of the Software, and to permit persons to whom the | |
// Software is furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |