Skip to main content

Links from my inbox September 18 2022

· 11 min read

Good Reads / Videos

Retro

Web / JavaScript

My experimental snippet:

(async () => {
function sleep(ms) {
return new Promise((resolve, reject) => {
setTimeout(resolve, ms)
})
}

function setClipboard(html) {
const type = "text/html";
const blob = new Blob([html], { type });
const data = [ new ClipboardItem({ [type]: blob })];

navigator.clipboard.write(data).then(
function () {
console.log("Done");
},
function (err) {
console.error(err);
}
);
}
console.log("Wait");
await sleep(3000);
console.log("Go!");
setClipboard(String.raw`
<table>
<tr>
<td><b>Hello</b></td><td>World</td>
</tr>
<tr>
<td><b>Done</b></td><td>AAA</td>
</tr>
</table>
`);

})()
  • 2022-09-03 Building an aircraft radar system in JavaScript Charlie Gerard

    I’ve been interested in building a radar system for a while now. I’ve been following the development of the RTL-SDR for a while, and I’ve been wanting to build a system that uses it. I’ve also been wanting to build a web app that uses WebUSB to communicate with a USB device. So I decided to combine the two and build a web app that uses a RTL-SDR to display aircraft on a map.

CSS

I might be understating it a bit, but WebGL is a big deal. You only need to spend five minutes on one of the many design awards sites to see site-after-site fully leaning into the power of canvas. Tools like threejs bring the power of 3D and GLSL shaders to the browser and, with that, a whole new level of visual effects.

C# / .NET

  • 2022-08-26 🤩 SharpLab

    SharpLab is an interactive playground for .NET code. It allows you to run and debug your C# code directly in the browser. It also allows you to share your code with others and see their changes in real-time.

  • 2022-08-26 ashmind/SharpLab: .NET language playground

  • 2022-08-30 badamczewski/PowerUp: ⚡ Decompilation Tools and High Productivity Utilities ⚡

    PowerUp is a collection of productivity utilities, disassembly and decompilation tools for multiple languages and platforms. The project features the following utilities and tools:

    • Live IDE Watcher (For C#, F#, GO, Rust and C++ (clang)).
    • .NET JIT Dissasembler.
    • .NET IL Compiler.
    • .NET Console with rich formatting.
  • 2022-09-02 C# does Shell, Part 3 - CodeProject

    This article is about Application Desktop Toolbars, which are applications that can align to the screen much like the taskbar. The article will develop a base class for developing such apps.

Projects

GO

Emacs

M-x package-install RET borland-blue-theme RET

Alternatively put the this directory to the custom-theme-load and add the following to your init file:

(push (substitute-in-file-name "~/.emacs.d/borland-blue-theme/") custom-theme-load-path)
(load-theme 'borland-blue t)

Media - Images

When I am making animations, with the intent of ultimately becoming a GIF file on the internet, I pretty much always target 50 fps.

Media FFmpeg

Visual Studio DTE in Powershell

Control Visual Studio from Powershell using the DTE (Development Tools Environment) COM Object.

I found a simple answer by playing with the idea in ISE for a little while.

Basically, the call to GetActiveObject returns a COM object, which can be used directly in PowerShell. After executing LoadDTELibs, you can get an instance of DTE by calling GetActiveObject and then refer to the result directly.

So...
PS> $dte = [System.Runtime.InteropServices.Marshal]::GetActiveObject("VisualStudio.DTE.11.0")
PS> $dte = [System.Runtime.InteropServices.Marshal]::GetActiveObject("VisualStudio.DTE")
PS> $dte.solution.Create("D:\Testing", "Acme.sln")
PS> $dte.solution.SaveAs("D:\Testing\Acme.sln")
Get-ChildItem HKLM:\Software\Classes -ErrorAction SilentlyContinue | Where-Object {
$_.PSChildName -match '^\w+\.\w+$' -and (Test-Path -Path "$($_.PSPath)\CLSID")
} | Select-Object -ExpandProperty PSChildName
Sub DTEExample()
Dim objTextDoc As TextDocument
Dim objEP As EditPoint

' Create a new text document.
DTE.ItemOperations.NewFile("General\Text File")
' Get a handle to the new document.
Set objTextDoc = DTE.ActiveDocument.Object("TextDocument")
Set objEP = objTextDoc.StartPoint.CreateEditPoint
' Create an EditPoint and add some text.
objEP.Insert "A test sentence."
End Sub
$dte.ActiveDocument | Get-Member -MemberType All

Cheatsheets

SSH

A better solution is to use ssh-keygen -o.
PS c:> type $env:USERPROFILE\.ssh\id_rsa.pub | ssh peter@192.0.2.16 "cat >> .ssh/authorized_keys"

JWT

Screen capture API

Record screen video with Screen Capture API

Until a while ago, I was a Linux user and I used ffmpeg to make gif animations for my Blog. I recently moved to Windows and was wondering how I could make a gif animation. I found out that I could make them with ffmpeg for Windows.

Games - Factorio

Watch