Skip to content

Instantly share code, notes, and snippets.

View benvillalobos's full-sized avatar

Ben Villalobos benvillalobos

View GitHub Profile
@benvillalobos
benvillalobos / git-lg.md
Created April 27, 2025 15:41
blog-images

1 2

@benvillalobos
benvillalobos / arch.md
Last active January 21, 2025 04:38
oot-docs
graph TD
    Scene[Scene]
    Scene --> Room[Room]
    Room --> Actors[Actors]
    Room --> Objects[Objects]
    Scene --> Cutscene[Cutscene]
    Actors --> Enemies[Enemies]
    Actors --> Plants[Plants]
@benvillalobos
benvillalobos / logger-output.md
Last active May 10, 2024 18:38
C# Unit Testing: Verifying ILogger Output with Moq

Context

Using the Moq framework, it's non-trivial in some cases to verify "Did my logger actually log X message?" The first important note is you can't use Moq on extension methods, so you can't directly check LogWarning for example. The workaround is to mock the method that the extension method calls..

For example, I want to verify that LogWarning(mymsg) was logged, but LogWarning is an extension method. So instead of checking that LogWarning was called, we check that Log was called because LogWarning eventually calls Log.

Finally, this SO post showed me how to verify that specific message was l

@benvillalobos
benvillalobos / timetrialinvestigation.md
Last active February 20, 2024 16:22
gravitorium-2-20

Investigation Notes

Time Trial object is the following:

  1. An object that is anchored at the bottom
  2. A background that has an image
  3. Text which is constantly being modified ----
  4. Note it also exists in a separate canvas
  5. Also note: It exists within DontDestroyOnLoad

References

@benvillalobos
benvillalobos / foo.md
Last active February 15, 2024 18:48
vscode-webview-copy

There is a CopyToClipboard message that the webview sends.

This means the webview needs to send the copy to clipboard message, while sending the contents to copy within the message.

So within a react file I might have access to the window! <- confirmed

Extension sees the rightclick -> Copy command

Extension tells webview to copy via CopyToClipboard

@benvillalobos
benvillalobos / response-header-override.md
Created December 8, 2023 22:00
Overriding Response Headers in Chrome or Edge

‎‎​

@benvillalobos
benvillalobos / default.code-profile
Last active August 21, 2023 20:34
default.code-profile
{
"name": "education",
"settings": "{\"settings\":\"{\\n \\\"workbench.statusBar.visible\\\": false,\\n\\t\\\"workbench.layoutControl.enabled\\\": false,\\n \\\"window.title\\\": \\\"VS Code for Education\\\",\\n \\\"window.menuBarVisibility\\\": \\\"toggle\\\",\\n \\\"breadcrumbs.enabled\\\": false,\\n \\\"editor.minimap.enabled\\\": false,\\n \\\"extensions.ignoreRecommendations\\\": true,\\n \\\"editor.inlineSuggest.enabled\\\": true,\\n \\\"editor.fontSize\\\": 15,\\n \\\"editor.lineHeight\\\": 1.75,\\n \\\"python.wasm.runtime\\\": \\\"vscode-edu-py:///\\\"\\n}\"}",
"globalState": "{\"storage\":{\"menu.hiddenCommands\": {\"EditorTitle\":[\"workbench.action.splitEditor\"]},\"workbench.panel.markers.hidden\":\"[{\\\"id\\\":\\\"workbench.panel.markers.view\\\",\\\"isHidden\\\":false}]\",\"workbench.panel.output.hidden\":\"[{\\\"id\\\":\\\"workbench.panel.output\\\",\\\"isHidden\\\":false}]\",\"terminal.hidden\":\"[{\\\"id\\\":\\\"terminal\\\",\\\"isHidden\\\":fals
@benvillalobos
benvillalobos / binlog-spelunking.md
Last active September 7, 2022 23:39
Spelunking Through Binlogs

Spelunking Through Binlogs

This stuff ain't easy, so here's a WIP "get you up to speed" doc.

Setup

@benvillalobos
benvillalobos / custom-task-system-memory.md
Last active August 25, 2022 19:13
MSBuild Custom Task: Can't Find System.Memory

Custom MSBuild Task Can't Find System.Memory?

Why is this happening?

Your task is probably on .NET Core, meanwhile you're building with the net472-targeted MSBuild.exe. To fix this: either switch from using MSBuild.exe to using dotnet build, or change the TargetFramework of your task.

The long answer

Workarounds

  • Set the TargetFramework property in your task's project to net472.
@benvillalobos
benvillalobos / make-msbuild-short-lived.md
Last active August 25, 2022 18:50
Stop MSBuild From Holding Files

Stop MSBuild From Locking Files

Stop MSBuild from locking your files! Also, consider that the problem could be MSBuild or something your build is doing.

Note: Use Visual Studio Developer Command Prompt.

In Visual Studio

  1. set MSBUILDDISABLENODEREUSE=1
  2. devenv yourproject.csproj

In CLI