Skip to content

Instantly share code, notes, and snippets.

Avatar
🎮
writing games

Frank Hale frankhale

🎮
writing games
  • Seminole, Florida
View GitHub Profile
View astar.py
# Credit for this: Nicholas Swift
# as found at https://medium.com/@nicholas.w.swift/easy-a-star-pathfinding-7e6689c7f7b2
from warnings import warn
import heapq
class Node:
"""
A node class for A* Pathfinding
"""
View wren amalgamation linker errors
/usr/bin/ld: /tmp/ccP4a8oZ.o: in function `prim_num_acos':
wren-test-almag.c:(.text+0xd2f6): undefined reference to `acos'
/usr/bin/ld: /tmp/ccP4a8oZ.o: in function `prim_num_asin':
wren-test-almag.c:(.text+0xd331): undefined reference to `asin'
/usr/bin/ld: /tmp/ccP4a8oZ.o: in function `prim_num_atan':
wren-test-almag.c:(.text+0xd36c): undefined reference to `atan'
/usr/bin/ld: /tmp/ccP4a8oZ.o: in function `prim_num_ceil':
wren-test-almag.c:(.text+0xd3a7): undefined reference to `ceil'
/usr/bin/ld: /tmp/ccP4a8oZ.o: in function `prim_num_cos':
wren-test-almag.c:(.text+0xd3e2): undefined reference to `cos'
View wren-test.c
#include "wren.h"
#include <stdio.h>
#include <string.h>
void writeFn(WrenVM* vm, const char* text) {
printf("%s", text);
}
void fooBar(WrenVM* vm) {
WrenType type = wrenGetSlotType(vm, 1);
@frankhale
frankhale / gist:4ea7a98af9451a71943ecd77efc66d55
Last active Mar 16, 2021
MassTransit ASPNET Core Azure ServiceBus config fail
View gist:4ea7a98af9451a71943ecd77efc66d55
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
var queueTopic = "topic name here";
var sendQueueConnectionString = "Send EndPoint Connection String Here";
var receiveQueueConnectionString = "Receive EndPoint COnnection String Here";
// My intent is to have this ASPNET Core API publish and also be a consumer
@frankhale
frankhale / MassTransitAPIEndPointTest.cs
Last active May 20, 2020
Guessing this is not possible?
View MassTransitAPIEndPointTest.cs
[Fact]
public async Task Get_GetDefaultEndPoint_ReturnsOk()
{
// Arrange
var harness = new InMemoryTestHarness();
var consumerHarness = harness.Consumer<MyMessageConsumer>();
await harness.Start();
try
{
View MassTransitConfig.cs
services.AddMassTransit(x =>
{
x.AddConsumer<MyMessageConsumer>();
x.AddBus(provider => Bus.Factory.CreateUsingInMemory(cfg =>
{
cfg.UseHealthCheck(provider);
cfg.ReceiveEndpoint("mymessage-endpoint", ep =>
{
ep.ConfigureConsumer<MyMessageConsumer>(provider);
});
@frankhale
frankhale / Foo.cs
Created May 14, 2020
Map single object to list of objects in AutoMapper
View Foo.cs
using AutoMapper;
using System.Collections.Generic;
namespace AutoMapperSandbox
{
public class SingleObjectToListConverter<T> : ITypeConverter<T, List<T>>
{
public List<T> Convert(T source, List<T> destination, ResolutionContext context)
{
return new List<T>() { source };
@frankhale
frankhale / mud-domain-model-ideas.md
Created Dec 2, 2018
A Psuedo-code modeling of a typical MUD domain
View mud-domain-model-ideas.md

Domain Model

This is a work in progress but is an attemp to model the domain of a typical MUD in psuedo-code

direction

  • name (string)

currency

@frankhale
frankhale / youtube-search-with-video-duration.js
Created Jun 15, 2017
Example of using YouTube-Search to perform a video search and then integrate the video duration into the results
View youtube-search-with-video-duration.js
const util = require("util");
const search = require("youtube-search");
const _ = require("lodash");
var xhr = require("xhr");
if (!xhr.open) xhr = require("request");
var opts = {
maxResults: 1,
key: "<YOUR_KEY_HERE>"
};
@frankhale
frankhale / vs-code-settings.txt
Created Jun 9, 2017
Tesla theme custom colors (VS Code)
View vs-code-settings.txt
"workbench.colorCustomizations": {
"editor.background": "#111",
"tab.activeBackground": "#313",
"activityBar.background": "#333",
"editorGroup.background": "#111",
"sideBar.background": "#111",
"statusBar.background": "#222"
}
Theme: Tesla